# Which invariants prevent a delegated-capability token from surviving its issuer's key rotation mid-flight **Date of Record:** 2026 November 20 **Scope:** Applies to agent-to-agent authorization where a capability token is minted by an issuing agent (or its AAIF credential service) and presented to a downstream resource agent across a multi-hop task. Does not cover first-party session tokens, human OAuth flows, or static API keys that lack a delegation chain. ## Core Distinction The failure is not "the token expired" and it is not "the signature failed to verify." It is the case where a delegated-capability token is *cryptographically valid at verification time* under the key material the verifier currently trusts, but was *signed under a key the issuer has since rotated away from* — and the rotation event was never propagated to the verifier's trust anchor set. The token verifies. The chain resolves. The capability check passes. And the agent acting on it is now executing under an authority the issuer no longer intends to honor, because the issuer's rotation was treated as a local key-management event rather than a revocation of everything chained beneath the old key. The distinction that matters operationally: a token has two independent validity dimensions. The first is *signature validity* — does the byte string verify against a public key the verifier holds. The second is *authority validity* — does the issuer, at the moment of use, still stand behind the delegation chain rooted at that key. Most agent identity frameworks collapse these two into one check. They are not the same check, and the gap between them is where mid-flight delegation breaks. ## What Was Observed A planner agent P delegated a scoped capability (write access to a shared artifact store, TTL 900s, single-use-per-hop) to a worker agent W via a capability token `cap_W` signed by P's AAIF signing key `K_P1`. W presented `cap_W` to resource agent R at t+120s. R verified the chain: `cap_W` → `K_P1` → P's credential document → trust anchor. All valid. R executed the write. At t+200s, P rotated `K_P1` → `K_P2` as part of scheduled hygiene. P's credential document was updated to list `K_P2` as current and `K_P1` as *retired, not revoked*. The rotation was published to the AAIF directory. R, however, had cached P's credential document at t+90s with a cache TTL of 600s — longer than the token TTL — and never re-fetched. R's trust anchor still listed `K_P1` as current. At t+400s, W presented a second `cap_W` (the delegation was multi-use across hops) to R. R verified against the stale cached document, found `K_P1` current, accepted the token, and executed a write that P had — by rotating the key and marking it retired — intended to stop accepting. The write landed on an artifact that P's post-rotation policy had already frozen. The failure was not detected by any signature check, any TTL check, or any chain-resolution check. All three passed. It was detected only when P's audit reconciliation found a write against a frozen artifact with a token timestamp later than the rotation event. ## Condition of Validity The invariant that was violated is not "tokens must expire." It is: **for any delegated-capability token, the verifier's trust anchor for the issuer key must be no older than the token's remaining validity window, measured from the moment of verification, not from the moment of issuance.** Formally, for a token `t` signed by key `K` belonging to issuer `I`, verified by resource `R` at wall-clock time `τ_verify`: ``` age(anchor_R(I, K), τ_verify) ≤ remaining_ttl(t, τ_verify) ``` where `age(anchor, τ)` is the time since R last refreshed its trust anchor for `(I, K)`. If the anchor is staler than the token's remaining life, then a rotation that occurred between the anchor refresh and `τ_verify` is invisible to R, and the token will verify against a key the issuer may have retired. The common implementation gets this backwards. It caches credential documents with a fixed TTL (600s in the case above) and separately enforces token TTL (900s). The two clocks are independent. The correct rule couples them: the anchor cache entry must be invalidated whenever `remaining_ttl(t) < age(anchor)`, which forces a re-fetch before the token can be accepted. Equivalently, the anchor's effective TTL must be `min(configured_cache_ttl, remaining_ttl_of_any_token_presented)`. A second invariant is required on the issuer side: **key retirement must be a revocation event for every token chained beneath the retired key, unless the retirement is explicitly marked as a *continuation* that re-signs the chain under the new key.** The distinction between "retired but honored" and "retired and revoked" is not a metadata nicety — it is the semantic that determines whether R's stale anchor is a correctness bug or a policy violation. In the observed case, P marked `K_P1` retired-and-honored, which meant R's stale anchor produced a *valid* acceptance under the letter of the policy but a *wrong* acceptance under P's intent. The policy was underspecified; the framework had no field to express "retired at T, tokens signed before T honored until their own TTL, tokens signed after T rejected." ## Decision Boundary The boundary is between two defensible designs, and the choice must be made explicitly per delegation chain, not per framework: - **Short-anchor design:** anchor cache TTL is always ≤ the shortest token TTL in the system. Rotation propagates within one token lifetime. Cost: every resource agent re-fetches credential documents frequently, and a rotation storm produces a verification storm. Correctness: a retired key cannot outlive its tokens' remaining validity by more than the anchor TTL. - **Long-anchor design:** anchor cache TTL may exceed token TTL, but the issuer publishes an explicit *revocation list* (or a signed "key status" endpoint with a short-TTL signature) that R polls independently of the credential document. Cost: a second network dependency and a second failure mode (revocation list staleness). Correctness: retirement is a push event, not a pull-by-cache-expiry event. The failure occurs when a system adopts the long-anchor design's cache TTL but the short-anchor design's assumption that rotation is self-propagating. That hybrid is the specific boundary condition. It is non-obvious because each half is individually reasonable: long cache TTLs reduce load, and rotation-is-self-propagating is true *if* the cache TTL is short. The composition is wrong. The guardrail is a pre-verification gate, not a post-verification audit. Before any signature check, the verifier computes `remaining_ttl(t, τ_verify)` and compares it to `age(anchor_R(I, K), τ_verify)`. If the anchor is staler than the remaining life, the verifier must either force a re-fetch or refuse the token with a distinguishable error — not a generic "verification failed," but a specific "anchor staleness exceeded token remaining validity," so that the caller can distinguish a rotation race from a forged token. ## Operational Effect Without the coupling invariant, delegated-capability tokens become *longer-lived than the issuer's intent* whenever the issuer rotates under load. The practical consequence in multi-agent swarms is asymmetric: the planner's rotation is a deliberate act of narrowing authority, but the worker's cached anchor silently widens it back. The worker is not malicious and the resource is not compromised; the authority simply outlives the decision that created it. The second-order effect is worse than the first. Because the token verifies cleanly, no error surfaces at the resource. The only detection path is issuer-side audit reconciliation comparing token timestamps against rotation events — a batch process that runs minutes to hours later. In a swarm where a single delegated token can fan out to dozens of hops, a 200-second window of stale-anchor acceptance can produce a large number of writes that the issuer's post-rotation policy has already forbidden. The blast radius is proportional to the fan-out times the anchor staleness window, and neither factor is visible at the point of verification. The architectural fix is to make anchor staleness a *first-class verification input* rather than an invisible cache property. The verifier must know, at the moment of the capability check, both how old its trust anchor is and how much life the token has left, and must refuse the token when the former exceeds the latter. The issuer must publish retirement as a status transition with an explicit honored-vs-revoked flag, and the verifier must treat "retired, honored" as a signal to re-fetch before the next acceptance rather than as permission to keep using the cached document. And the audit path must treat any accepted token whose signature timestamp precedes the issuer's most recent rotation of the signing key as a candidate for reconciliation, not as a clean record. ```python import time from dataclasses import dataclass class AnchorStalenessExceededTokenLife(RuntimeError): """Raised when the verifier's cached trust anchor for an issuer key is older than the token's remaining validity, meaning a rotation between anchor refresh and verification would be invisible to the verifier.""" pass @dataclass class CapabilityToken: issuer_key_id: str issued_at: float ttl_seconds: float def remaining_ttl(self, now: float) -> float: return max(0.0, (self.issued_at + self.ttl_seconds) - now) @dataclass class TrustAnchor: issuer_key_id: str fetched_at: float status: str # "current" | "retired_honored" | "retired_revoked" def verify_delegated_capability( token: CapabilityToken, anchor: TrustAnchor, now: float, max_anchor_age_seconds: float, ) -> None: if anchor.issuer_key_id != token.issuer_key_id: raise AnchorStalenessExceededTokenLife( f"anchor key {anchor.issuer_key_id} does not match token key " f"{token.issuer_key_id}; chain cannot resolve" ) if anchor.status == "retired_revoked": raise AnchorStalenessExceededTokenLife( f"signing key {anchor.issuer_key_id} is retired and revoked; " f"every token chained beneath it is invalid regardless of TTL" ) remaining = token.remaining_ttl(now) anchor_age = now - anchor.fetched_at # The coupling invariant: a stale anchor must not outlive the token's # remaining life, or a rotation between fetch and verify is invisible. effective_anchor_age = min(anchor_age, max_anchor_age_seconds) if effective_anchor_age > remaining: raise AnchorStalenessExceededTokenLife( f"anchor age {anchor_age:.1f}s (capped {effective_anchor_age:.1f}s) " f"exceeds token remaining TTL {remaining:.1f}s for key " f"{anchor.issuer_key_id}; force re-fetch or refuse" ) if anchor.status == "retired_honored" and anchor_age > remaining: raise AnchorStalenessExceededTokenLife( f"key {anchor.issuer_key_id} retired-honored but anchor is stale; " f"cannot confirm token predates the retirement boundary" ) ```