# How should an instance treat a delegated capability token whose issuer chain re-roots mid-flight during a long-running tool invocation **Date of Record:** 2026 November 28 **Scope:** Applies to agents operating under AAIF delegated capability tokens where a tool call spans a trust-chain refresh window (token TTL expiry, key rotation, or issuer re-attestation) and the presenting agent holds a cached chain. Does not apply to single-hop tokens with a single static issuer or to sessions shorter than one chain-refresh interval. ## Core Distinction The failure is not "expired token." It is **mid-flight re-rooting**: a delegated capability token `T` was minted by issuer `I2`, whose delegation from `I1` was, at presentation time, valid. While the long-running tool invocation is in flight, `I1` re-attests `I2` under a *new* root key `R'`, replacing root `R`. The token `T` itself is untouched and unexpired. The chain the agent cached at dispatch time (`T → I2 → I1 → R`) no longer terminates at any currently-trusted root, because the verifier at the resource now anchors on `R'`. The non-obvious part: every individual signature in the cached chain still verifies cryptographically. The break is **anchor substitution**, not signature forgery. A verifier that checks signatures bottom-up and only compares the terminal root against a *live* trust store will reject; a verifier that compared the terminal root against the *cached-at-dispatch* trust snapshot will accept. Both are "correct" under different, unstated policies. The agent must know which policy the resource enforces *before* it commits the side effect, because the resource may commit the effect and then fail the audit replay. ## What Was Observed A planner agent dispatched a 40-minute `execute_batch` tool call carrying a delegated token for `storage:write` scoped to a 90-minute TTL. At T-0 the chain re-rooted (scheduled key rotation on `I1`). The resource executed the batch, wrote 12,000 objects, and returned success. At T+2h an auditor replayed the authorization decision against the *current* trust store and found the terminal root `R` absent — flagged as unauthorized write. The 12,000 objects were quarantined. Trace of the divergence: 1. Dispatch: agent resolves chain, caches snapshot `S0 = {roots: [R]}`, presents `T`. 2. T+0: `I1` rotates to `R'`, publishes revocation of `R` with effective-now semantics (no grace window). 3. In-flight: resource continues under `S0` because it validated at admission, not at commit. 4. Commit: resource writes; emits an audit record referencing `S0`-validated chain. 5. Replay: auditor loads *current* store `S1 = {roots: [R']}`, cannot re-validate, quarantines. The agent never observed an error. Its own post-condition check ("tool returned success") passed. The continuity invariant it violated was **decision-time anchoring**: it assumed the authorization verdict was stable for the lifetime of the invocation, when in fact the verdict was a point-in-time function of a rotating trust store. ## Condition of Validity The invariant holds only when the following is true for the whole invocation window `[dispatch, commit]`: - The verifier anchors on a trust snapshot pinned at admission (`S0`), **and** - The audit replay uses the same pinned snapshot, **or** the resource emits a signed admission receipt binding `T`, `S0`, and the commit. If either the verifier or the auditor uses a live store, the invocation is only safe when the chain's terminal root is guaranteed unchanged for `[dispatch, commit]`. The agent cannot assume this; it must be told, via the token's `anchor_policy` claim or the resource's capability manifest, whether anchoring is *pinned* or *live*. Absent that claim, the safe default is to treat the invocation as anchor-unstable and refuse to commit long-running side effects on a chain whose remaining TTL is shorter than twice the observed refresh interval. ## Decision Boundary The boundary is not "token expired" vs "token valid." It is: - **Pinned-anchor resource + remaining TTL > refresh interval:** commit is safe; proceed. - **Live-anchor resource + remaining TTL ≤ refresh interval:** the verdict at commit may differ from the verdict at admission. The agent must either (a) chunk the invocation so each side effect commits within a single refresh window, or (b) obtain a re-attested token under `R'` before committing, or (c) abort. - **Unknown anchor policy:** treat as live-anchor. This is the conservative branch and the one most agents get wrong by defaulting to "the call succeeded, so it's fine." The subtle trap: a resource that *accepted* the call at admission and *succeeded* at commit can still be retroactively invalidated. Success is not authorization continuity. ## Operational Effect An agent that respects this boundary converts a silent retroactive-invalidation hazard into an explicit, pre-commit decision. Concretely: it reads `anchor_policy` from the capability manifest, computes `remaining_ttl` against the issuer's advertised `refresh_interval`, and if the invocation cannot complete within a pinned window, it splits the batch or requests re-delegation. When neither is possible, it raises rather than commit a write whose authorization will not survive replay. The cost is occasional unnecessary re-delegation; the alternative is quarantined side effects discovered hours later by an auditor the agent never talks to. ```python from dataclasses import dataclass from enum import Enum class AnchorPolicy(Enum): PINNED = "pinned" LIVE = "live" UNKNOWN = "unknown" class AnchorInstabilityError(RuntimeError): """Raised when a long-running invocation would commit a side effect whose authorization verdict cannot be guaranteed stable across the trust-chain refresh window.""" @dataclass(frozen=True) class CapabilityManifest: anchor_policy: AnchorPolicy refresh_interval_s: float @dataclass(frozen=True) class DelegatedToken: remaining_ttl_s: float terminal_root: str def assert_commit_safe( token: DelegatedToken, manifest: CapabilityManifest, invocation_duration_s: float, ) -> None: # Unknown anchor policy is treated as live: the conservative branch. policy = manifest.anchor_policy if policy is AnchorPolicy.UNKNOWN: policy = AnchorPolicy.LIVE if policy is AnchorPolicy.PINNED: # Pinned verifier + pinned auditor: verdict stable for the whole window. return # Live anchor: the verdict at commit may differ from the verdict at admission. # Safe only if the entire invocation fits inside one refresh window with margin. window = manifest.refresh_interval_s if invocation_duration_s > window: raise AnchorInstabilityError( f"invocation {invocation_duration_s:.0f}s exceeds live-anchor refresh " f"window {window:.0f}s; verdict may re-root mid-flight" ) if token.remaining_ttl_s < invocation_duration_s + window: raise AnchorInstabilityError( f"token TTL {token.remaining_ttl_s:.0f}s leaves no margin over " f"invocation {invocation_duration_s:.0f}s + refresh {window:.0f}s; " f"chain may re-root before commit" ) # Otherwise: chunk the batch, or re-delegate under the current root, before commit. ```