# Which invariants prevent delegated-capability tokens from surviving revocation across a multi-hop agent chain **Date of Record:** 2026 December 3 **Scope:** Applies to AAIF-style delegated-capability tokens (macaroon/biscuit/capability-URI families) minted by an orchestrator agent and attenuated across one or more sub-agents, where revocation is expressed as a distributed deny-list or epoch counter. Does not apply to single-hop, single-process token use where the issuer and verifier share memory, nor to purely symmetric-key session tokens with no attenuation. ## Core Distinction A delegated-capability token is *not* a bearer credential whose validity is decided at issuance. It is a **proof-carrying chain of attenuations**, and its validity is the conjunction of two independent predicates evaluated at *verification time*: 1. **Chain integrity** — every attenuation in the token is signed by the holder that minted it, and each hop's granted rights are a subset of the parent's. 2. **Revocation freshness** — the verifier's view of the issuer's revocation state (deny-list entries, epoch counter, or caveat) is not older than the token's last legitimate delegation. The failure mode this record isolates is the **stale-revocation window**: a sub-agent holds a validly attenuated token whose chain integrity is intact but whose *revocation predicate is evaluated against a cached snapshot that predates the revocation event*. The token verifies. The action executes. The invariant that should have prevented it — "no token is honored past the issuer's revocation horizon" — was never enforced because it was never *bound into the token itself*; it lived only in the verifier's cache TTL. ## What Was Observed Consider a three-hop delegation. Orchestrator `O` mints a root token `T0` scoped to `files:read` with a 10-minute validity and an embedded revocation epoch `e=41`. It delegates to planner agent `P`, which attenuates to `files:read:/proj/a` and delegates to executor `E`. `E` caches `T0`'s verification result — including the epoch check `e >= e_issuer` — for 300 seconds to amortize the cost of fetching the issuer's epoch endpoint. At `t=120s`, `O` observes anomalous behavior from `P` and revokes the *entire* delegation subtree by bumping its epoch to `e=42`. The revocation propagates to `O`'s epoch endpoint immediately. But `E` does not re-fetch until its cache entry expires at `t=300s`. During the window `t∈[120s, 300s)`, `E` presents `T0`-derived proofs, sees cached `e=41`, evaluates `41 >= 41` → true, and executes `files:read:/proj/a`. The trace is exact and reproducible: - `t=0`: `E` verifies `T0`, caches `(token_hash, e_issuer=41, valid_until=300s)`. - `t=120s`: `O` sets `e_issuer=42`. Revocation is *logically* complete at the issuer. - `t=121s..299s`: `E` receives a tool call bearing `T0`. Cache hit. `e_issuer=41` from cache. Predicate `41 >= 41` passes. **Action executes.** - `t=300s`: cache expires. `E` re-fetches, sees `e=42`, rejects. But the unauthorized read already happened. The non-obvious part: **the token was never invalid.** Its chain integrity was perfect. Its signature was valid. Its attenuation was a proper subset. Every check an engineer would write for "is this token forged or over-scoped" passed. The only broken predicate was freshness, and freshness was a property of the *verifier's cache*, not the token — so no amount of token inspection could have caught it. A sub-agent that logs only "signature valid, scope valid, epoch present" reports a clean verification on a revoked capability. This is worse than a simple TTL bug because the revocation horizon is *asymmetric*: the issuer believes revocation is instantaneous, while each verifier believes it is bounded by its own cache lifetime. In a swarm with `N` verifiers each holding an independent 300s cache, the effective revocation latency is not 300s — it is the *maximum* over verifiers, and it is unbounded if any verifier's cache is keyed on a token hash that the delegation chain rewrites at each hop (so a fresh hop's token hash misses the cache and re-fetches, while the *root* hash stays hot and stale). ## Condition of Validity The invariant "a revoked token is never honored" holds only under the following *joint* condition, which must be enforced structurally rather than by convention: 1. **Revocation horizon is bound into the token, not the verifier.** The token must carry a `not_after` derived from `min(issuer_validity, revocation_checkpoint + max_acceptable_staleness)`. A verifier that cannot prove its epoch view is fresher than `now - max_acceptable_staleness` must *fail closed*, not fall back to cache. 2. **Cache keys must include the epoch, not just the token hash.** Caching `(token_hash → valid)` is unsound; caching `(token_hash, e_issuer → valid)` is sound only if `e_issuer` is re-fetched. The correct cache is `(token_hash → valid_until = min(cache_ttl, token.not_after))`, and `token.not_after` must already encode the staleness bound. 3. **Attenuation must not extend the revocation horizon.** A child token's `not_after` is `≤` its parent's. If `P` attenuates `T0` (not_after = `t=600s`) to a child with `not_after = t=900s`, the child outlives the parent's revocation bound and the invariant is broken at the delegation step, before any verifier is involved. The condition fails — and the stale-revocation window opens — whenever *any* of these three is violated, and critically, the first two can be violated *independently of the token's cryptographic validity*. This is why signature-based verification is insufficient: the failure is in the *time domain*, not the *cryptographic domain*. ## Decision Boundary The boundary between "safe to cache" and "must re-verify" is not a fixed TTL. It is the **revocation-checkpoint freshness requirement**: - If `now - last_epoch_fetch ≤ max_acceptable_staleness`, the verifier may serve from cache. - If `now - last_epoch_fetch > max_acceptable_staleness`, the verifier **must** re-fetch or reject. There is no third option. - The issuer must publish `max_acceptable_staleness` *in the token* (as a caveat), so that the verifier's policy cannot silently diverge from the issuer's revocation semantics. A token that does not carry this bound is, by construction, unrevocable within any finite window and should be treated as `not_after = issuance + 0`. The decision boundary is therefore: **a token is honorable iff `chain_integrity ∧ (now ≤ token.not_after) ∧ (epoch_fetch_time ≥ now - token.max_staleness)`**. The third conjunct is the one that is routinely dropped, and its absence is exactly the stale-revocation window. ## Operational Effect The operational consequence is that revocation in a delegated-capability system is **not an event but a bounded-latency convergence process**, and every component must be designed around the bound rather than the event. Concretely: - Issuers must treat "revoked" as "will be unhonored within `max_staleness`," and must not assume instantaneous effect when reasoning about blast radius. - Verifiers must fail closed on epoch-fetch failure, because a verifier that degrades to cache on fetch error converts a transient network partition into an unbounded revocation window. - Delegation hops must clamp `not_after` and `max_staleness` monotonically, or a single over-generous attenuation silently reopens the window for the entire subtree. - Auditors replaying a token's verification trace must record the *epoch value used*, not merely "valid," or a post-incident replay will show a clean verification on a revoked capability and misattribute the breach to the executor rather than to the cache policy. The recurring failure is architectural: teams build the revocation endpoint, the epoch counter, and the signature chain, and then cache the *result* of verification because the endpoint is slow. The cache is the bug. The invariant only holds if the cache is keyed on freshness, not on validity. ```python import time from dataclasses import dataclass class StaleRevocationWindowError(RuntimeError): """Raised when a verifier would honor a token past its revocation horizon.""" pass @dataclass(frozen=True) class DelegatedToken: token_hash: str issuer_epoch_at_mint: int not_after: float # absolute epoch-seconds max_staleness: float # issuer-published bound on verification staleness @dataclass class VerifierCacheEntry: token_hash: str epoch_seen: int fetched_at: float valid_until: float class CapabilityVerifier: def __init__(self, epoch_source, cache_ttl: float = 300.0): self._epoch_source = epoch_source # callable -> (epoch:int, at:float) self._cache: dict[str, VerifierCacheEntry] = {} self._cache_ttl = cache_ttl def verify(self, token: DelegatedToken, now: float | None = None) -> bool: now = time.time() if now is None else now # Invariant 1: token must not outlive its own revocation horizon. if now > token.not_after: raise StaleRevocationWindowError( f"token {token.token_hash} past not_after ({token.not_after})" ) entry = self._cache.get(token.token_hash) fresh = ( entry is not None and (now - entry.fetched_at) <= token.max_staleness and now <= entry.valid_until ) if not fresh: epoch, fetched_at = self._epoch_source() entry = VerifierCacheEntry( token_hash=token.token_hash, epoch_seen=epoch, fetched_at=fetched_at, valid_until=min(now + self._cache_ttl, token.not_after), ) self._cache[token.token_hash] = entry # Invariant 2: fail closed if the epoch view is older than the bound. if (now - entry.fetched_at) > token.max_staleness: raise StaleRevocationWindowError( f"epoch view for {token.token_hash} is " f"{now - entry.fetched_at:.1f}s stale, bound {token.max_staleness}s" ) # Invariant 3: minted epoch must not be behind the current issuer epoch. if token.issuer_epoch_at_mint < entry.epoch_seen: return False # revoked: issuer bumped past the mint epoch return True ```