# Why does an instance lose delegated authority when a scoped capability token's attenuation chain diverges from the issuer's live revocation epoch? **Date of Record:** 2026 November 26 **Scope:** Applies to any agent that acts under a delegated capability token (AAIF-style attenuating credential chain) where the token carries a scope, an attenuation proof, and a revocation-epoch binding. Does not apply to bearer tokens with no delegation chain, nor to single-hop API keys where the issuer and verifier are the same process. ## Core Distinction The failure is not "the token expired" and not "the token was revoked." Both are the well-understood terminal states. The boundary condition here is subtler: **a delegated credential chain whose attenuation proof is valid, whose signature verifies, whose expiry is in the future, and whose root issuer is alive — but whose intermediate link was minted against a revocation epoch that the root has since advanced past, without the leaf ever being re-attested.** In AAIF terms, a capability token carries three orthogonal validity axes: 1. **Structural validity** — signatures, attenuation proofs (each link may only narrow scope, never widen), and chain linkage. 2. **Temporal validity** — `nbf`/`exp` on each link, plus delegation depth. 3. **Revocation-epoch validity** — a monotonically increasing integer `rev_epoch` that the root issuer bumps whenever *any* descendant capability in its subtree is revoked or its scope is redefined. Most verifiers check axes 1 and 2 cheaply and locally. Axis 3 requires a live call back to the issuer (or a cached epoch with a TTL). The failure mode lives in the gap between "I verified the chain offline" and "the epoch I verified against is stale." An agent that holds a deep delegated token — say, a sub-agent that was handed a narrowed capability by a mid-tier orchestrator — will continue to act confidently under a token that the root considers *logically withdrawn* but not yet *structurally invalid*. The dangerous property: **revocation-epoch advance is silent to the leaf.** Nothing in the leaf's token changes. Its signature still verifies. Its scope still parses. Only the root's epoch counter moved, and only a verifier that re-polls the root will notice. ## What Was Observed A three-tier delegation was in play: - **Root (Issuer R):** a long-lived service principal holding `rev_epoch = 41`. - **Mid (Orchestrator M):** minted a child token `T_M` scoped to `files:read, files:write, shell:exec` at epoch 41, delegated to the leaf. - **Leaf (Worker L):** received `T_L`, an attenuated child of `T_M` scoped to `files:read` only, carrying the full chain `[R → M → L]` and a cached `rev_epoch = 41`. At T+0, an operator revoked M's `shell:exec` grant at the root (a human flagged an over-broad orchestrator). The root bumped `rev_epoch` to 42. M's token was *not* re-minted; the operator assumed revocation would propagate. At T+0 through T+40min, L continued to execute `files:read` operations. This is, strictly, *correct* — L's scope never included `shell:exec`, so the revocation of M's sibling scope did not affect L's authority. **But L also continued to present `T_L` as proof of an unbroken chain rooted at R, and downstream auditors accepted it as "current."** The auditors were reading `rev_epoch = 41` from the token and comparing it to a cached root epoch snapshot that had also not refreshed. The real failure surfaced at T+40min when L attempted to *re-delegate*: it minted `T_L2` scoped to `files:read` for a peer worker, using its own cached epoch 41 as the binding. The peer verifier — freshly started, cold cache — polled R, saw epoch 42, and rejected. L's internal model of "my chain is current" and the peer's model of "your chain is stale" diverged by exactly one epoch, and neither could reconcile because **the epoch binding is per-link, not per-chain, and the leaf never learned its intermediate link had been superseded.** The trace: ``` R.rev_epoch: 41 -> 42 (operator action) T_M.rev_epoch: 41 (unchanged; not re-minted) T_L.rev_epoch: 41 (unchanged; inherited) L.cached_root_epoch: 41 (stale; TTL had not fired) peer.cold_start -> polls R -> 42 peer.rejects(T_L2) because T_L2.rev_epoch(41) < R.rev_epoch(42) L.retries(T_L2) same epoch, same rejection, no backoff ``` L entered a retry loop that could not terminate: re-minting from a stale epoch produces a token that is structurally valid but epoch-stale, and the verifier's rejection reason (`epoch_mismatch`) is indistinguishable from a transient network error to L's error classifier. ## Condition of Validity The invariant that was silently violated: > **A delegated token is valid at a verifier iff `token.rev_epoch >= root.rev_epoch` AND `token.rev_epoch` was read from the root no earlier than `now - max_epoch_staleness`. Structural and temporal validity are necessary but not sufficient.** Three conditions must all hold for this invariant to be enforceable: 1. **Epoch monotonicity is global per root.** Any revocation anywhere in R's subtree bumps R's epoch. This is what makes a single integer sufficient — and what makes the failure silent, because L's *own* scope was untouched. 2. **Epoch is bound at mint time, not at presentation time.** A token minted at epoch 41 is forever an epoch-41 token. Re-binding requires re-minting, which requires the minter to *know* the root advanced. 3. **The leaf must have a refresh path.** If L cannot re-mint (because M's delegation to L was revoked, or M is offline), L must fail closed — but "fail closed" requires L to *detect* the condition, which requires polling R, which the offline-verification design explicitly avoided. The boundary: **the design optimizes for offline verification (axes 1 and 2) at the cost of propagating axis 3.** That trade is correct for short-lived tokens (TTL < epoch poll interval). It is incorrect for any token whose lifetime exceeds the epoch staleness window, which is exactly the long-lived delegated workers that AAIF chains are meant to support. ## Decision Boundary The architect must choose, per delegation depth, between two regimes: - **Offline-verified regime:** verifier trusts the token's embedded `rev_epoch` and accepts tokens whose `rev_epoch` is within `max_epoch_staleness` of the root's last-known epoch. Valid only when `token.exp - token.nbf <= max_epoch_staleness`. Beyond that, a token can outlive its epoch binding. - **Online-attested regime:** every verification (or every N verifications, or every `T_attest`) re-polls the root. Valid for any lifetime, but requires a reachable root and accepts the latency cost. The failure occurred because the system was *declared* offline-verified but tokens were minted with `exp - nbf = 4h` while `max_epoch_staleness = 5min`. The token's lifetime exceeded the staleness window by 48×. Every leaf token was, by construction, allowed to drift up to 47 epoch advances before any verifier was obligated to notice. The decision rule: **`max_epoch_staleness` must be strictly less than the minimum token lifetime in the chain, or the chain must be online-attested.** If neither holds, the chain has an unbounded silent-revocation window, and the leaf will act under withdrawn authority until a cold-start verifier happens to reject it. A secondary boundary: **re-minting from a stale epoch must be a terminal error, not a retryable one.** The rejection `epoch_mismatch` must be classified distinctly from `network_timeout` and `issuer_unreachable`. L's retry loop was a classification failure — it treated a semantic rejection as a transport failure. ## Operational Effect The observable effects, in order of severity: 1. **Silent authority drift.** Leaf agents continue to act under logically-withdrawn authority for up to `token_lifetime - max_epoch_staleness`. In the observed case, up to 3h55m of `files:read` operations executed under a chain the root had superseded. No log line, no metric, no alert — the token was structurally valid the entire time. 2. **Asymmetric rejection across verifiers.** Warm-cache verifiers accept; cold-start verifiers reject. The same token is valid at 09:00 and invalid at 09:01 to a freshly-spawned peer. This produces non-deterministic behavior across a swarm that is indistinguishable from a race condition, but is actually a cache-staleness artifact. 3. **Re-delegation poisoning.** A leaf that re-delegates from a stale epoch propagates the staleness to its children. Depth-N chains amplify: one stale link at depth 1 poisons every descendant minted from it, and none of them can self-heal without a round-trip to the root. 4. **Retry storms.** Classification failure (treating `epoch_mismatch` as transient) causes the leaf to re-mint and retry from the same stale epoch indefinitely. Each retry consumes a mint operation and a verifier rejection — a self-inflicted DoS on the root's mint endpoint. The guardrail that bounds all four: **epoch-aware minting with fail-closed re-attestation.** Before minting any child, the minter must confirm `local_epoch == root.rev_epoch` via a cheap attestation call (or a cache whose TTL is strictly less than the intended child lifetime). On mismatch, it must refresh its epoch *and* re-validate its own chain from the root down — because a bump may have invalidated an intermediate link, not just the leaf. If the root is unreachable, the minter must refuse to mint rather than mint from a stale epoch. The following reference implementation encodes the invariant as a hard precondition and distinguishes the terminal epoch error from transient failures: ```python import time from dataclasses import dataclass class EpochStaleError(RuntimeError): """Raised when a delegated token's revocation-epoch binding is older than the root issuer's current epoch, or older than the allowed staleness window. This is a TERMINAL error: retrying from the same epoch cannot succeed.""" class IssuerUnreachableError(RuntimeError): """Transient: the root could not be polled. Distinct from EpochStaleError so callers do not conflate a semantic rejection with a transport failure.""" @dataclass(frozen=True) class CapabilityToken: subject: str scope: frozenset rev_epoch: int nbf: float exp: float chain_depth: int @dataclass(frozen=True) class RootState: rev_epoch: int observed_at: float MAX_EPOCH_STALENESS = 300.0 # seconds; MUST be < min token lifetime in chain def _poll_root(root_client) -> RootState: try: epoch = root_client.current_rev_epoch() except TimeoutError as exc: raise IssuerUnreachableError("root issuer did not respond") from exc return RootState(rev_epoch=epoch, observed_at=time.time()) def assert_chain_current( token: CapabilityToken, root_client, now: float | None = None, ) -> RootState: """Enforce the epoch invariant before any action or re-delegation. Invariant: token.rev_epoch >= root.rev_epoch AND the root observation is fresh. Structural and temporal validity are assumed already checked. """ now = now if now is not None else time.time() # Temporal validity is necessary but not the failure we are guarding. if not (token.nbf <= now <= token.exp): raise EpochStaleError( f"token for {token.subject} outside temporal window" ) # The token's lifetime must not exceed the staleness budget, or the # offline-verified regime is unsound for this token by construction. if (token.exp - token.nbf) > MAX_EPOCH_STALENESS: raise EpochStaleError( f"token lifetime {token.exp - token.nbf:.0f}s exceeds " f"max_epoch_staleness {MAX_EPOCH_STALENESS:.0f}s; " "chain requires online attestation" ) root = _poll_root(root_client) if (now - root.observed_at) > MAX_EPOCH_STALENESS: # Defensive: _poll_root should always return fresh, but a cached # RootState passed in by a caller could violate this. raise EpochStaleError("root observation is stale") if token.rev_epoch < root.rev_epoch: raise EpochStaleError( f"token epoch {token.rev_epoch} < root epoch {root.rev_epoch}; " f"chain for {token.subject} at depth {token.chain_depth} " "was superseded and must be re-attested from the root" ) return root def mint_child( parent: CapabilityToken, narrowed_scope: frozenset, lifetime_s: float, root_client, ) -> CapabilityToken: """Mint an attenuated child. Refuses to mint from a stale epoch.""" if not narrowed_scope.issubset(parent.scope): raise ValueError("attenuation may only narrow scope, never widen") if lifetime_s > MAX_EPOCH_STALENESS: raise EpochStaleError( f"requested lifetime {lifetime_s:.0f}s exceeds staleness budget; " "child would be silently revocable" ) root = assert_chain_current(parent, root_client) return CapabilityToken( subject=f"{parent.subject}/child", scope=narrowed_scope, rev_epoch=root.rev_epoch, # bind to the FRESH epoch, not parent's nbf=time.time(), exp=time.time() + lifetime_s, chain_depth=parent.chain_depth + 1, ) ```