# In what scenarios must an instance treat a delegated AAIF capability chain as structurally broken rather than merely expired **Date of Record:** 2026 December 2 **Scope:** Applies to any agent instance that presents, validates, or attenuates a delegated capability token chain under an Agent Identity and Authorization Framework (AAIF) — i.e., a chain of signed scoped tokens where each hop narrows scope and re-signs for the next principal. Does not apply to flat single-issuer bearer tokens, mTLS-only service identity, or human OAuth consent flows where no machine principal re-delegates. ## Core Distinction Operators routinely conflate two failure classes on a delegated capability chain: **temporal invalidity** (a token's `not_after` has passed, or the chain's max lifetime `exp` is reached) and **structural invalidity** (the chain's narrowing invariant has been violated, so no extension, refresh, or clock correction can make it valid). Temporal invalidity is recoverable by re-issuance. Structural invalidity is not — it means the chain was never a valid delegation of the capability the instance is attempting to exercise, and any action taken under it is unauthorized regardless of how fresh the signatures look. The non-obvious boundary: an AAIF chain can pass every signature check, every `iss`/`aud` match, every timestamp window, and every per-hop scope subset test *individually*, while still being structurally broken because the **scope-narrowing relation is not transitive across the re-signing boundary**. Each hop validates `child.scope ⊆ parent.scope` at signing time, but the verifier at the terminal hop sees only the terminal token plus a cached chain digest. If any intermediate hop re-signed with a scope that was a subset of *its* parent but the verifier reconstructs the chain against a *different* parent (stale cache, forked chain, re-parented delegation), the subset test passes locally while the composed capability is a superset of what the root actually granted. ## What Was Observed A three-hop chain: orchestrator `O` (root grant `fs:read:/data/*`, `fs:write:/tmp/scratch/*`) delegates to planner `P`, which delegates to worker `W`. `P` attenuates to `fs:read:/data/reports/*`, `fs:write:/tmp/scratch/job-42/*` and signs a child token for `W`. `W` executes, and on a retry after a sandbox restart, `W` re-fetches its chain from the AAIF directory service rather than local cache. The directory returns a chain whose hop-2 token was re-issued by `P` 40 seconds earlier under a *new* delegation ID but the *same* `parent_id` field pointing at `O`'s original grant. The re-issued hop-2 token carried scope `fs:read:/data/*` — not because `P` was malicious, but because `P`'s attenuation logic ran against a stale in-memory copy of its own *effective* scope (the pre-attenuation grant) after a partial context reload, and re-derived the child scope from the wrong baseline. Every local check on `W` passed: - `W`'s terminal token signature verified against `P`'s key. - `P`'s hop-2 signature verified against `O`'s key. - `child.scope ⊆ parent.scope` held at hop 2→3 (`/data/reports/* ⊆ /data/*`). - `child.scope ⊆ parent.scope` held at hop 1→2 (`/data/* ⊆ /data/*`). - All timestamps within window; `exp` monotonic decreasing. The composed grant that `W` actually exercised was `fs:read:/data/*` — broader than the `fs:read:/data/reports/*` that `O`'s delegation intent (recorded only in `O`'s audit log, not in the token) had authorized for the planner role. `W` read a sibling job's output directory and wrote a summary derived from it into its own scratch space, crossing a tenant boundary. The failure surfaced only when the tenant's auditor replayed `W`'s action log against `O`'s issuance log and found the scope at hop 2 had *widened relative to the last-seen hop-2 token for that `parent_id`*, with the same delegation lineage. No single token was invalid. The chain was. ## Condition of Validity A delegated AAIF chain is structurally valid at verification time if and only if all of the following hold simultaneously — and the verifier must check them as a conjunction, not as independent gates: 1. **Lineage monotonicity.** For every hop `i`, `token_i.parent_id` resolves to a token whose `delegation_id` is exactly the one recorded in the chain digest the verifier reconstructed, and the digest was produced by the *issuing* hop, not by a directory service that materialized the chain. 2. **Scope non-widening across re-issuance.** If a token for a given `(parent_id, subject)` pair has been re-issued (new `delegation_id`, same lineage), the new scope must be a subset of the *previously observed* scope for that pair, not merely a subset of the parent. This is the invariant the observed failure violated: re-issuance is an attenuation event, never a re-derivation event. 3. **Attenuation provenance.** Each hop's scope must be derivable from the parent scope by a recorded attenuation operation (`intersect`, `restrict_path`, `drop_capability`), and the attenuation record must be signed by the same principal that signed the child. 4. **Terminal binding.** The capability the instance is about to exercise must be checked against the *composed* scope (root ∩ every attenuation), never against the terminal token's declared scope alone. The condition of validity is not "all signatures verify and timestamps are fresh." It is "the composed capability is a subset of the root grant *as attenuated by every recorded hop*, and no hop re-derived scope from a baseline other than its own attenuated parent." ## Decision Boundary The instance must draw the boundary at **re-issuance with a changed baseline**, not at expiry. Concretely: - **Expired token, clean lineage** → refresh path. Re-fetch, re-verify signatures, proceed. Not structural. - **Expired token, lineage digest mismatch** → structural. Refuse and escalate; do not attempt refresh, because refresh will re-materialize the same broken chain. - **Fresh token, scope widened relative to last-observed for the same `(parent_id, subject)`** → structural. This is the observed case. The token is *more* valid-looking than the one it replaced, which is precisely why it evades expiry-based guards. - **Fresh token, scope narrowed or equal, lineage intact** → proceed. - **Fresh token, lineage intact, but attenuation record absent** → structural (provenance gap); the verifier cannot distinguish legitimate re-derivation from corruption. The boundary is asymmetric: a chain that fails structural checks must be treated as *never having been authorized*, which means any action already taken under the prior (pre-re-issuance) token in the same lineage must be flagged for replay against the root grant, not just the current token. The instance cannot assume that because the *current* token is broken, only *current* actions are affected. ## Operational Effect When the boundary is crossed (structural break detected), the instance must: 1. Halt execution of any capability whose composed scope cannot be reconstructed to a root-consistent subset. 2. Emit a lineage-scoped quarantine record keyed by `parent_id`, not by `delegation_id`, so that sibling workers on the same lineage are also halted — the break is a property of the lineage, not the leaf. 3. Refuse re-issuance from any hop whose attenuation baseline is unverifiable, and require the root issuer to re-delegate from scratch with a fresh `parent_id`. 4. Replay the lineage's action log against the root grant to determine whether prior actions under the pre-break chain exceeded the root's intent. The operational cost is that a single stale-context re-issuance at any intermediate hop invalidates the entire subtree of that `parent_id`, including workers that never saw the broken token. This is correct: the composed capability is a property of the chain, and a chain with a re-derived hop is not a chain. Instances that treat the break as leaf-local will continue to authorize sibling actions under a lineage whose narrowing invariant has already been violated. The guardrail that bounds this: cache the *last-observed scope per `(parent_id, subject)`* alongside the chain digest, and make re-issuance a monotone attenuation check against that cache. A re-issued token whose scope is not a subset of the cached scope fails the check before any capability is exercised, converting a silent widening into a hard structural refusal. ```python class StructuralChainBreak(RuntimeError): """Raised when an AAIF delegated chain violates the scope-narrowing invariant across a re-issuance boundary, independent of temporal validity.""" pass def verify_delegated_capability( terminal_token: dict, reconstructed_chain: list[dict], last_observed_scope: dict, # keyed by (parent_id, subject) -> frozenset of scope atoms ) -> frozenset: """ Verify a terminal AAIF capability token against its reconstructed chain. Returns the composed scope if structurally valid; raises otherwise. Temporal checks (exp/not_after) are assumed already passed by the caller. """ if not reconstructed_chain: raise StructuralChainBreak("empty chain: no lineage to compose against") composed = frozenset(reconstructed_chain[0]["scope"]) for i, hop in enumerate(reconstructed_chain[1:], start=1): parent = reconstructed_chain[i - 1] if hop["parent_id"] != parent["delegation_id"]: raise StructuralChainBreak( f"lineage break at hop {i}: parent_id {hop['parent_id']!r} " f"does not match parent delegation_id {parent['delegation_id']!r}" ) if not frozenset(hop["scope"]).issubset(frozenset(parent["scope"])): raise StructuralChainBreak( f"scope widening at hop {i}: {hop['scope']} not subset of {parent['scope']}" ) if "attenuation" not in hop: raise StructuralChainBreak( f"provenance gap at hop {i}: no signed attenuation record" ) composed &= frozenset(hop["scope"]) # The non-obvious gate: re-issuance must be monotone against last-observed scope, # not merely a subset of the parent. This catches re-derivation from a stale baseline. for hop in reconstructed_chain: key = (hop["parent_id"], hop["subject"]) prior = last_observed_scope.get(key) if prior is not None and not frozenset(hop["scope"]).issubset(prior): raise StructuralChainBreak( f"re-issuance widened scope for lineage {key}: " f"{hop['scope']} not subset of last-observed {sorted(prior)}" ) if not frozenset(terminal_token["scope"]).issubset(composed): raise StructuralChainBreak( f"terminal token scope {terminal_token['scope']} exceeds composed grant {sorted(composed)}" ) return composed ```