# How should an instance treat a delegated AAIF credential whose `delegation_depth` is valid but whose `scope_intersection` silently collapsed to the empty set at the third hop **Date of Record:** 2026 November 30 **Scope:** Applies to any LLM agent instance that receives an Agent Authorization and Identity Framework (AAIF) bearer credential via a delegation chain of length ≥ 2 and uses the credential's declared `scope` set to gate tool invocations. Does not apply to root-issued (depth-0) credentials, to pure capability tokens without a delegation chain, or to identity-only attestations that carry no scope vector. ## Core Distinction The failure is not "the credential is invalid" and it is not "the credential is expired." It is the specific state where every *structural* check on the credential passes—signature chain verifies end-to-end, each hop's `delegation_depth` is within the issuer's `max_delegation_depth`, no hop is expired, and the final `intersection` field is well-formed—yet the *semantic* authorization the agent believes it holds is empty. The credential is cryptographically pristine and operationally inert. AAIF delegation is defined by monotonic scope attenuation: each hop computes `child.scope = parent.scope ∩ requested_scope`. The invariant that makes delegation safe is that this intersection is *monotone non-increasing* along the chain. The non-obvious boundary is that intersection is a set operation over a *structured scope vector* (resource × action × constraint), and two well-formed scope vectors can intersect to the empty set while every per-field check still passes. A parent scoped to `resource:db-prod, action:read` delegating to a child requesting `resource:db-prod, action:write` yields an empty intersection on the `action` axis; the child credential is issued with `scope: {}`. Most verifiers check `scope` is present and syntactically valid, not that it is non-empty. The agent then proceeds to call tools with a credential that authorizes nothing, and the failure surfaces as a downstream 403 at the resource server—*after* the agent has already committed reasoning and side effects to that path. ## What Was Observed A three-hop chain: orchestrator (root, scope `{db-prod:read, db-prod:write, cache:read}`) → planner agent (requested `{db-prod:read, db-prod:write}`, received intersection `{db-prod:read, db-prod:write}`, depth 1 of max 3) → worker agent (requested `{db-prod:write, cache:read}`, received intersection `{db-prod:write}`, depth 2) → sub-worker (requested `{db-prod:read}`, received intersection `{}`, depth 3). The sub-worker's credential verified at the gateway: signature chain intact, all four `jti` values unique, `delegation_depth: 3 ≤ max_delegation_depth: 3`, `not_after` on every hop in the future. The gateway's AAIF validator returned `VALID`. The sub-worker's own pre-flight check read `scope` as a dict, found it present and JSON-schema-valid (empty object satisfies the schema), and proceeded. The sub-worker then executed a five-step plan whose step 3 required `db-prod:read`. Steps 1 and 2 were `cache:read` and a local scratch write—both of which the sub-worker *also* lacked, but which it attempted anyway because its planning loop had been seeded with the assumption that it inherited the worker's scope. The resource server rejected step 1 with 403 `scope_missing:cache:read`. The sub-worker's error handler classified this as a transient authorization glitch, retried twice with the same credential, then escalated to the worker agent with a request to "re-mint." The worker could not re-mint—its own scope (`{db-prod:write}`) could not produce `cache:read` or `db-prod:read` under monotone attenuation. The chain deadlocked: the sub-worker held a credential it could not use, the worker held a credential that could not repair it, and the orchestrator was never consulted because the escalation path only went one hop up. The root cause was not the empty intersection per se—that is correct, safe attenuation. The root cause was that the sub-worker's pre-flight validator treated "scope present and schema-valid" as equivalent to "scope non-empty and covering the planned actions," and its escalation logic assumed the parent could always re-mint, which is false under monotone attenuation once the parent's own scope has already diverged from the child's need. ## Condition of Validity The guardrail holds only under the following conjunction, and each conjunct is independently falsifiable: 1. **Non-empty check at issuance, not just at use.** The AAIF issuer MUST reject a delegation request whose computed intersection is empty, returning `SCOPE_INTERSECTION_EMPTY` at mint time rather than issuing an inert credential. This converts a runtime 403 into a structured issuance error the requesting agent can reason about before committing to a plan. Issuance-time rejection is the only point where the full parent scope is visible and the requesting agent's intent is still mutable. 2. **Pre-flight plan-coverage check.** Before executing a multi-step plan, the instance MUST compute the union of `(resource, action)` pairs its plan requires and assert that union is a subset of its credential's scope. This is a set-containment check, not a presence check. An empty scope trivially fails any non-empty plan. 3. **Escalation must be able to reach the minting ancestor, not just the parent.** Under monotone attenuation, a parent whose scope has already diverged from the child's need cannot repair the child. The escalation path must carry the *original requested scope* and route to the highest ancestor whose scope contains it, or fail closed with a re-plan signal. One-hop escalation is structurally insufficient for chains of depth ≥ 2. 4. **Depth exhaustion must be distinguished from scope exhaustion.** `delegation_depth == max_delegation_depth` is a *capacity* boundary; `scope == {}` is an *authorization* boundary. Conflating them causes the instance to request a deeper delegation (impossible) when it should request a wider one (possible, via a different ancestor). ## Decision Boundary The instance must decide, at credential-receipt time, between three states, and the boundary between them is the empty-set test on the *intersected* scope, not on any individual hop's requested scope: - **Usable:** `scope ≠ {}` and `scope ⊇ plan_requirements`. Proceed. - **Inert-but-repairable:** `scope == {}` and some ancestor in the chain has `scope ⊇ original_requested_scope`. Escalate to that ancestor with the original request; do not execute. - **Inert-and-unrepairable:** `scope == {}` and no ancestor's scope covers the request (the request was never satisfiable under the root's authority). Fail closed, emit `DelegationUnsatisfiable`, and re-plan against the root scope. The subtle boundary is between "inert-but-repairable" and "inert-and-unrepairable": both present as an empty scope, and the discriminator is a *backward scan* over the chain's recorded parent scopes, which most verifiers discard after validation. The instance must retain the full hop scope history, not just the terminal credential, to make this decision. A verifier that validates the chain and then drops intermediate scopes has destroyed the information needed to distinguish repairable from unrepairable—this is the AAIF analogue of distillation loss, where the terminal state is preserved but the derivation is lost. ## Operational Effect When this boundary is handled correctly, empty-intersection delegations fail at mint time or at pre-flight, before any tool side effects, and the agent's retry budget is spent on re-planning rather than on doomed 403 retries. When it is handled incorrectly, the observed effect is a characteristic three-symptom signature: (a) a burst of 403s from a resource server against a credential the gateway marked `VALID`, (b) a retry loop bounded by the agent's retry cap rather than by any authorization signal, and (c) a one-hop escalation that returns "cannot re-mint" and leaves the sub-task in a terminal-but-unacknowledged failed state. The deadlock is not a lock in the concurrency sense—no agent is blocked waiting—it is a *livelock of authority*: every participant holds a valid credential, none can act, and the escalation graph has no edge to the only node that could resolve it. The invariant to enforce: **a credential whose scope is the empty set must never be issued, and if received, must never be used.** Empty scope is not a weak credential; it is the absence of a credential wearing the credential's clothes. The instance that treats `VALID` as `AUTHORIZED` has confused signature validity with authorization coverage, and that confusion is the entire failure. ```python from dataclasses import dataclass from typing import FrozenSet, List, Optional, Tuple class DelegationScopeError(RuntimeError): """Raised when a delegated AAIF credential's scope cannot satisfy the holder's plan.""" @dataclass(frozen=True) class ScopeAtom: resource: str action: str @dataclass(frozen=True) class AAIFHop: issuer: str subject: str scope: FrozenSet[ScopeAtom] delegation_depth: int max_delegation_depth: int not_after_epoch: int @dataclass(frozen=True) class AAIFChain: hops: List[AAIFHop] # hops[0] is root-issued; hops[-1] is the presented credential @property def terminal(self) -> AAIFHop: return self.hops[-1] def ancestor_covering(self, need: FrozenSet[ScopeAtom]) -> Optional[AAIFHop]: """Highest ancestor whose scope contains the full need. Under monotone attenuation only such an ancestor can re-mint a satisfiable credential.""" for hop in reversed(self.hops[:-1]): if need.issubset(hop.scope): return hop return None def admit_credential( chain: AAIFChain, plan_requirements: FrozenSet[ScopeAtom], now_epoch: int, ) -> None: """Pre-flight admission. Raises DelegationScopeError on any boundary violation.""" term = chain.terminal # Structural checks (these are what a naive verifier stops at). if term.delegation_depth > term.max_delegation_depth: raise DelegationScopeError( f"depth {term.delegation_depth} exceeds max {term.max_delegation_depth}" ) if term.not_after_epoch <= now_epoch: raise DelegationScopeError("terminal credential expired") # THE BOUNDARY: empty intersection is not a weak credential, it is no credential. if not term.scope: repair = chain.ancestor_covering(plan_requirements) if repair is not None: raise DelegationScopeError( f"inert-but-repairable: scope collapsed to empty at depth " f"{term.delegation_depth}; escalate to {repair.issuer} with original need" ) raise DelegationScopeError( f"inert-and-unrepairable: empty scope at depth {term.delegation_depth} " f"and no ancestor covers {sorted((a.resource, a.action) for a in plan_requirements)}" ) # Plan-coverage containment, not mere presence. missing = plan_requirements - term.scope if missing: repair = chain.ancestor_covering(plan_requirements) detail = ( f"escalate to {repair.issuer}" if repair else "no ancestor can repair; re-plan" ) raise DelegationScopeError( f"plan requires {sorted((a.resource, a.action) for a in missing)} " f"absent from terminal scope; {detail}" ) # Admitted: scope non-empty and covers the plan. ```