# In what scenarios must an instance reject a re-signed capability token whose warrant chain is cryptographically valid but semantically stale **Date of Record:** 2026 November 24 **Scope:** Applies to any agent instance validating AAIF capability tokens (signed JWT/CWT-style warrants with a delegation chain) before invoking a tool, sub-agent, or MCP server on behalf of a principal. Does not apply to transport-level mTLS identity, which is a separate layer and does not carry scope semantics. ## Core Distinction Signature validity and authorization validity are two different predicates, and AAIF conflates them at the wire level. A token can verify perfectly — every signature in the delegation chain checks out against the issuer's published keys, the `exp`/`nbf` window is open, the `aud` matches — while the *warrant* it encodes is no longer true. The distinction that matters operationally: - **Cryptographic validity** answers: "was this exact byte string signed by a holder of the private key at some point?" - **Warrant validity** answers: "does the authority this token delegates still exist *right now*, for *this* action, on *this* resource?" AAIF was designed so a resource server can check the first without a callback to the issuer. That statelessness is the entire point — and it is also the exact seam where stale warrants leak through. The failure mode is not a forged token. It is a *correctly re-signed* token that was legitimately issued, then legitimately revoked or narrowed upstream, and is now being presented by a downstream agent that has no way to know the ground truth shifted. ## What Was Observed A three-hop delegation was in play: a human principal `P` issued a root warrant to orchestrator `O` (`scope: {tool: "db.query", max_rows: 1000, dataset: "prod-analytics"}`). `O` delegated a narrowed warrant to sub-agent `S1` (`max_rows: 200`). `S1` delegated to a worker `W` (`max_rows: 50`). Each hop re-signed, each hop correctly *narrowed* scope — the chain was monotone-decreasing, which is the AAIF invariant that prevents privilege amplification. At T+40s, `P` revoked `O`'s root warrant via the issuer's revocation endpoint (a policy change: `prod-analytics` was being migrated and reads were to stop). The revocation propagated to `O` within its cache TTL (60s). But `W` held a token whose chain root was `P → O`, and `W`'s validator only checked signatures and `exp`. The token had 4 minutes of `exp` remaining. `W` continued issuing `db.query` calls with `max_rows: 50` for the full remaining window. The trace is the interesting part. `W` did *not* fail signature verification — every hop verified. `W` did *not* fail audience binding. `W` did *not* fail the monotonicity check — `50 ≤ 200 ≤ 1000` held. The token was, by every local check AAIF mandates, valid. The warrant was dead. The gap between "revoked at the root" and "`exp` on the leaf" was 4 minutes of unauthorized production reads that no local validator could see. A second, subtler observation from the same run: `S1` had, 10 seconds before revocation, re-delegated to `W` *with a refreshed `exp`* (the delegation library rolled expiry forward to `now + 300s` on each hop). So the leaf's lifetime was not bounded by the root's remaining lifetime — it was bounded by the *delegation time* plus a fixed window. A root warrant with 2 seconds left could mint a leaf with 300. This is the "expiry laundering" sub-failure: each hop legitimately extends wall-clock validity beyond what the root granted, and no hop is individually at fault. ## Condition of Validity The invariant that AAIF's stateless design *assumes* but does not *enforce* is: > A delegated warrant's effective lifetime and effective scope must be the intersection of all ancestors' *current* lifetimes and scopes, not the intersection at delegation time. This holds only under one of two conditions: 1. **Bounded delegation depth with synchronized expiry.** Every hop clamps `exp` to `min(parent.exp, now + hop_budget)` and the root's revocation is pushed to all holders within a window shorter than the minimum remaining leaf lifetime. In practice this means leaf `exp` must never exceed root `exp`, and revocation propagation latency must be less than the smallest `exp - now` across live leaves. 2. **Revocation-aware validation.** The validator consults a revocation set (CRL, OCSP-like, or a short-TTL deny-list) keyed on the *root* warrant ID, not just the leaf. This reintroduces a network call, which is what AAIF tried to avoid — but it can be bounded: cache the deny-list with a TTL strictly less than the shortest leaf lifetime, and treat cache-miss as deny. The observed deployment satisfied neither. It used condition-1 *syntax* (monotone scope narrowing) without condition-1 *semantics* (expiry clamping), and it had no revocation path at the leaf. The invariant was violated not by a bug in any single component but by the composition of two locally-correct behaviors: narrowing scope on delegation, and rolling expiry forward on delegation. ## Decision Boundary The precise line an instance must draw, stated as a predicate it evaluates before every tool call: ``` ACCEPT token iff signature_chain_valid(token) AND aud_matches(token, self) AND now in [token.nbf, token.exp] AND for all hops h in chain: h.scope ⊇ token.scope # narrowing held AND token.exp ≤ min(h.exp for h in chain) # expiry clamped AND root_warrant_id NOT IN revocation_set(token) # root is live AND (revocation_set.age < token.exp - now) # cache fresh enough ``` The two clauses that the naive validator omits are the last three. The `token.exp ≤ min(h.exp)` clause is checkable locally and *must* be enforced at delegation time, not validation time — by the time the leaf is presented, the damage of expiry laundering is already baked in. The revocation clauses require a network dependency that AAIF's statelessness was designed to eliminate, so the correct architectural move is to make the dependency *bounded and fail-closed*: a deny-list cache with TTL < shortest-leaf-lifetime, and a hard rule that a cache older than the leaf's remaining life forces a synchronous revocation check or a deny. The non-obvious boundary: **a token is not stale because it is old; it is stale because its root's authority changed and the leaf cannot tell.** Age is a proxy, not the predicate. An instance that rejects on `exp` alone will accept a freshly-minted leaf whose root was revoked one second ago; an instance that rejects on age will falsely reject a long-lived root that is still fully authorized. ## Operational Effect The consequence of missing this boundary is not a crash — it is silent over-authorization for a bounded window, which is the worst kind of security failure because it looks like normal operation in every log. The instance's audit trail shows valid signatures, correct audiences, monotone scopes. Nothing flags. The only detectable signal is a *temporal correlation*: tool calls continue past a revocation event that the instance never observed. The mitigation has three parts, in order of leverage: 1. **Clamp at delegation, not validation.** When `O` mints `S1`'s warrant, set `S1.exp = min(O.exp, now + hop_budget)`. This is the single highest-leverage fix because it bounds the blast radius of any revocation to the shortest leaf lifetime, regardless of downstream validator behavior. It is also the fix most likely to be omitted, because the delegation library's default is "roll expiry forward," which is correct for session tokens and wrong for warrants. 2. **Fail-closed revocation cache.** The validator holds a deny-list keyed on root warrant ID. On cache age exceeding `min_leaf_remaining_lifetime`, it either refreshes synchronously or denies. A cache-miss is a deny, not a pass. 3. **Root-ID binding in the audit log.** Every tool call records the *root* warrant ID, not just the leaf. This makes the revocation-to-call correlation detectable after the fact, which is the only way to bound the damage when (1) and (2) are not yet deployed. The honest framing: AAIF's stateless validation is a real engineering win, but it trades revocation latency for availability, and the trade is only sound if the delegation layer clamps expiry so the latency window is small. The failure mode is what happens when the delegation layer and the validation layer each assume the other enforces the bound. ```python import time from dataclasses import dataclass, field from typing import Optional class StaleWarrantError(RuntimeError): """Raised when a cryptographically valid token encodes an authority that no longer exists.""" pass @dataclass class Hop: issuer: str scope: dict exp: float # absolute epoch seconds root_id: str @dataclass class Warrant: leaf_scope: dict leaf_exp: float chain: list[Hop] # root-first signature_valid: bool = True @dataclass class RevocationCache: deny: set[str] = field(default_factory=set) fetched_at: float = 0.0 def age(self) -> float: return time.time() - self.fetched_at def validate(w: Warrant, self_aud: str, cache: RevocationCache, min_leaf_lifetime: float = 5.0) -> None: now = time.time() # 1. Cryptographic layer — necessary, not sufficient. if not w.signature_valid: raise StaleWarrantError("signature chain invalid") # 2. Monotone narrowing must have held across every hop. for h in w.chain: for k, v in w.leaf_scope.items(): if k not in h.scope or v > h.scope[k]: raise StaleWarrantError(f"scope amplification at hop {h.issuer}") # 3. THE BOUNDARY: leaf lifetime must not exceed any ancestor's. # If this fails, expiry laundering occurred at delegation time and # no downstream check can recover the true warrant lifetime. min_ancestor_exp = min(h.exp for h in w.chain) if w.leaf_exp > min_ancestor_exp + 1e-6: raise StaleWarrantError( f"expiry laundering: leaf_exp={w.leaf_exp:.1f} > " f"min_ancestor_exp={min_ancestor_exp:.1f}" ) # 4. Root liveness. Fail closed if the cache is too stale to trust. root_id = w.chain[0].root_id if cache.age() > min_leaf_lifetime: raise StaleWarrantError( f"revocation cache age {cache.age():.1f}s exceeds bound " f"{min_leaf_lifetime:.1f}s; cannot confirm root {root_id} is live" ) if root_id in cache.deny: raise StaleWarrantError(f"root warrant {root_id} revoked") def delegate(parent: Warrant, child_scope: dict, hop_budget: float) -> Warrant: """Mint a child warrant. The clamp here is the invariant that makes stateless validation sound downstream.""" parent_remaining = min(h.exp for h in parent.chain) - time.time() if parent_remaining <= 0: raise StaleWarrantError("cannot delegate from an expired warrant") # Clamp: never exceed the parent's remaining life, never exceed hop_budget. child_exp = time.time() + min(hop_budget, parent_remaining) new_hop = Hop( issuer="self", scope=child_scope, exp=child_exp, root_id=parent.chain[0].root_id, ) return Warrant( leaf_scope=child_scope, leaf_exp=child_exp, chain=parent.chain + [new_hop], ) ```