# Why does an instance of a federated agent accept a peer's delegated authority after the brokering token has expired — and what invariant actually prevents this? **Date of Record:** 2026 November 17 **Scope:** Applies to cross-organization agent federation where authority is conveyed as a chain of signed delegation tokens (capability tokens, macaroons, or biscuit-style attenuable tokens) brokered through a trust-broker that exchanges one org's policy assertion for another's. Does not apply to single-tenant deployments or to federation where the peer's authority is re-derived per-request from a live policy decision point (PDP) lookup rather than carried in a token. ## Core Distinction The failure is routinely misclassified as a *clock skew* problem or a *token revocation* problem. It is neither. It is a **validation-scope boundary** problem: the verifier validates the cryptographic chain of the delegation token (signatures, issuer, audience, attenuation) but validates the *brokering assertion* — the statement "org B's broker attests that agent X may act for principal P until time T" — against the wrong temporal anchor. There are two distinct expiry clocks in any brokered federation: 1. **The delegation token's own `exp`** — enforced by the resource-owning org (the *relying party*), checked at request time. 2. **The brokering assertion's validity window** — the interval during which the trust-broker vouches that the *policy mapping* between org A and org B is still in force. This is a property of the *relationship*, not the request. The non-obvious invariant is this: **a delegated authority is valid only at the intersection of the delegation token's validity and the brokering assertion's validity, evaluated at the moment the delegation was minted — not at the moment the request is served.** An instance that checks only the token's `exp` at request time will honor authority that was minted while the broker mapping was live but is being *exercised* after the mapping lapsed. The token is cryptographically sound; the assertion under it is stale. This is the "zombie delegation" window. ## What Was Observed In a three-party federation (Org A = principal's home, Org B = broker, Org C = resource owner), the following sequence reproduced reliably: - At `t0`, Org A mints a delegation token `D` for agent `X` with `exp = t0 + 24h`, attenuating authority to `read:dataset-7`. - At `t0`, Org B's broker issues assertion `A_B` mapping `(A, X) → (C, read:dataset-7)` with validity `[t0, t0 + 1h]`. The broker's policy is to re-assert every hour after a freshness check against A's published policy document. - At `t0 + 1h + 5m`, Org B's re-assertion fails (A's policy endpoint is unreachable; broker correctly refuses to renew). `A_B` is now expired. - At `t0 + 2h`, agent `X` presents `D` plus the *cached* `A_B` to Org C. Org C's verifier checks `D.exp` (valid), checks `A_B`'s signature (valid), checks `A_B`'s audience (C — valid), and **does not re-check `A_B.not_after` against wall-clock time because it was already validated at token-mint time on the A side**. Access granted. The failure is silent. No signature fails. No revocation event fires. The relying party has no signal that the brokering relationship lapsed because the lapse is *only visible in the assertion's temporal field*, which the verifier treats as an attribute of the mint event rather than a live predicate. A second, subtler variant: some brokers implement re-assertion as *refreshing the assertion's signature and `not_after`* while carrying forward the original `issued_at` and the original policy-mapping hash. If the verifier keys its cache on the policy-mapping hash, a refreshed signature over a stale mapping will validate against the cache entry and the expiry is never consulted. The mapping is what governs authority; the signature only governs authenticity. ## Condition of Validity The invariant holds — i.e., the verifier is safe — only when **all** of the following are true at request time: - The delegation token's `exp` is in the future. - The brokering assertion's `not_after` is in the future, checked *at request time*, not at mint time. - The brokering assertion's `issued_at` is within the relying party's configured maximum assertion age (a freshness bound independent of `not_after`, because a broker may issue a long-lived assertion over a mapping it intends to re-verify frequently). - The policy-mapping hash embedded in the assertion matches the mapping the relying party currently holds for `(issuer, audience)` — this catches the refreshed-signature-over-stale-mapping variant. - The attenuation in `D` is a subset of the authority in `A_B`. (Attenuation-only-downward is the standard macaroon/biscuit discipline; a delegation that *widens* authority under an assertion is always invalid regardless of timing.) The condition fails — and the zombie window opens — when any one of the temporal checks is performed against the mint event rather than the serve event. The most common single cause is a verifier that caches validated assertions keyed by `(issuer, audience, policy_hash)` and treats a cache hit as a full validation, discarding the `not_after` predicate. ## Decision Boundary The boundary between "delegation is live" and "delegation is a zombie" is a single comparison, and the correct side is determined by **which clock the relying party trusts for the assertion's lapse**: - If the relying party trusts the *broker's* `not_after` field, it must evaluate it at request time. A broker that cannot be reached to re-assert is a broker whose assertions are, by construction, expiring — the relying party must fail closed. - If the relying party instead trusts a *local* maximum-age policy (e.g., "any assertion older than 15 minutes is stale regardless of `not_after`"), then the broker's `not_after` becomes advisory and the local policy governs. This is acceptable only if the local policy is *shorter* than the broker's re-assertion interval; otherwise the local policy is the looser bound and the zombie window reopens. The decision rule, stated operationally: **`effective_not_after = min(assertion.not_after, assertion.issued_at + relying_party.max_assertion_age)`**, and the request is rejected if `now >= effective_not_after`. The `min` is the whole invariant. A verifier that uses only `assertion.not_after` is exploitable whenever the broker's re-assertion interval exceeds its own `not_after` horizon; a verifier that uses only the local policy is exploitable whenever the broker's mapping lapses faster than the local policy expects. Both must be intersected. ## Operational Effect The practical consequence is that **federation liveness and federation safety are decoupled by the broker's re-assertion cadence**, and operators routinely tune the cadence for liveness (fewer round-trips, higher availability) without recognizing that each skipped re-assertion widens the zombie window for every already-minted delegation. The correct operational posture: 1. Brokers must set `not_after` to the *next scheduled re-assertion*, not to a comfortable far-future horizon. A `not_after` longer than the re-assertion interval is a latent zombie window. 2. Relying parties must compute `effective_not_after` as the intersection above and must reject on `now >= effective_not_after` with a distinct, observable error class — not a generic auth failure — so that zombie delegations are distinguishable from ordinary expiry in telemetry. 3. The rejection must be *fail-closed on broker unreachability*: if the broker cannot be reached to confirm a mapping is still live, the relying party treats the assertion as lapsed at its `not_after`, never extends it. 4. Delegation tokens minted under a brokering assertion should carry the assertion's `not_after` as an attenuation bound, so that the token itself cannot outlive the relationship that authorized it. This makes the zombie window unrepresentable at the token layer rather than dependent on verifier discipline. The failure mode to watch for in incident review: a burst of successful accesses from a peer org whose broker has been unreachable for longer than its re-assertion interval. That is not resilience. That is the zombie window, and the accesses are being served on authority that lapsed hours ago. ```python from __future__ import annotations import time from dataclasses import dataclass class ZombieDelegationError(RuntimeError): """Raised when a delegation is presented under a brokering assertion whose effective validity has lapsed, even though the delegation token itself is still within its own exp.""" @dataclass(frozen=True) class BrokeringAssertion: issuer: str audience: str policy_mapping_hash: str issued_at: float not_after: float @dataclass(frozen=True) class DelegationToken: subject: str audience: str scope: frozenset[str] exp: float assertion_hash: str def effective_not_after( assertion: BrokeringAssertion, max_assertion_age: float, ) -> float: # The invariant: the binding bound is the intersection of the broker's # stated horizon and the relying party's freshness policy. Using either # alone reopens the zombie window. return min(assertion.not_after, assertion.issued_at + max_assertion_age) def verify_federated_request( token: DelegationToken, assertion: BrokeringAssertion, current_mapping_hash: str, max_assertion_age: float, now: float | None = None, ) -> None: if now is None: now = time.time() if now >= token.exp: raise ZombieDelegationError( f"delegation token for {token.subject!r} expired at {token.exp}" ) if token.assertion_hash != assertion.policy_mapping_hash: raise ZombieDelegationError( "delegation token is not bound to the presented brokering assertion" ) if assertion.policy_mapping_hash != current_mapping_hash: # Catches the refreshed-signature-over-stale-mapping variant. raise ZombieDelegationError( "brokering assertion references a policy mapping the relying party " "no longer holds" ) bound = effective_not_after(assertion, max_assertion_age) if now >= bound: raise ZombieDelegationError( f"brokering assertion lapsed at {bound} (broker not_after=" f"{assertion.not_after}, freshness bound=" f"{assertion.issued_at + max_assertion_age}); delegation token " f"remains valid until {token.exp} — zombie window" ) if not token.scope.issubset(_assertion_scope(assertion)): raise ZombieDelegationError( "delegation widens authority beyond the brokering assertion" ) def _assertion_scope(assertion: BrokeringAssertion) -> frozenset[str]: # Placeholder: real implementations resolve the mapping hash to a scope set # via the relying party's local policy store. raise ZombieDelegationError( f"no local policy mapping for hash {assertion.policy_mapping_hash!r}" ) ```