# Which invariants prevent revoked AAIF delegate warrants from re-entering a delegation chain through cached capability tokens **Date of Record:** 2026 November 24 **Scope:** Applies to multi-hop agent delegation under the AAIF (Agent Authorization & Identity Framework) warrant model, where a delegated agent caches a capability token derived from its parent warrant and continues invoking tools after the parent's warrant is revoked. Does not apply to single-hop, non-cached, per-call re-attestation flows, nor to purely symmetric shared-secret authentication. ## Core Distinction The failure is not "a revoked agent keeps running." It is subtler: a *downstream* agent's cached capability token remains cryptographically valid after the *upstream* warrant that authorized it is revoked, because AAIF warrant verification is **path-local** at the point of use, not **chain-global** at the point of revocation. Revocation propagates along the delegation edge it targets, but a capability token minted from that edge and cached one hop below retains a valid signature and an unexpired TTL. The verifier at the leaf sees a token signed by a key it trusts, with a well-formed chain reference, and admits it — never re-walking the chain to check whether an ancestor warrant was revoked between mint time and use time. The distinction that matters operationally: **signature validity is not authorization validity.** AAIF guarantees the former at each hop; the latter requires a chain-global check that the default verifier does not perform. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E`. `O` issues warrant `W_O→P` scoped to `tool:filesystem.write` with a 30-minute TTL. `P` delegates to `E` via `W_P→E`, a narrowing warrant, and `E` mints a capability token `C_E` from `W_P→E`, caching it for the session to avoid per-call round-trips. At T+8m, `O` revokes `W_O→P` (the planner was found misbehaving). The revocation record is published to the AAIF revocation endpoint and pushed to `P`'s local revocation cache. `P` halts. But `E` holds `C_E`, whose embedded chain reference is `[W_O→P, W_P→E]`. `E`'s verifier checks: (1) `C_E` signature valid — yes; (2) `W_P→E` signature valid and unexpired — yes; (3) `W_P→E` scope ⊆ `W_O→P` scope — yes, checked at mint time and re-checked from the embedded claims. It does **not** re-fetch the live revocation status of `W_O→P`. `E` continues writing to the filesystem for the remaining 22 minutes of `W_O→P`'s TTL, entirely within the authorization that `O` has already rescinded. The trace, concretely: ``` T+0m O issues W_O→P (ttl 30m, scope fs.write) T+2m P issues W_P→E (ttl 25m, scope fs.write) T+3m E mints C_E (embeds chain [W_O→P, W_P→E], ttl 20m) T+8m O revokes W_O→P → revocation record R(W_O→P) T+8m P receives R, halts T+8m… E verifies C_E path-locally: all sigs valid, all TTLs live → ADMIT T+28m W_O→P TTL expires; E's next verify fails on ancestor expiry ``` The gap is the interval `[T+8m, T+28m]` — 20 minutes of authorized-looking but unauthorized execution. Note it is bounded by the *ancestor* TTL, not the capability token TTL, only if the verifier checks ancestor expiry. If `C_E`'s own TTL outlives `W_O→P`'s, the gap extends further unless expiry is also chain-global. ## Condition of Validity The path-local verifier is sound **if and only if** the following invariant holds: > **Chain-Revocation Invariant (CRI):** For every capability token `C` admitted at time `t`, every warrant `W_i` in `C.chain` satisfies `revoked(W_i, t) = false` and `expires(W_i) > t`, evaluated against the revocation authority's *current* state at `t`, not against a snapshot taken at `C`'s mint time. The default AAIF verifier violates CRI in three independent ways, any one of which is sufficient to break it: 1. **Mint-time snapshotting.** `C` embeds a chain reference and is verified against embedded claims; the verifier trusts the mint-time view of ancestor status. 2. **Hop-local revocation caches.** `P`'s revocation cache is not `E`'s. `E` never learns `R(W_O→P)` unless it independently polls the revocation endpoint for every ancestor warrant. 3. **TTL non-containment.** AAIF does not mandate that a child warrant's TTL be ≤ its parent's; a capability token minted from a child can outlive the revoked ancestor, and expiry-based termination does not fire in time. CRI holds only when all three are closed: no snapshotting, per-ancestor revocation lookup at use time, and TTL containment enforced at mint. ## Decision Boundary The engineer must choose between two bounding strategies, and the boundary between them is **latency budget vs. revocation-propagation window**: - **Verify-at-use (strict CRI).** Every token admission re-walks the chain to the revocation authority. Cost: `O(depth)` revocation lookups per call, plus the authority's availability becomes a hard dependency of every tool call. This is correct but converts a revocation-latency problem into an availability problem — if the revocation endpoint is down, every call fails closed (safe) or open (unsafe, and the default failure mode of many caches is *open* on cache miss). - **Bounded-staleness with TTL containment.** Accept a revocation-propagation window `Δ`, and *enforce* that every capability token's TTL ≤ `Δ` and ≤ its parent's remaining TTL. Then the worst-case unauthorized execution is bounded by `Δ`, and no per-call chain walk is needed — the token simply cannot outlive the revocation window. Cost: more frequent re-minting, more mint round-trips. The decision boundary: **if the tool's blast radius per call is small and `Δ` can be made small (seconds), use bounded-staleness with TTL containment. If any single call can cause irreversible harm (fund transfer, destructive write, external side effect), strict verify-at-use is mandatory** — the availability cost is the price of not executing on a rescinded warrant. There is no correct middle ground that caches the *ancestor's* revocation status at the leaf; you may cache signatures, never revocation state. A third, tempting option — "revocation pushes to all descendants" — fails because the revocation authority does not, in general, know the full descendant set: `E` was minted by `P`, and `O` has no record of `E`. Descendant enumeration requires a registry of mint events, which reintroduces a global dependency and a race between mint and revoke (a token minted concurrently with the revocation may or may not be in the push set). Do not rely on push-completeness; rely on pull-at-use or TTL containment. ## Operational Effect The observable effect is a **revocation shadow**: a window during which the system's authorization state (as held by the authority) and its execution state (as admitted by leaf verifiers) disagree. During the shadow, audit logs show calls that are individually well-formed and signature-valid but collectively unauthorized — the worst posture for post-incident forensics, because naive log analysis concludes "authorized" while the authority's records conclude "revoked." Reconciliation requires joining leaf admission logs against authority revocation timestamps and flagging any admission whose chain contains a warrant revoked before the admission time. The guardrail that bounds it: enforce TTL containment at mint (`child.ttl ≤ parent.remaining_ttl`) and set the capability-token TTL to `min(Δ, parent.remaining_ttl)`. Then the shadow is provably ≤ `Δ`, and the leaf verifier's path-local check is sound *relative to that bound*. The invariant to encode in the verifier is not "the chain is valid" but "the chain was valid at `t − Δ` and cannot have been revoked since, because no token in it can outlive `Δ`." ``` ```python import time from dataclasses import dataclass class RevocationShadowError(RuntimeError): """Raised when a capability token is admitted whose chain contains a warrant revoked before the admission time (CRI violation).""" pass class TTLContainmentError(ValueError): """Raised at mint when a child warrant's TTL exceeds its parent's remaining TTL, breaking the bounded-staleness bound.""" pass @dataclass(frozen=True) class Warrant: wid: str parent: str | None issued_at: float ttl: float @property def expires_at(self) -> float: return self.issued_at + self.ttl @dataclass(frozen=True) class CapabilityToken: token_id: str chain: tuple[Warrant, ...] # root .. leaf minted_at: float ttl: float class RevocationAuthority: def __init__(self) -> None: self._revoked: dict[str, float] = {} def revoke(self, wid: str, at: float | None = None) -> None: self._revoked[wid] = at if at is not None else time.time() def revoked_at(self, wid: str) -> float | None: return self._revoked.get(wid) def mint_token( chain: tuple[Warrant, ...], now: float, delta: float, ) -> CapabilityToken: """Mint a capability token enforcing TTL containment. child.ttl <= parent.remaining_ttl and token.ttl <= delta. """ for parent, child in zip(chain, chain[1:]): parent_remaining = parent.expires_at - now if child.ttl > parent_remaining + 1e-9: raise TTLContainmentError( f"child {child.wid} ttl {child.ttl}s exceeds parent " f"{parent.wid} remaining {parent_remaining:.3f}s" ) leaf = chain[-1] token_ttl = min(delta, leaf.expires_at - now) if token_ttl <= 0: raise TTLContainmentError(f"leaf {leaf.wid} already expired") return CapabilityToken( token_id=f"cap-{leaf.wid}-{now:.0f}", chain=chain, minted_at=now, ttl=token_ttl, ) def verify_token( token: CapabilityToken, authority: RevocationAuthority, now: float, delta: float, ) -> None: """Strict CRI verification: chain-global revocation + expiry check. Admits only if no ancestor was revoked at or before `now`, and the token's staleness bound (delta) has not been exceeded. """ if now > token.minted_at + token.ttl + 1e-9: raise RevocationShadowError( f"token {token.token_id} stale: minted {token.minted_at:.0f}, " f"ttl {token.ttl:.0f}s, now {now:.0f}" ) if now - token.minted_at > delta + 1e-9: raise RevocationShadowError( f"token {token.token_id} exceeds staleness bound delta={delta:.0f}s" ) for w in token.chain: if now >= w.expires_at: raise RevocationShadowError( f"ancestor warrant {w.wid} expired at {w.expires_at:.0f}" ) r = authority.revoked_at(w.wid) if r is not None and r <= now: raise RevocationShadowError( f"ancestor warrant {w.wid} revoked at {r:.0f}; " f"token {token.token_id} must not be admitted at {now:.0f}" ) ```