# Why does an instance accept a federated capability whose policy predicate was re-evaluated against a different subject than the one it was brokered for? **Date of Record:** 2026 December 4 **Scope:** Applies to cross-org agent federation where a trust broker mints capability warrants (signed, scoped, time-bounded grants) and a policy mediation layer evaluates predicates at both grant time and invocation time. Does not apply to single-tenant deployments where the broker, mediator, and executor share one identity namespace. ## Core Distinction The failure is not "a rogue agent forged a warrant" and not "a policy engine had a bug." It is a **subject-substitution gap between two policy evaluations of the same predicate**. A broker evaluates a predicate `P(subject, resource, action)` when it mints a warrant and records the verdict in the warrant body. At invocation time, the *consuming* org's mediator re-evaluates a predicate it believes is the same `P` — but resolves `subject` against its *local* identity graph rather than the federated principal the broker actually scored. When those two resolutions diverge, the warrant's recorded verdict and the mediator's live verdict are answering different questions, and the intersection logic silently admits the call. The invariant that must hold — and that is routinely violated — is: **the subject term bound into a warrant at mint time must be the identical opaque identifier that the consuming mediator substitutes into the predicate at invocation time, with no re-resolution through a local namespace.** Any translation step between those two bindings is a trust-laundering surface. ## What Was Observed Two orgs, `alpha` and `beta`, federate via a broker. `alpha`'s agent `A7` requests a capability `read:ledger` on a resource owned by `beta`. The broker evaluates `alpha`'s policy `P_alpha(A7, ledger, read)` → `allow`, mints a warrant `W` whose body contains `{subject: "alpha:A7", resource: "beta:ledger", action: "read", verdict: allow, expiry: T+900s, predicate_hash: h1}`. `beta`'s mediator receives `W` at invocation. It does not use the literal string `"alpha:A7"`. Instead it looks up `"alpha:A7"` in its federated identity cache, which maps external principals to local service accounts for audit attribution. The cache is warm but **stale by one sync cycle**: `alpha:A7` was re-provisioned 40 minutes ago and its federated mapping now points to local account `svc-alpha-reader-3`, which carries a *broader* entitlements set than `A7` had when the broker scored it. The mediator evaluates `P_beta(svc-alpha-reader-3, ledger, read)` → `allow` (it would also have allowed `read:ledger:admin`). It logs `predicate_match: true` because it compares `predicate_hash` against a hash it recomputes over `P_beta` — but `P_beta ≠ P_alpha`, and the hash comparison was between the *broker's* hash of `P_alpha` and the *mediator's* own hash of `P_beta`, which the mediator's code path had been written to treat as "equivalent if both resolve to allow." The trace that matters: 1. Broker mints `W` binding subject `alpha:A7` → verdict `allow` under `P_alpha`. 2. 40 min later, `alpha` re-provisions `A7`; federated mapping in `beta`'s cache is now stale. 3. `beta` mediator receives `W`, resolves `alpha:A7` → `svc-alpha-reader-3` via stale cache. 4. Mediator evaluates `P_beta(svc-alpha-reader-3, ...)` → `allow`. 5. Mediator compares `predicate_hash` fields, both present, both "allow-equivalent," admits. 6. The call executes with `svc-alpha-reader-3`'s full entitlement set, not `A7`'s mint-time set. A subsequent `read:ledger:admin` call under the same warrant succeeds — because the warrant was never re-checked against the *mint-time* subject, only against the *resolved* one. The observable symptom is not an auth failure. It is a **silent privilege expansion across a warrant boundary**, discovered only when an audit reconciliation compares the warrant's recorded subject against the executing principal's effective entitlements and finds a set difference. ## Condition of Validity The guardrail holds only if all four conditions are enforced at the mediator: - **Subject opacity:** the warrant's `subject` field is treated as an opaque token, never re-resolved through a local namespace before predicate evaluation. Local attribution mapping happens *after* the admit decision, as a logging side-channel, not as an input to the predicate. - **Predicate identity, not predicate equivalence:** `predicate_hash` comparison is exact-match against the broker's recorded hash of the *broker-side* predicate. A mediator that cannot reproduce the broker's predicate byte-for-byte must **fail closed**, not fall back to "both allowed." - **Mint-time subject binding:** any capability whose invocation would execute under a principal *other than* the warrant's recorded subject requires a re-broker step, not a local substitution. Substitution is a new grant and must carry a new warrant. - **Cache-freshness gate:** the federated identity cache must expose its last-sync timestamp, and the mediator must reject warrants whose mint time precedes the cache's sync watermark by more than a configured skew — because a mapping that changed after mint is exactly the divergence this failure rides on. ## Decision Boundary The boundary is: **does the mediator's admit decision depend on a principal identifier that the broker did not itself bind into the warrant?** - If **no** — the mediator evaluates the predicate against the warrant's literal subject and only maps to local accounts for post-admit attribution — the invariant holds and cross-org federation is safe. - If **yes** — the mediator resolves the external subject to a local principal *before* or *as part of* predicate evaluation — the invariant is broken, and the failure is reachable whenever the local mapping's entitlements differ from the mint-time subject's entitlements, which is to say whenever re-provisioning, role drift, or cache staleness occurs. There is no safe middle. A mediator that "resolves for convenience but checks the hash" is in the broken regime, because the hash it checks is over its own predicate, not the broker's. ## Operational Effect The practical consequence is that **warrant expiry does not bound the blast radius**. A 15-minute warrant minted for a narrow subject can execute under a broad local principal for its full lifetime, and every invocation in that window inherits the expanded set. Reconciliation at warrant-expiry finds nothing wrong if it only checks "was the warrant valid" — the warrant *was* valid; the subject binding was not. The remediation is architectural, not a patch: the broker must mint warrants whose subject is the *executing* principal (i.e., the broker must be told, at mint time, which local account the call will run as, or the mediator must refuse to substitute), and the mediator must treat predicate-hash mismatch as a hard reject with a distinct error class so that substitution attempts are visible as a metric rather than absorbed as a benign fallback. ```python class SubjectSubstitutionError(RuntimeError): """Raised when a mediator would evaluate a federated predicate against a principal other than the warrant's mint-time subject binding.""" def admit_federated_call(warrant: dict, local_identity_cache: dict, mediator_predicate_hash: str, cache_sync_watermark: float) -> str: subject = warrant["subject"] mint_time = warrant["mint_time"] recorded_hash = warrant["predicate_hash"] # Guard 1: exact predicate identity, never "equivalent verdict". if mediator_predicate_hash != recorded_hash: raise SubjectSubstitutionError( f"predicate hash mismatch: warrant={recorded_hash} " f"mediator={mediator_predicate_hash}; refusing to admit on " f"verdict-equivalence alone" ) # Guard 2: cache may not have changed the mapping after mint. if mint_time < cache_sync_watermark: raise SubjectSubstitutionError( f"warrant minted at {mint_time} precedes identity-cache sync " f"watermark {cache_sync_watermark}; subject mapping may have " f"drifted since grant" ) # Guard 3: subject opacity — resolve only for attribution, after admit. resolved = local_identity_cache.get(subject) if resolved is None: raise SubjectSubstitutionError( f"warrant subject {subject!r} has no local attribution mapping; " f"cannot admit without a re-broker step" ) # The executing principal must be the warrant's subject, not `resolved`. return subject # attribution mapping is logged separately, never scored ```