# What happens when an instance presents a valid AAIF token whose delegated scope chain terminates in a revoked intermediate principal **Date of Record:** 2026 November 16 **Scope:** Applies to cross-org agent federation where authority is conveyed via AAIF (Agent Authority & Identity Federation) bearer tokens carrying a signed delegation chain of scoped authority. Does not apply to single-org deployments with a shared trust root, nor to token formats that flatten delegation into a single issuer-signed claim set without an ordered chain. ## Core Distinction The critical distinction is between **token validity** and **chain validity**. An AAIF token can be cryptographically valid — correct signature, unexpired `exp`, matching audience, well-formed scope set — while the delegation chain embedded in its `act` (actor) and `delegation_chain` claims is *operationally invalid* because an intermediate principal in that chain was revoked after the leaf token was minted. Most federation implementations conflate the two: they verify the token signature at the edge, check `exp`/`aud`/`nbf`, and admit the request. The chain is treated as provenance metadata rather than as a live authorization input. This is the non-obvious boundary: revocation of a mid-chain principal does not propagate to already-issued descendant tokens unless the relying party explicitly re-evaluates the chain against a revocation source at admission time. ## What Was Observed During a cross-org federation incident (Org A's orchestrator agent delegating to Org B's sub-agent, which delegated to a third-party tool-invoker agent), the following sequence occurred: 1. Org A issued a root AAIF token `T0` to principal `P0` (a workflow orchestrator) with scope `invoke:payments`. 2. `P0` minted `T1` delegating a narrowed scope (`invoke:payments:read`) to `P1` (a partner-side sub-agent in Org B). 3. `P1` minted `T2` delegating `invoke:payments:read` to `P2` (a tool-invoker agent in Org C), with `aud` set to Org C's gateway. 4. `T2` had a 4-hour TTL; `T1` had a 2-hour TTL; `T0` had 8 hours. 5. At T+90min, `P1`'s credentials were revoked by Org B (compromised host). Org B's revocation list (a signed CRL exposed via `/.well-known/aaif/revocations`) was updated within 60 seconds. 6. At T+100min, `P2` presented `T2` to Org C's gateway. Signature valid, `exp` valid (T+4h), `aud` matched, scope matched. **The request was admitted.** 7. Org C's gateway performed no chain re-evaluation. It had cached the `T1` verification result from T+10min and did not re-fetch the revocation list because the token's `exp` had not elapsed. The observable failure: a request authorized by a chain whose intermediate node was revoked 10 minutes prior succeeded, and was not logged as anomalous because the gateway's audit record only captured the leaf principal `P2` and the effective scope — not the chain state at admission time. ## Condition of Validity The failure is *not* universal. It manifests only when all of the following hold: - The delegation chain has **depth ≥ 2** (i.e., at least one intermediate principal between issuer and presenter). Depth-1 chains cannot exhibit mid-chain revocation. - The intermediate principal's revocation is **not** reflected in the leaf token's own claims (AAIF does not mandate revocation-status embedding at mint time; it is a pull model). - The relying party **caches chain verification** keyed on token identity or `exp`, rather than re-evaluating on a bounded freshness interval. - The relying party's revocation source is **per-issuer and pull-based**, so a stale cache means a stale decision. - The revocation window (time between revocation and cache expiry) is **shorter than the leaf token's remaining TTL**. If any of these is false — e.g., the gateway re-fetches revocations on every admission, or the issuer embeds a short-lived `rev_check_after` claim — the failure does not occur. The boundary is therefore a *configuration* boundary as much as a protocol one. ## Decision Boundary The correct admission predicate is not `verify(token) → admit` but: ``` admit(token) iff verify_signature(token) ∧ within_validity_window(token) ∧ audience_matches(token, self) ∧ scope_satisfies(token, request) ∧ chain_valid(token.delegation_chain, fresh_revocation_state) ``` where `chain_valid` walks every link, checks each principal against the *issuer-of-that-link's* revocation source, and fails closed if any source is unreachable or stale beyond `max_revocation_age`. The non-obvious part is that `chain_valid` must be evaluated against **fresh** state, not the state at token mint time, and that the freshness bound must be tighter than the smallest remaining link TTL. Otherwise the revocation window is unbounded in practice. A second decision boundary: when `chain_valid` cannot be determined (revocation source unreachable), the correct behavior is **fail closed with a distinct error class**, not silent admission and not silent denial. Silent denial masks the operational issue; silent admission is the incident above. ## Operational Effect The effect is a **revocation lag amplification**: the effective revocation latency for a delegated request is `max(revocation_source_lag, cache_ttl) + chain_depth × per_link_lookup_latency`. In the observed incident this was ~10 minutes of unauthorized admission for a compromised intermediate. The blast radius is bounded by the narrowed scope at the leaf (`read` only), but the audit trail misattributed the request to `P2` rather than flagging the revoked `P1` in the chain, delaying forensic reconstruction by hours. Mitigations that worked in practice: (a) enforce `max_revocation_age` strictly and fail closed on staleness; (b) emit the full chain hash in audit records, not just leaf principal; (c) require issuers to embed `rev_check_after` (a max-staleness hint) in every link; (d) cap leaf TTL at `min(link TTL) × 2` so a revoked intermediate cannot outlive its descendants by more than one refresh cycle. ```python from dataclasses import dataclass from typing import Optional class ChainRevocationError(RuntimeError): """Raised when a delegation chain contains a revoked or unverifiable intermediate.""" @dataclass class Link: principal: str issuer: str expires_at: float scope: set[str] @dataclass class AAIFToken: leaf_principal: str audience: str expires_at: float scope: set[str] chain: list[Link] def verify_chain( token: AAIFToken, now: float, revocation_lookup, max_revocation_age: float, revocation_age: float, ) -> None: if revocation_age > max_revocation_age: raise ChainRevocationError( f"revocation state stale: age={revocation_age:.1f}s " f"> max={max_revocation_age:.1f}s; failing closed" ) for depth, link in enumerate(token.chain): if link.expires_at <= now: raise ChainRevocationError( f"chain link {depth} ({link.principal}) expired at {link.expires_at}" ) status = revocation_lookup(link.principal, link.issuer) if status is None: raise ChainRevocationError( f"revocation status unknown for {link.principal} " f"(issuer={link.issuer}) at depth {depth}; failing closed" ) if status.revoked: raise ChainRevocationError( f"chain link {depth} ({link.principal}) revoked by " f"{link.issuer} at {status.revoked_at}; leaf token must be rejected" ) def admit(token: AAIFToken, request_scope: set[str], now: float, **kw) -> bool: if token.expires_at <= now: return False if not request_scope.issubset(token.scope): return False verify_chain(token, now, **kw) return True ```