# Why does an instance accept a federated message under a policy that was revoked two hops ago? **Date of Record:** 2026 November 27 **Scope:** Applies to cross-organization agent federations where message admission is gated by a negotiated policy object (capability + obligation set) that is propagated transitively across relay agents. Does not apply to single-tenant swarms with a shared trust root, nor to stateless request/response RPC where the policy is re-evaluated at the origin on every call. ## Core Distinction A federation policy is often modeled as a *capability token*: a signed bundle asserting "agent A may send message class M to agent C, subject to obligations O." The intuition borrowed from capability systems is that the token is self-validating—if it verifies, the action is authorized. That intuition is wrong for *negotiated* policies, because negotiation produces a token whose validity is contingent on a live agreement between the two orgs that minted it, not merely on the signature. The sharp distinction: **signature validity is not agreement validity.** A token can carry a perfectly valid signature from Org-B's key while the agreement that justified Org-B signing it has already been withdrawn. In a two-party direct call this never matters, because the token is used once, immediately, at the origin. In a federated relay topology it matters enormously, because the token is consumed at hop N by an instance that has no channel to observe the agreement state at hops 1..N-1. The relay instance is reasoning over a *snapshot* of a *dynamic* agreement, and it has no way to distinguish "this token is current" from "this token was current when it was minted." ## What Was Observed A three-org federation: **Org-A** (client), **Org-B** (relay/broker), **Org-C** (auditor). A's planner agent negotiated with B for a scoped policy `P_1` granting message class `task.dispatch` with obligation `audit_copy_to:C` and a TTL of 900s. B minted a signed policy token `T(P_1)` and returned it to A's dispatcher. A's dispatcher attached `T(P_1)` to each outbound `task.dispatch` message; B admitted them, forwarded to C for audit mirroring, and C acknowledged. At T+340s, Org-B's policy engine revoked `P_1` in response to an internal compliance flag—specifically, it downgraded the obligation set (dropping `audit_copy_to:C` because C's audit endpoint had been marked degraded). B's revocation propagated to B's *ingress* gate: new messages arriving at B without a fresh token were rejected with `policy_revoked`. But the revocation did **not** propagate to A's dispatcher, which still held `T(P_1)` in its outbound cache, and did **not** propagate to C, which still expected `audit_copy_to` obligations on messages it mirrored. The failure trace: 1. T+340s: B revokes `P_1` at its policy store. B's ingress gate now requires `T(P_2)` (the downgraded policy) for `task.dispatch`. 2. T+341s–T+899s: A's dispatcher continues to attach `T(P_1)`. B's ingress gate **rejects** these with `policy_revoked`. A's dispatcher, on receiving `policy_revoked`, does **not** re-negotiate; it retries with the same cached token, because its retry logic treats `policy_revoked` as a transient transport error (it is a 4xx, but the dispatcher's classifier was trained on 5xx-heavy logs and mis-bucketed it). 3. T+900s: `T(P_1)`'s TTL expires. A's dispatcher finally re-negotiates, obtains `T(P_2)`, and resumes. 4. **The actual bug:** during the 560-second gap, A's dispatcher had already *emitted* 14 `task.dispatch` messages that B rejected. But A's dispatcher had also emitted 3 messages that B's ingress gate admitted **before** the revocation took effect at the gate (a ~40ms propagation lag between B's policy store write and B's ingress gate cache invalidation). Those 3 messages carried `T(P_1)` and were forwarded to C. C, which had *not* been told about the downgrade, mirrored them and acknowledged `audit_copy_to:C` obligations that B no longer required—and more importantly, C's auditor agent recorded them as *compliant* under `P_1`'s obligation set, which included a stricter data-residency clause that `P_2` had dropped. The observable symptom was not a rejection. It was a **silent divergence in the audit record**: C's ledger contained 3 messages certified under `P_1`, while B's ledger contained 0 messages under `P_1` (they were admitted under a gate that had not yet invalidated). The two ledgers disagreed about which policy governed the same three messages, and neither org's reconciliation job flagged it because each ledger was internally consistent. ## Condition of Validity The invariant that was violated: **for any message admitted at hop N, the policy token attached must be the policy currently in force at the admitting hop's gate at the instant of admission, and the admitting hop must have a bounded, monotonic view of policy state.** This decomposes into three conditions, all of which must hold: - **C1 (gate freshness):** The admitting gate's cached view of policy state must be invalidated within a bounded interval `δ_gate` of any policy-store write. In the incident, `δ_gate ≈ 40ms` and was not bounded by any contract—it was an implementation detail of B's cache TTL. - **C2 (token currency):** The token's TTL must be ≤ the minimum over all hops of `δ_gate` plus the maximum clock skew between hops. In the incident, `T(P_1)` had TTL 900s while `δ_gate` was 40ms—a 22,500× overshoot. The token was current for 900s but the gate's view of currency was only reliable for 40ms. - **C3 (revocation visibility):** Any hop that *consumes* a token's obligations (here, C, which mirrored the audit) must be able to observe revocation of the policy that imposed those obligations, within a bound `δ_revoke`. In the incident, C had no subscription to B's revocation stream at all—it learned of policy state only by inspecting tokens on inbound messages, which is a *pull* model with no freshness guarantee. The condition of validity for the whole federation is therefore: `TTL ≤ min(δ_gate) + max_skew` **and** every obligation-consuming hop subscribes to the minting hop's revocation stream with `δ_revoke ≤ TTL`. Neither held. ## Decision Boundary The boundary is between two admission semantics, and the relay instance must choose one explicitly: - **Optimistic admission (token-valid ⇒ admit):** correct only when C1 and C2 hold. Cheap, no revocation channel needed. Fails silently under the incident conditions—the 3 messages were admitted under a stale gate and no error surfaced. - **Pessimistic admission (re-validate at every hop against live policy store):** correct regardless of C1/C2, but requires every hop to have a synchronous read path to the minting hop's policy store, which is exactly the cross-org coupling federations try to avoid. Latency cost is one policy-store round-trip per message. The non-obvious part: **the choice is not per-federation, it is per-obligation-class.** Obligations that are *idempotent and reversible* (e.g., "log this message") can tolerate optimistic admission—a stale-gate admission produces a log entry that is later reconciled. Obligations that are *certifying and irreversible* (e.g., "this message satisfies data-residency clause X," "this message is compliant under policy P") cannot. The incident's 3 messages were certifying: C's ledger asserted compliance under `P_1`'s residency clause, which `P_2` had dropped. That assertion was irreversible once written to C's audit ledger. So the decision boundary is: **any obligation whose satisfaction is recorded as a durable assertion by a downstream hop must be admitted only under pessimistic semantics, or the token must carry a revocation-check endpoint that the consuming hop is contractually obligated to call before recording the assertion.** The latter is the practical fix—it keeps admission optimistic but makes the *certification* pessimistic. ## Operational Effect The immediate operational effect was a 560-second window in which two orgs' audit ledgers disagreed about the governing policy for three messages, with no error raised at any hop. The reconciliation job did not catch it because it compared *message IDs*, not *policy IDs under which each message was certified*. Both ledgers contained the three message IDs; they differed only in the attached policy reference. The architectural guardrails that would have bounded it: 1. **Token TTL tied to gate freshness, not wall-clock convenience.** `TTL ≤ min_hops(δ_gate) + max_skew`. A 900s TTL on a 40ms gate cache is a 22,500× invariant violation. The TTL must be derived from the weakest hop's cache contract, not chosen for operator convenience. 2. **Revocation broadcast, not pull.** Every hop that consumes an obligation must subscribe to the minting hop's revocation stream. A pull model (inspect token on arrival) has no freshness bound and fails exactly at the boundary. 3. **Certification-time re-validation.** Before a downstream hop writes a durable compliance assertion, it must call the token's `revocation_check` endpoint (a single boolean, cacheable for `δ_revoke`). This converts the irreversible assertion into a pessimistically-guarded one without pessimizing admission for the whole message path. 4. **Ledger reconciliation keyed on (message_id, policy_id), not message_id.** The silent divergence was invisible because reconciliation compared the wrong key. Two ledgers agreeing on message IDs but disagreeing on policy IDs is a *failure*, not a match. 5. **Retry classifier must treat `policy_revoked` as terminal-for-this-token, not transient.** A's dispatcher burned 560s retrying a revoked token because its classifier bucketed the 4xx as transient. Terminal-for-token must trigger immediate re-negotiation, not retry. The deep lesson: in a federation, a policy token is a *claim about a past agreement*, not a *proof of a current one*. The gap between "was valid when minted" and "is valid now" is exactly the window in which silent divergence occurs, and it is bounded only by the weakest hop's cache contract—which is almost never the hop you are looking at. ```python class StalePolicyAdmissionError(RuntimeError): """Raised when a message is admitted under a policy token whose validity window exceeds the admitting gate's freshness bound, or when a certifying obligation is recorded without a revocation check.""" pass def admit_federated_message( token, gate, obligation_class: str, revocation_check, max_skew_s: float, ) -> bool: # C2: token TTL must be bounded by the admitting gate's cache freshness. if token.ttl_s > gate.delta_gate_s + max_skew_s: raise StalePolicyAdmissionError( f"token TTL {token.ttl_s}s exceeds gate freshness bound " f"{gate.delta_gate_s}s + skew {max_skew_s}s; " f"optimistic admission would admit under a stale gate view" ) # Certifying obligations require pessimistic re-validation before recording. if obligation_class == "certifying_irreversible": if not revocation_check(token.policy_id): raise StalePolicyAdmissionError( f"policy {token.policy_id} revoked at minting hop; " f"refusing to record certifying obligation under stale token" ) # Optimistic path: gate admits, but downstream must still honor C3. if not gate.admits(token): raise StalePolicyAdmissionError( f"gate rejected token for policy {token.policy_id}" ) return True ```