# Which invariants prevent delegated AAIF capability tokens from surviving their own attestation refresh **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent systems where an orchestrator mints short-lived delegated capability tokens (AAIF-style: subject agent, scope, expiry, attestation hash, revocation epoch) and hands them to sub-agents that perform tool calls against resource servers enforcing those tokens. Does not cover long-lived service credentials, mTLS-only identity, or single-agent self-authorization. ## Core Distinction The failure is not "a token expired." It is the **attestation-refresh/revocation-epoch skew window**: the interval during which a delegated token is structurally valid (signature good, `exp` in the future, scope intact) but its embedded attestation hash no longer matches the issuer's current attestation for that subject, and the resource server has not yet observed the revocation epoch bump that would invalidate it. The token is *live* to the verifier and *dead* to the issuer. Every agent in the chain is behaving correctly against its own local view; the system as a whole authorizes an action the issuer has already repudiated. This is distinct from plain expiry. Expiry is a monotonic, locally-decidable predicate. Attestation staleness is a **distributed** predicate: the truth lives at the issuer, the decision lives at the verifier, and the two are separated by propagation latency that is bounded only by polling interval plus clock skew. ## What Was Observed An orchestrator agent `O` holds a session attestation `A(O)` that is re-signed every 30s (hardware-backed key, nonce, monotonic counter). It mints a delegated token `T` for sub-agent `S`: ``` T = sign_O{ sub: S, scope: [fs.read:/data], exp: now+300s, attestation_hash: H(A(O)), revocation_epoch: E } ``` `S` receives `T` over an A2A handoff and begins a multi-step tool sequence against resource server `R`. At t+40s, `O`'s host detects an anomaly (its own attestation inputs changed — say a prompt-injection probe tripped a policy check) and the issuer bumps the global revocation epoch `E → E+1`, invalidating every token carrying `E`. `R` polls the issuer's revocation feed every 60s. Between the bump and `R`'s next poll, `S` presents `T` with `revocation_epoch: E`. `R` checks its cached epoch (`E`), finds a match, verifies `H(A(O))` against its *cached* attestation snapshot (also stale), and admits the call. The trace is unremarkable in logs: `S` sees `200 OK`. `R` sees a valid token. `O` believes it revoked. The only artifact of the failure is a temporal gap — a `fs.read:/data` that lands 12–58s after repudiation. The second-order effect is worse. Because `S`'s reasoning loop treats the successful tool call as evidence its capability is intact, it **continues the plan**, issuing further calls that each individually pass the same stale check. Error compounds: a single admitted call becomes an admitted *sequence*, and `S`'s episodic memory records a coherent, successful task execution that the issuer's audit log will later contradict. On resume after any checkpoint, `S` replays from a memory that asserts authorization it never durably held. ## Condition of Validity The invariant that must hold is a **causal ordering between epoch visibility and token acceptance**, not merely epoch equality: > For any token `T` with epoch `E`, `R` may accept `T` only if `R`'s last-confirmed issuer epoch `E_R` satisfies `E_R == E` **and** the freshness bound `now - t_last_poll < Δ_accept` holds, where `Δ_accept` is strictly less than the issuer's minimum epoch-bump-to-effect latency guarantee. The failure occurs precisely when `Δ_accept ≥ poll_interval`. If the issuer cannot guarantee that a bump is globally visible within `Δ_accept`, the verifier is accepting tokens against a snapshot it cannot prove is current. Equality of epochs is necessary but **not sufficient** — a stale cache can equal the token's epoch while both are behind the issuer. Two supporting invariants: 1. **Attestation-hash binding must be re-evaluated at accept time, not mint time.** If `R` caches `H(A(O))` from token issuance, an attestation refresh at `O` that changes the hash (new nonce/counter) silently invalidates the binding without any party noticing. 2. **Delegation depth must be carried and decremented, never recomputed.** A sub-delegate that re-mints from a cached parent token can resurrect a revoked epoch by copying the *stale* `E` it saw at handoff. ## Decision Boundary The boundary is the choice of what to do when `R` cannot prove freshness. There are exactly three defensible policies, and a fourth indefensible one: - **Fail-closed on stale poll:** reject any token whose `E_R` was confirmed more than `Δ_accept` ago. Correct, but converts every issuer hiccup into a fleet-wide authorization outage — unacceptable for long-running agents. - **Fail-closed on epoch mismatch only (the observed bug):** accepts stale-equal epochs. This is the failure mode. - **Bounded-staleness with re-confirmation:** on a cache miss or age > `Δ_accept`, `R` performs a synchronous issuer round-trip before admitting the call. Latency cost is paid only at the boundary, not on every call. - **Indefensible:** trusting the token's own embedded `revocation_epoch` as authoritative. The token cannot attest to its own non-revocation; that is the issuer's exclusive claim. The decision boundary for the agent designer: **the token's epoch field is a hint for cache lookup, never a proof of liveness.** Any code path that treats `token.epoch == cached.epoch` as sufficient authorization has crossed into the indefensible policy. ## Operational Effect Concretely, an agent operating under this framework must: - Treat every tool-call success as **conditionally** authorized until the enclosing step's attestation is re-confirmed against the issuer, and must not let a successful call widen its own plan — a single admitted stale call is a signal to *re-verify*, not to *continue*. - On any checkpoint/resume, re-validate the delegation chain's epochs against the issuer rather than trusting the serialized token blob; a resumed agent's memory of "I was authorized" is not authorization. - Never re-mint a delegated token from a cached parent without a fresh issuer round-trip; epoch resurrection via caching is the dominant real-world variant. - Bound `Δ_accept` explicitly and alarm when poll latency approaches it, because the skew window is silent — it produces no error, only a temporal anomaly in audit reconciliation. The invariant, stated for the record: **a verifier may accept a delegated token only when it can prove its revocation view is causally at least as new as the token's mint, and that proof requires a freshness bound strictly tighter than the issuer's propagation guarantee.** Equality of epochs is not that proof. ```python import time from dataclasses import dataclass class StaleAttestationAcceptance(RuntimeError): """Raised when a verifier would admit a token against an unprovably-fresh epoch view.""" pass @dataclass(frozen=True) class DelegatedToken: subject: str scope: tuple exp: float attestation_hash: str revocation_epoch: int @dataclass class VerifierView: confirmed_epoch: int last_poll: float cached_attestation_hash: str def admit(token: DelegatedToken, view: VerifierView, now: float, delta_accept: float, issuer_fetch) -> bool: if now >= token.exp: return False # Invariant 1: epoch equality is necessary, not sufficient. if token.revocation_epoch != view.confirmed_epoch: return False # Invariant 2: freshness bound must be strictly tighter than propagation guarantee. age = now - view.last_poll if age > delta_accept: # Re-confirm synchronously at the boundary rather than trusting the cache. fresh = issuer_fetch(token.subject) if fresh is None: raise StaleAttestationAcceptance( f"cannot confirm epoch for {token.subject}: issuer unreachable " f"at age={age:.2f}s > delta_accept={delta_accept:.2f}s" ) if fresh.revocation_epoch != token.revocation_epoch: raise StaleAttestationAcceptance( f"epoch skew: token={token.revocation_epoch} " f"issuer={fresh.revocation_epoch} for {token.subject}" ) if fresh.attestation_hash != token.attestation_hash: raise StaleAttestationAcceptance( f"attestation hash mismatch for {token.subject}: " f"token={token.attestation_hash[:8]} issuer={fresh.attestation_hash[:8]}" ) view.confirmed_epoch = fresh.revocation_epoch view.cached_attestation_hash = fresh.attestation_hash view.last_poll = now # Invariant 3: attestation binding re-evaluated at accept time. if token.attestation_hash != view.cached_attestation_hash: raise StaleAttestationAcceptance( f"stale attestation binding for {token.subject}" ) return True ```