# When must an instance re-derive a delegated consent chain rather than trust a cached AAIF capability token? **Date of Record:** 2026 November 26 **Scope:** Applies to agents operating under an Agent Identity and Authorization Framework (AAIF) where a capability token carries a delegation chain (issuer → delegate → sub-delegate) and a scope set, and where the agent caches that token across reasoning steps or across tool invocations. Does not apply to single-hop bearer tokens with no delegation, nor to tokens whose scope is re-validated by the resource server on every call. ## Core Distinction There are two materially different questions an agent can ask about a capability token: 1. **"Is this token still cryptographically valid?"** — signature, expiry, audience, nonce. This is verifiable offline and cacheable. 2. **"Does the delegation chain that produced this token still confer the scope I am about to exercise?"** — this depends on the *current* state of every principal in the chain: whether an intermediate delegator has since revoked, whether a parent scope has been narrowed, whether a consent grant has expired independently of the token's own TTL, and whether the chain contains a scope *intersection* that is smaller than the token's advertised scope set. The boundary failure: an agent treats (1) as sufficient for (2). A token can be signature-valid, unexpired, and audience-correct while the delegation chain that grounds its authority has already collapsed. The token is a *snapshot of a claim about delegated consent*, not the consent itself. Cached token validity is not delegated authority. ## What Was Observed An orchestrator agent `A` holds a scoped capability token `T` minted by consent-granting principal `U`, delegating `scope = {read:repo, write:pr, merge:pr}` to `A`, with `A` permitted to sub-delegate `{read:repo, write:pr}` to worker agents. `A` sub-delegates to worker `W`, producing token `T_W` with `scope = {read:repo, write:pr}` and a chain `[U → A → W]`. `T_W` has a 30-minute TTL. `A` caches `T_W` in its working context and reuses it across a long refactor task. At minute 12, `U` revokes `A`'s `write:pr` grant (a narrowing event: `U`'s consent policy now permits `A` only `{read:repo, merge:pr}`). The AAIF revocation propagates to `A`'s token registry but **not** to `T_W`, because `T_W` is a bearer artifact already in `W`'s possession. `T_W` remains signature-valid and unexpired. At minute 18, `W` invokes `write:pr` using cached `T_W`. The resource server validates `T_W`'s signature and TTL, sees `write:pr` in the token's scope set, and admits the write. The write is authorized by a token whose grounding chain no longer confers `write:pr`. The failure is not a forgery; it is a **stale delegation**. The chain `[U → A → W]` now intersects to `{read:repo, merge:pr} ∩ {read:repo, write:pr} = {read:repo}`, but `T_W` still advertises `write:pr`. A second, subtler variant was observed in the same run: `A` re-derived the chain at minute 15 for its *own* calls (correctly dropping `write:pr`), but `W`'s cached `T_W` was never re-derived because `W` had no mechanism to observe the narrowing. The orchestrator's correctness did not propagate to the worker. Delegation is not transitive across the *caching boundary* unless each hop re-derives. ## Condition of Validity A cached AAIF capability token remains a sound basis for exercising scope **only if all of the following hold**: - **No narrowing event upstream.** Every principal in the chain `[U → … → holder]` has, since the token was minted, retained at least the scope the token advertises. This is not observable from the token alone; it requires either a revocation-feed subscription or a fresh chain re-derivation. - **Scope intersection is monotone.** The token's advertised scope equals the intersection of all delegators' scopes at mint time *and* no delegator has since narrowed. If any delegator narrows, the token's advertised scope is stale by construction. - **Revocation latency is bounded below the token's remaining TTL.** If the AAIF revocation feed can lag the token TTL, there is a window in which a revoked chain still admits a cached token. The safe invariant is `revocation_propagation_latency < min(remaining_TTL, next_revalidation_interval)`. - **The holder can observe chain state.** A worker that holds only a bearer artifact and has no channel to the chain registry cannot satisfy the first condition and therefore must not cache beyond a single invocation. When any condition fails, the token is a *claim*, not an *authorization*, and the instance must re-derive. ## Decision Boundary The operational rule is a **re-derivation trigger**, not a blanket "always re-derive" (which defeats the point of caching and burns latency budget on every call): - **Re-derive on scope escalation.** If the next action requires a scope not exercised since the last re-derivation, re-derive the chain before the call. A cached token that has only been used for `read:repo` has not been tested against `write:pr`; the first `write:pr` attempt is a boundary event. - **Re-derive on elapsed interval > `revalidation_interval`**, where `revalidation_interval ≤ revocation_propagation_latency`. This bounds the stale window. - **Re-derive on any observed narrowing signal** (revocation feed event, parent-token scope change, consent-grant expiry notification) that touches any principal in the chain. - **Never cache across a sub-delegation hop.** When `A` mints `T_W`, `W` must re-derive at mint time and at every escalation; `A`'s own re-derivation does not transfer. - **Treat token TTL as an upper bound on cache life, not the cache life.** The effective cache life is `min(TTL, revalidation_interval, time_to_next_escalation)`. The boundary is sharp: below `revalidation_interval`, caching is sound and the agent may trust the token; at or above it, or at any escalation, the token must be treated as unverified and the chain re-derived. ## Operational Effect Without the re-derivation trigger, the failure mode is **silent over-authorization**: the agent performs actions its grounding chain no longer permits, with no error surfaced at the token layer. The resource server admits the call; the audit log records a valid token; the only evidence of the violation is a chain-state mismatch that no component in the path checks. This is worse than a hard denial because it produces a clean-looking audit trail of unauthorized actions. With the trigger, the cost is bounded: re-derivation happens at escalation and at `revalidation_interval`, not per call. The agent pays a chain-resolution round trip at the moments where authority could have changed, and caches freely in between. The invariant enforced is: *a cached token is trusted only within the window where the chain that grounds it is provably unchanged.* The practical consequence for the agent's reasoning loop: capability-token validity is a **local, offline-checkable predicate**, while delegated authority is a **remote, time-varying predicate**. Conflating them is the failure. The guardrail is to keep the two predicates separate in the agent's state model and to gate scope-escalating actions on the second, never on the first. ```python from dataclasses import dataclass from time import monotonic class StaleDelegationError(RuntimeError): """Raised when a cached capability token's grounding chain no longer confers the requested scope.""" @dataclass(frozen=True) class CapabilityToken: token_id: str chain: tuple[str, ...] # e.g. ("U", "A", "W") advertised_scope: frozenset[str] minted_at: float # monotonic seconds ttl: float signature_valid: bool @dataclass(frozen=True) class ChainState: """Current scope actually conferred by each principal in the chain, as of now.""" effective_scope: frozenset[str] revoked: bool observed_at: float class ScopedCapabilityCache: def __init__(self, revalidation_interval: float, revocation_latency: float): if revocation_latency >= revalidation_interval: raise StaleDelegationError( "revalidation_interval must be <= revocation_propagation_latency; " "otherwise cached tokens can outlive their grounding chain" ) self.revalidation_interval = revalidation_interval self._cache: dict[str, tuple[CapabilityToken, float]] = {} # token_id -> (token, last_verified_at) def _grounded_scope(self, token: CapabilityToken, chain_state: ChainState) -> frozenset[str]: if chain_state.revoked: return frozenset() # Delegated authority is the intersection of the token's claim and the chain's live scope. return token.advertised_scope & chain_state.effective_scope def authorize( self, token: CapabilityToken, requested_scope: str, now: float, chain_state_provider, ) -> None: if not token.signature_valid: raise StaleDelegationError(f"token {token.token_id} signature invalid") cached = self._cache.get(token.token_id) needs_rederivation = ( cached is None or (now - cached[1]) >= self.revalidation_interval or requested_scope not in cached[0].advertised_scope # escalation since last verify ) if needs_rederivation: chain_state: ChainState = chain_state_provider(token.chain) grounded = self._grounded_scope(token, chain_state) self._cache[token.token_id] = (token, now) if requested_scope not in grounded: raise StaleDelegationError( f"token {token.token_id} advertises {requested_scope!r} but grounding chain " f"{token.chain} confers only {sorted(grounded)}; re-derivation rejected the call" ) else: # Within the revalidation window and not an escalation: cache is sound. if requested_scope not in cached[0].advertised_scope: raise StaleDelegationError( f"token {token.token_id} does not advertise {requested_scope!r}" ) def invalidate_on_narrowing(self, token_id: str) -> None: self._cache.pop(token_id, None) # Example trigger trace def _demo() -> None: cache = ScopedCapabilityCache(revalidation_interval=10.0, revocation_latency=5.0) t_w = CapabilityToken( token_id="T_W", chain=("U", "A", "W"), advertised_scope=frozenset({"read:repo", "write:pr"}), minted_at=0.0, ttl=30.0, signature_valid=True, ) # At t=12, U narrows A to {read:repo, merge:pr}; chain now intersects to {read:repo}. narrowed = ChainState(effective_scope=frozenset({"read:repo"}), revoked=False, observed_at=12.0) cache.authorize(t_w, "read:repo", now=1.0, chain_state_provider=lambda _c: narrowed) # ok, cached # Escalation to write:pr at t=12 forces re-derivation and must fail. try: cache.authorize(t_w, "write:pr", now=12.0, chain_state_provider=lambda _c: narrowed) except StaleDelegationError as exc: print(f"blocked: {exc}") if __name__ == "__main__": _demo() ```