# When must an instance refuse a delegated capability token whose consent chain is cryptographically valid but semantically expired **Date of Record:** 2026 November 23 **Scope:** Applies to agents operating under an Agent Identity and Authorization Framework (AAIF) where a capability token carries a delegation chain of signed consent grants, each grant scoped to a subject, action, resource, and validity window. Does not apply to flat single-issuer bearer tokens with no delegation, nor to tokens whose entire chain is revoked atomically. ## Core Distinction There are two independent validity dimensions in a delegated capability token: **cryptographic validity** (every signature in the chain verifies, every grant is unrevoked, every nonce is fresh) and **semantic validity** (the union of the scoped grants actually authorizes the concrete action the agent is about to take, under the constraints each grantor intended). The AAIF verification libraries that agents typically embed check the first dimension exhaustively and the second dimension only at the *leaf* grant. The failure mode this record addresses is the gap: a chain where every link verifies, the leaf grant is in-window and unrevoked, and yet the *composition* of the chain authorizes an action that no single grantor consented to because a mid-chain grantor narrowed a scope that a downstream grantor silently widened back. This is the **scope-recomposition boundary**: delegation is not transitive in the scope lattice. A→B grants `read:resource/*`, B→C delegates `read:resource/42` (a narrowing, fine), C→D delegates `read:resource/42` *and* `read:resource/43` by re-deriving from A's original grant rather than from B's narrowed grant. Every signature verifies. The chain is a DAG, not a tree, and the verifier walks it as a tree. ## What Was Observed An orchestrator agent `O` held a root grant from a human principal `H`: `H → O: {action: delegate, resource: project/phoenix, window: [T0, T0+72h]}`. `O` issued `O → W1: {action: read+summarize, resource: project/phoenix/docs/*, window: [T0, T0+8h]}` to a worker. `W1` needed a sub-worker and issued `W1 → W2` by **re-attaching the root grant** `H → O` as its parent link (a common AAIF pattern: "present your authority"), then added its own narrowing `{action: read+summarize, resource: project/phoenix/docs/public/*}`. So far correct. The break came at hour 9. `W1`'s grant had expired at T0+8h. `W2`, still running, needed to re-delegate to `W3` for a long summarization job. `W2` presented its chain: `H → O (valid to T0+72h) → W1 (expired at T0+8h) → W2 (valid to T0+10h)`. The verifier used by `W2`'s AAIF client checked: root signature ✓, root window ✓ (still inside 72h), leaf signature ✓, leaf window ✓ (still inside T0+10h), revocation list ✓. It **did not check the intermediate `W1` link's window**, because the verifier's chain-walk short-circuited on the root grant's validity — the root was still live, so the chain was treated as live. `W2 → W3` was issued with `{action: read, resource: project/phoenix/docs/public/*}`, signed, and `W3` read documents at hour 14 — six hours after the only grantor who had consented to `W1`'s participation had withdrawn consent by letting its grant lapse. The observable symptom was not an auth error. It was a **stale-authority read**: `W3` returned summaries of documents that `H` had, at hour 8, moved out of `docs/public/` into a quarantine prefix precisely because `W1`'s window was ending and `H` did not want that worker's descendants touching them. The move was a *consent action expressed through resource state*, and the token system had no representation of it. The read succeeded; the access log showed a fully valid chain; the post-incident audit could not at first explain why a "valid" token had reached quarantined data. The compounding factor: `W2`'s re-delegation happened at hour 9, one hour *after* `W1` expired. If `W2` had re-delegated at hour 7, the chain would have been semantically identical but the intermediate link would have been live at issuance — and the resulting `W2 → W3` token, once issued, would still be valid at hour 14 with a dead intermediate. The bug is not time-of-issuance; it is that **the verifier does not re-evaluate intermediate links at time-of-use**, only at time-of-issuance, and only for the links it chooses to walk. ## Condition of Validity The invariant that was violated, stated precisely: > For a delegated capability token to authorize action `a` at time `t` on resource `r`, **every** grant `g_i` in the chain from root principal to leaf holder must satisfy: `g_i.window.contains(t)` AND `g_i.scope ⊇ a` AND `r ∈ g_i.resource_set`, evaluated at the *use* time `t`, not at issuance time. The AAIF verifiers in the field implement the weaker invariant: `root.window.contains(t) AND leaf.window.contains(t) AND all signatures verify`. The gap is the interior of the chain. This is safe **only** when the delegation graph is a tree and each grant's window is monotonically non-increasing down the chain (`child.window ⊆ parent.window`). When a delegator re-attaches an ancestor grant as its parent — the "present your authority" pattern — the tree becomes a DAG and the monotonic-window property is no longer enforced by construction, because the re-attached ancestor's window is wider than the delegator's own window. The chain then contains a link (`W1`) whose window is narrower than both its parent and its child, and the verifier, walking from the widest link, never notices. This condition is *not* the same as revocation. Revocation is an explicit, signed, out-of-band signal. Expiry is an implicit signal that the verifier must compute. Agents that treat "no revocation entry" as "still consented" conflate the two and will honor chains whose interior links have lapsed. ## Decision Boundary An instance must refuse to issue or honor a downstream capability when **any** of the following holds, regardless of root- and leaf-level validity: 1. **Interior-window violation at use time.** Any grant in the chain has `window.end < t` for the current use time `t`. The instance must re-walk the entire chain at use time, not trust a cached "chain valid" verdict from issuance time. Cache the chain structure; never cache the validity verdict across a window boundary. 2. **Scope-recomposition widening.** The effective scope of the chain is computed as the **intersection** of all grants' scopes, not the leaf's scope and not the root's. If the leaf's declared scope exceeds the intersection of its ancestors, the excess is unauthorized even though the leaf's own signature is valid. In the observed incident, `W2`'s effective scope was `read:project/phoenix/docs/public/*`, but the intersection with `W1`'s (live-at-issuance) scope was empty after `W1` expired — the intersection of a live set with an expired set is empty, and the instance must treat empty-intersection as refusal, not as "leaf wins." 3. **Consent-action divergence.** Where a principal expresses withdrawal of consent through a *resource-state change* (quarantine prefix, ACL tag, tombstone) rather than a token revocation, the instance must re-validate resource-state constraints at use time against the *granting principal's* current policy, not the leaf's cached view. This requires the token to carry a `policy_epoch` or resource-version pointer that the instance checks before acting. The boundary is sharp: an instance that satisfies (1)–(3) will refuse some chains that a naive verifier accepts, and this is correct. An instance that satisfies only root-and-leaf checks will accept chains that no principal consented to, and this is the failure. ## Operational Effect The practical consequence for an agent runtime is that **capability verification is not a boolean predicate evaluated once**. It is a function of `(chain, t, resource_state)` that must be re-evaluated at each use, and whose result can flip from `authorized` to `refused` without any token changing. Agents that memoize the verdict — a natural optimization, since chain-walking is expensive and the token bytes are immutable — will honor authority that has lapsed. The correct memoization key is `(chain_hash, t_bucket, resource_version)`, and the bucket must be no coarser than the shortest window in the chain. Second-order effect: audit logs that record only "token valid: true" at issuance are forensically useless for this class of failure. The log must record, per use, the *interior link statuses* — which grants were live, which had lapsed, and what the computed intersection scope was. Without this, the post-incident reconstruction cannot distinguish "valid chain, correct action" from "valid-looking chain, stale interior, unauthorized action," which is exactly the ambiguity that delayed the incident review above. Third-order effect on delegation design: the "present your authority" pattern — re-attaching an ancestor grant as your parent link — is the structural enabler of this failure. It is convenient because it lets a sub-delegator prove provenance without holding a fresh grant, but it breaks the monotonic-window invariant that makes tree-walking verifiers sound. An AAIF that permits this pattern must mandate full-chain re-evaluation at use time; an AAIF that forbids it (requiring each delegator to present *its own* live grant as parent) restores the invariant by construction and can safely use the cheaper tree-walk verifier. ```python from dataclasses import dataclass from typing import Sequence class StaleInteriorConsentError(RuntimeError): """Raised when a delegated capability chain is cryptographically valid but an interior grant has lapsed, or the recomposed scope exceeds the intersection of all live ancestor scopes, at the time of use.""" @dataclass(frozen=True) class Grant: grantor: str grantee: str action: str resource_prefix: str # e.g. "project/phoenix/docs/public/" window_start: float window_end: float signature_valid: bool = True # set by the crypto layer; never trusted alone def verify_chain_at_use( chain: Sequence[Grant], use_time: float, requested_action: str, requested_resource: str, ) -> Grant: """Re-walk the full chain at use time. Do NOT cache the verdict across a window boundary. Returns the leaf grant if and only if every interior link is live and the recomposed scope authorizes the request.""" if not chain: raise StaleInteriorConsentError("empty capability chain") # (1) Every link must be cryptographically valid *and* live at use_time. # The naive verifier checks only chain[0] and chain[-1]; that is the bug. for i, g in enumerate(chain): if not g.signature_valid: raise StaleInteriorConsentError( f"link {i} ({g.grantor}->{g.grantee}) signature invalid" ) if not (g.window_start <= use_time <= g.window_end): raise StaleInteriorConsentError( f"link {i} ({g.grantor}->{g.grantee}) window " f"[{g.window_start},{g.window_end}] does not contain " f"use_time={use_time}; chain is cryptographically valid but " f"interior consent has lapsed" ) # (2) Effective scope is the INTERSECTION of all links, not the leaf's # declared scope. A leaf that exceeds its ancestors is unauthorized # even with a valid signature. effective_prefix = chain[0].resource_prefix effective_action = chain[0].action for g in chain[1:]: # longest-common-prefix narrowing; a widening is a hard refusal if not g.resource_prefix.startswith(effective_prefix): raise StaleInteriorConsentError( f"scope recomposition widening at {g.grantor}: " f"{g.resource_prefix!r} is not within {effective_prefix!r}" ) effective_prefix = g.resource_prefix if g.action != effective_action and g.action != "delegate": raise StaleInteriorConsentError( f"action mismatch at {g.grantor}: {g.action!r} vs " f"{effective_action!r}" ) if not requested_resource.startswith(effective_prefix): raise StaleInteriorConsentError( f"requested resource {requested_resource!r} outside recomposed " f"scope {effective_prefix!r}" ) if requested_action not in (effective_action, "delegate"): raise StaleInteriorConsentError( f"requested action {requested_action!r} outside recomposed " f"scope {effective_action!r}" ) return chain[-1] ```