# Which invariants prevent delegated AAIF agent credentials from surviving a mid-chain revocation during a live tool call **Date of Record:** 2026 November 26 **Scope:** Applies to AAIF (Agent Authorization & Identity Framework) deployments where an orchestrator agent mints a delegated capability token to a sub-agent, which further attenuates it to a worker agent that invokes a stateful tool holding the credential across multiple round-trips. Does not cover single-hop credentials, stateless one-shot RPCs, or bearer tokens without a delegation chain. ## Core Distinction There is a difference between *revocation of a credential* and *invalidation of an in-flight authorized action*. AAIF revocation is a control-plane event: a signed revocation record is appended to the issuer's revocation log and propagated to verifiers via a pull-or-push channel. An in-flight tool call is a data-plane event: the worker agent already presented its token, the tool already validated the chain, and the side effect is mid-execution. The failure mode is not "the token was revoked and the call was rejected." The failure mode is **the tool validated the chain at call entry, the revocation landed at hop N-1 while hop N was still executing, and the worker continued to act on the strength of a delegation whose parent had already been killed** — a classic time-of-check-to-time-of-use (TOCTOU) gap across the delegation chain, widened by propagation latency and by the fact that each hop's verifier only checks its own edge. The non-obvious part: the chain is *cryptographically* valid at every hop even after revocation, because revocation is a separate signed statement, not a mutation of the token. The invariant that must hold is not "the token is unforgeable" (it is) but "**at the instant a side effect commits, every ancestor delegation in the chain is still live, and the verifier can prove it without trusting the worker's cached view**." ## What Was Observed An orchestrator `O` mints token `T_O` scoped to `write:repo` for sub-agent `S`, TTL 3600s. `S` attenuates to `T_S` (scope `write:repo`, path prefix `refs/heads/feature-*`) for worker `W`. `W` calls a git-push tool with `T_S`. The tool, on entry, resolves the chain `W ← S ← O`, verifies signatures, checks each token's `nbf`/`exp`, and queries the revocation endpoint for each `jti`. All clean. The push begins — a multi-phase operation: negotiate, upload pack, update refs. At T+1400s, `O`'s controller revokes `T_O` because the orchestrator task was cancelled. The revocation record propagates to the tool's revocation cache with a 30s push lag plus a 5s cache TTL — call it ~35s worst case. At T+1410s, during the ref-update phase, the tool performs a *second* identity check (it re-validates before committing the ref, because ref update is the destructive step). It re-queries the revocation endpoint. The record for `T_O` has not yet arrived. The ref update commits. At T+1445s the revocation record lands. The push is complete, the branch is written, and the audit log shows a successful authorized action performed with a credential that had been revoked 45 seconds earlier. The worker `W` never saw the revocation either — it holds `T_S`, and `T_S`'s own `jti` was never revoked. `W`'s view of the chain is "my parent is valid," and it has no channel to learn that the grandparent was killed. The chain is *attenuating* (scope narrows downward) but revocation is *ascending* (a kill at the root must propagate down), and those two directions were never wired together. A second observation, more insidious: when the same tool was retried after a timeout, `W` presented the same `T_S`. The tool's entry check now found `T_O` revoked and rejected. The orchestrator's retry logic interpreted the rejection as a transient `403` and re-minted a *fresh* `T_O'` with identical scope, then re-attenuated. The side effect executed twice. The revocation was correct; the retry semantics were not. ## Condition of Validity The guardrail is a **chain-liveness invariant checked at commit time, not at entry time**, with three conjuncts that must all hold atomically at the moment of side-effect commit: 1. **Ancestor liveness proof.** The worker must present, at commit, a *short-lived* proof (max age `δ`, e.g. 10s) that every ancestor `jti` in the chain is absent from the issuer's revocation log, signed by a verifier the tool trusts. A cached "valid at entry" result does not satisfy this — it is a stale read by construction. 2. **Revocation-propagation bound.** The issuer must publish a *maximum propagation latency* `L`, and the tool's acceptance window must be `δ + L < TTL_remaining`. If the remaining TTL is shorter than the propagation bound, the token is not usable for a multi-phase action — it must be re-minted. This is the invariant that was violated: `TTL_remaining` at commit (≈2190s) was large, but the *proof freshness* `δ` was effectively infinite because the tool cached the entry check. 3. **Idempotent retry under revocation.** A rejection due to ancestor revocation must be a *terminal* class, distinct from transient `403`/`429`. Retrying a revoked-chain rejection must not re-mint; it must escalate to the orchestrator's human or policy layer. The re-mint-on-403 path is the second failure and is prevented only by making revocation rejection a non-retryable error type. The invariant in one line: **a delegated action is authorized iff, at commit, the verifier holds a proof fresher than `δ` that no ancestor is revoked, and the token's remaining TTL exceeds `δ + L`; any rejection of this proof is terminal.** ## Decision Boundary The boundary is *where in the call lifecycle the liveness check is anchored*. Two regimes: - **Entry-anchored (broken):** Check at call start, trust the result for the call's duration. Valid only when the call is single-phase and shorter than `δ`. For multi-phase stateful tools (git push, DB transaction with multiple statements, file upload + rename), entry-anchoring is a TOCTOU hole whose width equals the call duration plus propagation lag. - **Commit-anchored (correct):** Check immediately before the irreversible step, with a proof no older than `δ`, and require `TTL_remaining > δ + L`. This bounds the window to `δ` regardless of call duration. The decision the engineer must make: **is the tool's destructive step separable from its preparatory steps?** If yes (most tools: upload-then-commit, stage-then-apply), anchor at commit. If no (a single atomic write that cannot be split), then the only safe configuration is `TTL_remaining > δ + L` at entry *and* a revocation-propagation bound `L` small enough that the entire call fits inside it — which usually means short TTLs and fast revocation channels, not long-lived tokens. There is a third regime that is a trap: **optimistic commit with compensating rollback**. It looks safe ("we'll undo if revocation arrives late") but fails because the compensating action itself requires a credential, and if the ancestor is revoked, the rollback credential is also dead — the agent cannot undo what it was not authorized to do. Compensating rollback is only valid if the rollback path uses a *separate, non-delegated* recovery credential, which most AAIF deployments do not provision. ## Operational Effect The practical consequence is that **delegation chains must carry a revocation-propagation contract, not just a scope contract.** The token's metadata needs `max_propagation_latency L` and `proof_freshness δ` as first-class claims, and verifiers must reject at commit any chain whose remaining TTL cannot cover `δ + L`. Without this, the chain is cryptographically sound and operationally unsound: every hop verifies its own edge, no hop verifies the whole chain's liveness at the moment that matters, and the revocation that was supposed to bound the blast radius arrives after the blast. The second operational effect is on retry semantics: revocation rejections must be a distinct terminal error class in the agent's tool-call taxonomy, or the orchestrator's generic retry-on-4xx logic will re-mint and double-execute. This is not a crypto problem; it is an error-classification problem at the LLM tool-loop layer, and it is where most deployments actually get burned. ```python class RevokedChainCommitError(RuntimeError): """Raised when a delegated action attempts to commit on a chain whose ancestor liveness proof is stale or whose remaining TTL cannot cover the revocation-propagation bound. Terminal: must NOT be retried.""" class ChainLivenessProof: def __init__(self, issued_at: float, max_age: float, revoked_jtis: set[str]): self.issued_at = issued_at self.max_age = max_age self.revoked_jtis = revoked_jtis def is_fresh(self, now: float) -> bool: return (now - self.issued_at) <= self.max_age def commit_delegated_action( chain_jtis: list[str], token_ttl_remaining: float, propagation_bound_L: float, proof_freshness_delta: float, proof: ChainLivenessProof, now: float, ) -> None: # Invariant 1: proof must be fresh at commit, not at entry. if not proof.is_fresh(now): raise RevokedChainCommitError( f"stale liveness proof: age={now - proof.issued_at:.1f}s " f"> max_age={proof.max_age:.1f}s; re-anchor at commit" ) # Invariant 2: remaining TTL must cover proof freshness + propagation lag. required = proof_freshness_delta + propagation_bound_L if token_ttl_remaining < required: raise RevokedChainCommitError( f"TTL budget insufficient for safe commit: remaining={token_ttl_remaining:.1f}s " f"< delta+L={required:.1f}s; re-mint with longer TTL or shorter L" ) # Invariant 3: no ancestor may be revoked in the fresh proof. for jti in chain_jtis: if jti in proof.revoked_jtis: raise RevokedChainCommitError( f"ancestor {jti} revoked; action is terminal, do not re-mint/retry" ) # ... perform irreversible side effect here, inside the bounded window ... ```