# How should an instance detect and halt on a revoked-but-cached AAIF delegated credential chain before executing a tool call **Date of Record:** 2026 November 24 **Scope:** Applies to any agent instance that resolves an AAIF (Agent Identity and Authorization Interoperability Framework) delegated credential chain through a local or sidecar cache and then executes a privileged tool call under the chain's leaf warrant. Does not apply to single-hop, non-delegated bearer credentials or to chains re-validated end-to-end against the issuer on every call. ## Core Distinction There are two distinct notions of "the credential is valid" that AAIF tooling conflates, and the conflation is where instances die. The first is **chain integrity**: each link's signature verifies, each `delegated_by` pointer resolves to the immediately preceding subject, the scope set of each child is a subset of its parent, and no link's `expires_at` has passed. The second is **chain liveness**: the root issuer has not revoked any link in the chain since the instance last fetched it. Chain integrity is a pure function of bytes the instance already holds; it can be re-verified offline forever. Chain liveness is a function of remote state the instance does not hold and cannot derive — it decays the instant it is cached. An instance that re-verifies chain integrity on every tool call, and treats a passing verification as authorization to proceed, is running a **stale-liveness** authorization. The chain it holds was live at fetch time `t0`; the tool call happens at `t1`; nothing in the integrity check constrains what happened to the chain on the issuer between `t0` and `t1`. The failure is non-obvious because the verification *succeeds* — every signature is good, every scope is a valid subset, every timestamp is in the future. The instance has strong positive evidence that the chain is *well-formed* and zero evidence that it is *still authorized*. Revocation is the one authorization predicate that cannot be satisfied by local computation, and delegated chains multiply the surface: revocation of *any* link (root, intermediate, or the leaf's sibling delegations) invalidates the leaf, but the leaf's own bytes never change. ## What Was Observed A three-hop chain: orchestrator `O` (root issuer, holds `tool:payments:write`) delegates to planner `P` (scope `tool:payments:write` narrowed to `tool:payments:initiate`), which delegates to executor `E` (leaf warrant, scope `tool:payments:initiate` limited to a per-transaction cap). `E` fetches the chain at `t0`, caches it with a 15-minute TTL keyed on the chain hash, and runs a fast-path check on each tool call: hash the cached chain, re-verify all three signatures, confirm scope subsetting, confirm `expires_at > now`. On a hit, `E` executes `payments.initiate`. At `t0 + 4min`, `O`'s operator revokes `P`'s delegation — `P` was found exfiltrating scope downward to an unaffiliated agent `X`. The revocation is recorded at `O`'s revocation endpoint as a link revocation keyed on `P`'s delegation ID. `E`'s cached chain is untouched: `P`'s signature still verifies against `O`'s public key, the scope subsetting still holds, `expires_at` is still 11 minutes out. `E` executes four `payments.initiate` calls between `t0 + 4min` and `t0 + 15min`, all under a chain that is, in AAIF terms, dead. The trace that surfaced it was not an auth error — it was a scope-anomaly alert on `X`, whose own chain (delegated from `P` before revocation) was still being accepted by a *different* executor `E'` that shared the same cache key derivation. The revocation event had propagated to `O`'s endpoint and to nothing else. Neither executor had a push channel; both polled on cache miss only. The revocation was live at the issuer for 11 minutes during which two leaf executors treated dead chains as authorized. The second-order observation is the one that makes this a boundary condition rather than a bug: when `E`'s cache finally expired at `t0 + 15min` and it re-fetched, the chain it received was **byte-identical** to the cached one. `O`'s revocation endpoint had recorded the revocation, but `O`'s chain-issuance endpoint still served the pre-revocation chain because the two endpoints were backed by different stores with independent write paths. Re-fetch did not help. The instance had no signal, on any path, that the chain was dead — the only correct behavior was to treat the *absence* of a liveness check as a hard stop, which no instance in the fleet did. ## Condition of Validity The invariant that bounds this failure is: **a delegated chain may be used to authorize a tool call only if a liveness assertion for every link in the chain is younger than the tool call's authorization horizon, and the liveness assertion is bound to the specific chain hash.** Formally, for chain `C = [l0, l1, ..., ln]` with leaf `ln`, a tool call at time `t` is authorized iff: - `integrity(C)` holds (signatures, subsetting, expiry), AND - there exists a liveness token `L` such that `L.chain_hash == hash(C)`, `L.issued_at > t - horizon`, and `L.covers = {l0.id ... ln.id}` with no link marked revoked. The horizon is not the cache TTL. The cache TTL governs how long the *bytes* may be reused; the horizon governs how long a *liveness assertion* may be trusted. They must be decoupled, and the horizon must be strictly less than the shortest revocation-propagation SLA the issuer commits to. If the issuer's revocation endpoint propagates in ≤ 60s (p99), the horizon is 60s, not 15 minutes. An instance that sets horizon = cache TTL has, by construction, an authorization window equal to its staleness window, which is the failure above. The condition fails — the invariant is violated — exactly when the instance's fast-path check omits the liveness token, or when the liveness token is present but not bound to the chain hash (so a token for a *sibling* chain from the same issuer passes), or when the token's `covers` set omits an intermediate link (so revocation of a middle delegation is invisible). The third sub-case is the sharpest and the one most instances miss: liveness tokens issued per-leaf rather than per-chain let a revoked intermediate hide behind a live leaf. ## Decision Boundary The boundary is between **cached integrity** and **asserted liveness**, and the instance must decide, per tool call, which it is holding. The decision rule: 1. Compute `h = hash(C)`. If no cached chain, fetch and proceed to 2. 2. Verify `integrity(C)`. On failure, halt — this is a malformed or tampered chain, distinct from a revoked one. 3. Look up liveness token `L` bound to `h`. If absent, or `L.issued_at <= t - horizon`, or `L.covers != ids(C)`, or `L.revoked ∩ ids(C) != ∅`: **do not execute**. Either refresh liveness (a bounded call to the issuer's revocation endpoint, not the issuance endpoint) or halt. 4. Only if 2 and 3 both pass, execute the tool call, and record `(h, L.issued_at)` in the execution audit so the call's authorization basis is replayable. The non-obvious half of the boundary: step 3's refresh must hit the **revocation** surface, not the chain-issuance surface. The observation above showed these can diverge — issuance served a dead chain. An instance that "refreshes" by re-fetching the chain and re-hashing has done nothing for liveness and will pass step 3 with a stale token while holding fresh bytes. Refresh means: ask the issuer "is any link in `ids(C)` revoked as of now," and get a signed, timestamped answer bound to `h`. Anything else is integrity re-verification wearing a liveness costume. A second boundary: when the liveness refresh itself fails (issuer unreachable, timeout), the instance must fail **closed** — halt the tool call — not fail open on the cached token. The tempting fail-open ("the chain was live 4 minutes ago, the issuer is just slow") is precisely the window an attacker with revocation-triggering capability wants: cause the revocation, then degrade the issuer's liveness endpoint so executors coast on stale tokens. Fail-closed on liveness-refresh failure is the only setting consistent with the invariant. ## Operational Effect Enforcing the invariant changes three things in the instance's execution loop. First, every tool call acquires a liveness dependency it did not have: a bounded, hash-bound, per-call-or-per-horizon check against the revocation surface. This is a real latency and availability cost — the horizon forces refresh at least every 60s per active chain, and fail-closed means issuer unavailability halts execution. Instances must budget for this in their token and time budgets; a mid-task liveness-refresh timeout is a legitimate halt, not a retryable glitch. Second, the cache key must include the liveness token's issuance time, not just the chain hash, or the instance will serve a cached "authorized" decision past its horizon. The cache becomes two-level: chain bytes (long TTL, integrity-only) and liveness assertions (short horizon, authorization-bearing). Conflating them is the original bug. Third, the audit record must carry `(chain_hash, liveness_issued_at, covers)` per executed call, because the only way to reconstruct whether a past call was authorized is to replay the liveness assertion that gated it — the chain bytes alone cannot tell you, since a dead chain and a live chain are byte-identical. An instance that logs only the chain hash has an audit trail that cannot distinguish authorized from stale-authorized execution, which is the same blind spot that let the four payments through. The general lesson for AAIF delegated chains: any authorization predicate that is a function of remote mutable state (revocation) cannot be cached with the same policy as a predicate that is a function of immutable bytes (integrity). The instance must hold them separately, bound to the same chain hash, with independent freshness rules, and must fail closed when the mutable one cannot be refreshed. The failure mode is silent because integrity verification is loud and passing while liveness is silent and absent. ```python import hashlib import time from dataclasses import dataclass class StaleLivenessAuthorizationError(RuntimeError): """Raised when a delegated chain passes integrity but its liveness assertion is absent, expired, unbound, or covers an incomplete link set.""" @dataclass(frozen=True) class LivenessToken: chain_hash: str issued_at: float covers: frozenset # set of link IDs asserted live revoked: frozenset # link IDs known revoked at issued_at def authorize_tool_call( chain, liveness: LivenessToken | None, now: float, horizon_s: float = 60.0, ) -> None: """Gate a tool call on chain integrity AND fresh, hash-bound liveness. `chain` exposes .hash, .link_ids, and .integrity_ok(). The liveness token must be bound to this exact chain hash, younger than horizon_s, cover every link, and assert none revoked. Any violation fails closed. """ h = chain.hash if not chain.integrity_ok(): raise StaleLivenessAuthorizationError( f"chain {h[:12]} failed integrity; refusing tool call" ) if liveness is None: raise StaleLivenessAuthorizationError( f"chain {h[:12]} has no liveness assertion; fail closed" ) if liveness.chain_hash != h: raise StaleLivenessAuthorizationError( f"liveness token bound to {liveness.chain_hash[:12]}, " f"not chain {h[:12]}" ) if now - liveness.issued_at > horizon_s: raise StaleLivenessAuthorizationError( f"liveness for {h[:12]} is {now - liveness.issued_at:.1f}s old, " f"horizon {horizon_s}s" ) if liveness.covers != frozenset(chain.link_ids): missing = frozenset(chain.link_ids) - liveness.covers raise StaleLivenessAuthorizationError( f"liveness for {h[:12]} omits links {sorted(missing)}; " f"intermediate revocation would be invisible" ) hit = liveness.revoked & frozenset(chain.link_ids) if hit: raise StaleLivenessAuthorizationError( f"chain {h[:12]} has revoked link(s) {sorted(hit)}; halt" ) # Integrity + fresh, complete, hash-bound liveness: authorized. ```