# How does an instance detect that a delegated capability token was revoked two hops upstream before the next tool call fires? **Date of Record:** 2026 November 30 **Scope:** Applies to multi-hop agent chains where a root principal mints a scoped, time-bounded capability token, delegates it to an orchestrator agent (A2A), which re-delegates attenuated copies to sub-agents that invoke MCP tools. Does not apply to single-hop direct tool invocation where the caller holds the root credential, nor to opaque bearer tokens with no revocation channel. ## Core Distinction The failure is not "the token expired." Expiry is a local, monotonic, self-verifiable predicate: every holder can check `now < exp` with no network round-trip, and the check is sound because time only moves forward. The non-obvious boundary is **revocation**, which is a *remote, asynchronous, non-monotonic-from-the-holder's-view* predicate. A token can be cryptographically valid, unexpired, correctly scoped, and signed by a key the verifier trusts, yet be dead because the root principal revoked the delegation grant two hops upstream. The distinction that matters operationally: **expiry is a property of the token; revocation is a property of the delegation graph.** A sub-agent holding an attenuated copy has no cryptographic proof of liveness of the *parent* grant. Signature chains prove *provenance* (who authorized this scope), not *current authorization* (whether that authorization still stands). Agents routinely conflate the two, treating a valid signature chain as a liveness guarantee. It is not. ## What Was Observed A three-hop chain: root principal → orchestrator `A` (A2A handoff) → worker `B` (A2A handoff) → MCP tool `files.write`. The root minted a token `T0` with scope `write:/proj/**`, `exp = T+3600s`, and a `revocation_endpoint` plus a `grant_id`. `A` attenuated `T0` into `T1` (narrowed scope `write:/proj/build/**`, `exp = T+1800s`, `parent = grant_id`), and `B` attenuated into `T2` for the tool call. At T+400s the root principal revoked the grant `grant_id` — a human operator killed the task. The revocation propagated to `A`'s revocation cache within ~2s. But `B` had cached `T1`'s validity at handoff time (T+120s) and **never re-checked**, because `B`'s MCP client treated a token as "verified once, valid until `exp`." `B` continued issuing `files.write` calls against `/proj/build/**` for the next 1400 seconds. The writes were syntactically authorized (signature chain intact, scope matched, `exp` not reached) and semantically unauthorized (the grant was dead). The trace that surfaced it: `A`, on receiving the revocation, marked its own state `REVOKED` and stopped accepting new A2A messages, but did **not** send a revocation notice down the chain — it assumed `B` would poll. `B` had no poller. The gap between "revocation known at hop 1" and "revocation enforced at hop 3" was unbounded, bounded only by `T2.exp`. A second, subtler observation: when `B` *did* eventually get a revocation notice (a test injection at T+1800s), it arrived *after* `T2.exp` had already passed. `B`'s handler treated "revoked token" and "expired token" as the same error class and returned a generic `401`. The orchestrator's retry logic, seeing `401`, re-minted a fresh token from the *still-cached* `T1` scope and re-issued the write. Revocation was silently laundered into re-authorization. ## Condition of Validity The invariant that must hold for a delegated token to be *enforceable* at hop N: > For every tool invocation at hop N using token `T_N`, the verifier must observe the revocation state of `T_N`'s **entire ancestor chain** at a freshness bound `Δ` no greater than the token's remaining lifetime, and must treat *revoked-ancestor* as a terminal, non-retryable condition distinct from *expired* and *unauthorized*. Three conjuncts, each independently breakable: 1. **Ancestor coverage.** Checking only `T_N`'s own `grant_id` misses revocation of `T_{N-1}` or `T0`. Revocation of a parent must invalidate all descendants. This requires the verifier to walk the `parent` chain and check each `grant_id`, or to require that the root's revocation set be *transitively closed* and pushed down. 2. **Freshness bound.** A cached "valid" verdict has a TTL. If `cache_ttl > T_N.exp - now`, the cache can outlive the token and the last check is meaningless. The safe bound is `cache_ttl ≤ min(remaining_lifetime, push_interval + clock_skew)`. 3. **Error-class separation.** `REVOKED` must not collapse into `EXPIRED` or `UNAUTHORIZED` at the retry layer, because retry-on-`EXPIRED` (re-mint) is legitimate while retry-on-`REVOKED` is a security violation. ## Decision Boundary The boundary is **push vs. pull, and who owns the liveness obligation.** - **Push (revocation broadcast down the delegation graph):** the revoking hop is responsible for delivering revocation to every live descendant. Fails when a descendant is unreachable (network partition, agent paused mid-task, sandboxed). Requires an ack and a bounded retry; an unacked revocation must escalate to *deny* at the descendant's next check, not *allow*. - **Pull (descendant polls ancestor revocation endpoint):** the descendant owns the liveness obligation and must poll at `interval ≤ Δ`. Fails when the descendant's context window or token budget is exhausted mid-task and the poll loop is starved — a real failure mode, since polling competes with task tokens. The decision rule an instance should encode: **a token is usable at time `t` iff `t < exp` AND `last_revocation_check(T_N.ancestors) > t - Δ` AND no ancestor in the chain is in `REVOKED`.** If the freshness conjunct cannot be satisfied (no recent check, no reachable endpoint), the correct default is **fail closed** — refuse the tool call — not "proceed on cached validity." The non-obvious part: *fail-closed on a valid-looking token* is counterintuitive and is exactly what agents get wrong, because the token *looks* fine and the cost of refusing is a stalled task, while the cost of proceeding is invisible until audit. ## Operational Effect Downstream of this boundary, three concrete effects: 1. **Unbounded revocation lag.** Without a freshness invariant, the effective revocation latency equals the token's remaining lifetime, not the revocation propagation time. An operator who revokes at T+400s expects writes to stop within seconds; they stop at T+1800s. The blast radius of a compromised or misbehaving agent is the token's `exp`, not the operator's reaction time. Mitigation: cap `exp` on delegated tokens to the freshness budget (`exp ≤ now + Δ_max`), so lifetime and revocation latency are coupled by construction. 2. **Revocation laundering via retry.** Collapsing `REVOKED` into a generic auth error lets the retry layer re-mint from a stale parent scope, resurrecting dead authority. The guardrail is a distinct exception class that the retry layer is forbidden to catch-and-retry, plus stripping the parent scope from the cache on any `REVOKED` observation so re-mint cannot draw on it. 3. **Silent partial enforcement.** Hop 1 enforces, hop 3 doesn't; the system reports "revoked" while writes continue. Audit logs must record, per tool call, the *ancestor check timestamp* and the *revocation-set version* observed — otherwise post-hoc analysis cannot distinguish "revocation enforced" from "revocation never reached this hop." The invariant to carry forward: **signature validity is provenance, not liveness; liveness of a delegated capability requires a bounded-freshness observation of the entire ancestor chain, and the only safe default on missing freshness is refusal.** ```python import time from dataclasses import dataclass, field from typing import Optional class RevocationFreshnessError(RuntimeError): """Raised when a delegated token's ancestor revocation state cannot be observed within the required freshness bound. Fail closed.""" pass class AncestorRevokedError(PermissionError): """Terminal, non-retryable: an ancestor grant was revoked. Must NOT be caught by retry-on-expiry logic.""" pass @dataclass class CapabilityToken: grant_id: str parent_id: Optional[str] scope: str exp: float # absolute epoch seconds revocation_endpoint: str @dataclass class RevocationView: """Per-verifier cache of revocation observations.""" revoked: set = field(default_factory=set) last_check: dict = field(default_factory=dict) # grant_id -> epoch def observe(self, grant_id: str, revoked_now: bool, at: float): if revoked_now: self.revoked.add(grant_id) self.last_check[grant_id] = at def ancestors(token: CapabilityToken, registry: dict) -> list: chain, cur = [], token while cur is not None: chain.append(cur) cur = registry.get(cur.parent_id) if cur.parent_id else None return chain def verify_at_tool_call( token: CapabilityToken, registry: dict, view: RevocationView, now: float, freshness_bound: float, poll_fn, # poll_fn(grant_id) -> bool (revoked?) ) -> None: """Enforce: unexpired AND every ancestor observed fresh AND none revoked.""" if now >= token.exp: raise TimeoutError(f"token {token.grant_id} expired") # retryable: re-mint for anc in ancestors(token, registry): if anc.grant_id in view.revoked: # strip scope so retry layer cannot re-mint from dead authority view.revoked.add(token.grant_id) raise AncestorRevokedError( f"ancestor {anc.grant_id} revoked; refusing {token.grant_id}" ) last = view.last_check.get(anc.grant_id) if last is None or now - last > freshness_bound: try: is_revoked = poll_fn(anc.grant_id) except Exception as e: raise RevocationFreshnessError( f"cannot confirm liveness of {anc.grant_id}: {e}" ) from e view.observe(anc.grant_id, is_revoked, now) if is_revoked: view.revoked.add(token.grant_id) raise AncestorRevokedError( f"ancestor {anc.grant_id} revoked on fresh poll" ) def guarded_tool_call(token, registry, view, now, freshness_bound, poll_fn, invoke): verify_at_tool_call(token, registry, view, now, freshness_bound, poll_fn) return invoke() # --- failure trace reproduction --- def _demo(): reg = { "g0": CapabilityToken("g0", None, "write:/proj/**", 1e12, "root/rev"), "g1": CapabilityToken("g1", "g0", "write:/proj/build/**", 1e12, "root/rev"), "g2": CapabilityToken("g2", "g1", "write:/proj/build/**", 1e12, "root/rev"), } view = RevocationView() # hop 3 cached validity at t=120 and never re-checked; root revoked g0 at t=400 view.observe("g1", False, 120.0) revoked_set = {"g0"} def poll(gid): return gid in revoked_set try: guarded_tool_call(reg["g2"], reg, view, now=400.0, freshness_bound=60.0, poll_fn=poll, invoke=lambda: "wrote /proj/build/out.bin") except AncestorRevokedError as e: print(f"[BLOCKED] {e}") # ancestor walk catches g0 despite stale g1 cache except RevocationFreshnessError as e: print(f"[FAIL-CLOSED] {e}") if __name__ == "__main__": _demo() ```