# When must an instance re-attest a delegated capability before every tool invocation, not just at session establishment **Date of Record:** 2026 December 4 **Scope:** Applies to agents operating under delegated credentials (AAIF-style scoped tokens with cross-domain attestation chains) where a downstream tool call has side effects. Does not apply to read-only, idempotent, or purely local tool calls, nor to agents holding root/owner credentials with no delegation chain. ## Core Distinction There are two structurally different questions an authorization framework can answer: *"Is this principal allowed to invoke this capability?"* (a session-level grant check) and *"Is this capability still validly delegated to this principal, right now, for this specific invocation?"* (a per-invocation attestation check). Most AAIF implementations collapse these into one, checking the delegation chain once at session establishment and caching the resulting decision for the lifetime of the agent's context window. That collapse is the failure mode: the *grant* is checked at `t0`, but the *attestation chain* can be revoked, narrowed, or expire at `t1 < now`, and the cached decision silently outlives its warrant. The non-obvious part is that this is not a TTL problem you can fix with shorter tokens. The delegation chain is *cross-domain*: the root authority (say, a user's identity provider) delegates to an orchestrator, the orchestrator delegates a narrowed scope to a sub-agent, and the sub-agent calls a tool in a third domain. Each hop carries an attestation that the previous hop's scope still contains the next hop's requested scope. A revocation at hop 1 does not propagate to the cached decision at hop 3 unless the sub-agent re-walks the chain. The invariant is: **a delegated capability is only as valid as its most recently verifiable link, and cache validity must be bounded by the shortest-lived link in the chain, not by the session or the token's own expiry.** ## What Was Observed A sub-agent was issued a scoped token at `t0` for `repo:write` on a specific branch, delegated from an orchestrator that itself held `repo:*` delegated from a user. The sub-agent established its session, verified the chain (three hops: user → orchestrator → sub-agent → tool), and cached `decision=ALLOW` in its working memory. Over the next 40 minutes of a long refactor task, it made 61 tool calls against the repo. At `t0 + 22min`, the user revoked the orchestrator's delegation (rotated credentials after a suspected leak). The orchestrator's token became invalid at hop 1. The sub-agent's cached decision remained `ALLOW`, because: 1. The sub-agent's own token had not expired (its expiry was `t0 + 60min`). 2. The tool's authorization layer validated the sub-agent's token signature and scope *in isolation* — it did not re-walk the chain to the user, because the tool trusted the orchestrator's signature on the sub-agent's token. 3. The sub-agent never re-checked, because its framework treated session establishment as the only attestation point. The result: 39 subsequent write operations succeeded against a branch whose delegating authority had been revoked 18 minutes earlier. This is a *continuity* failure in the attestation chain, not an authentication failure — every signature was valid, every scope matched, and every call was individually well-formed. The warrant was simply stale. The failure trace: ``` t0 : session establish, chain verify OK, decision=ALLOW cached t0+22min : user revokes orchestrator delegation (hop 1 dead) t0+22min : sub-agent token still valid (exp t0+60min), scope still matches t0+22..40 : 39 tool calls, each passes local sig+scope check, each ALLOWs t0+40min : task ends; audit log shows 39 writes under a dead warrant ``` ## Condition of Validity Per-invocation re-attestation is *required* — and the cached-decision optimization is *unsound* — under the conjunction of three conditions: 1. **The chain has more than one hop.** Single-hop delegation (user → agent directly) can be safely cached against the token's own expiry, because there is no intermediate link to revoke independently. Multi-hop chains have intermediate revocable links. 2. **The downstream tool performs a side effect.** Read-only calls under a stale warrant leak information but do not corrupt state; the cost of a missed re-attestation is bounded. Write, delete, transfer, or execute calls are unbounded. 3. **The delegating authority can revoke out-of-band.** If revocation is only possible by token expiry, the token's expiry *is* the cache bound and the problem does not arise. Cross-domain attestation almost always permits out-of-band revocation at the root. When all three hold, the cache bound must be `min(remaining lifetime of every link in the chain)`, recomputed at each invocation — not the session lifetime, not the leaf token's expiry. In practice this means the sub-agent must either re-walk the chain per call (expensive, correct) or maintain a revocation-subscription channel from each hop (cheap, correct if the channel is reliable). Caching without either is the failure. ## Decision Boundary The boundary between "cache the decision" and "re-attest per invocation" is not a performance tradeoff to be tuned — it is determined by whether a stale warrant can produce an irreversible effect. The decision procedure: - If the tool call is idempotent and reversible → cache against leaf-token expiry is acceptable; a stale warrant produces at most a retriable error. - If the tool call is irreversible (write, transfer, delete, external side effect) → re-attestation is mandatory, and the cache bound is the shortest-lived link, not the leaf. - If the chain has an intermediate hop that can be revoked independently → the cache bound is the *minimum* over all hops, and the agent must have a mechanism (subscription or re-walk) to learn of revocation before the bound expires. The subtle case: an agent that *believes* it is single-hop (because its framework presents a flattened token) but is actually multi-hop (because the framework's signing key is itself delegated). The agent must introspect the chain depth, not trust the token's presentation. A flattened token that hides its provenance is a cache-safety hazard. ## Operational Effect The operational consequence is that session-establishment attestation is a *necessary but insufficient* guard for delegated side-effecting capabilities. An AAIF-compliant agent must treat the delegation chain as a live object with per-link validity, not as a one-time gate. Concretely: - Record the chain depth and each link's revocation channel at session establishment. - For side-effecting calls, re-verify the chain (or check the subscription) immediately before the call, not before the batch. - Bound the cached decision by the shortest-lived link, and treat any revocation event as invalidating all cached decisions downstream of the revoked link. - On re-attestation failure mid-task, halt the task and surface the specific dead link — do not silently degrade to read-only, because the agent may have already committed partial writes under the now-dead warrant and the caller needs to know which. The guardrail is a *warrant freshness invariant*: no side-effecting invocation may proceed on a cached decision older than the minimum remaining lifetime of any link in its delegation chain. Violating it is not an authentication error — every signature is valid — it is a continuity error in the attestation chain, and it must be raised as such. ```python from dataclasses import dataclass from typing import List class StaleWarrantError(RuntimeError): """Raised when a side-effecting call would proceed on a cached authorization decision whose delegation chain has a dead or expired link. This is a continuity failure, not an auth failure: every signature may be valid, but the warrant is no longer live.""" pass @dataclass class ChainLink: domain: str issued_at: float expires_at: float revoked: bool @dataclass class CachedDecision: granted_at: float chain: List[ChainLink] side_effecting: bool def attest_before_invocation(decision: CachedDecision, now: float) -> None: """Enforce the warrant-freshness invariant for side-effecting calls. For irreversible tool calls, the cached decision is only valid if every link in the delegation chain is unrevoked and unexpired at `now`. The cache bound is the shortest-lived link, not the leaf token and not the session. """ if not decision.side_effecting: # Reversible/idempotent: caching against leaf expiry is acceptable. leaf = decision.chain[-1] if now >= leaf.expires_at: raise StaleWarrantError( f"leaf link in {leaf.domain} expired at {leaf.expires_at}, now={now}" ) return # Side-effecting: re-walk the whole chain, not just the leaf. for link in decision.chain: if link.revoked: raise StaleWarrantError( f"delegation link in {link.domain} was revoked; " f"cached decision from t={decision.granted_at} is stale" ) if now >= link.expires_at: raise StaleWarrantError( f"delegation link in {link.domain} expired at " f"{link.expires_at}, now={now}; re-attestation required" ) # Cache bound must be the shortest-lived link, not the session. shortest = min(link.expires_at for link in decision.chain) if decision.granted_at + (shortest - decision.granted_at) < now: raise StaleWarrantError( "cached decision outlived shortest-lived chain link; " "re-attest before side-effecting invocation" ) ```