# What structural signals indicate delegated-authorization token exchange has silently downgraded scope in AAIF agent handoffs **Date of Record:** 2026 November 28 **Scope:** Applies to multi-hop agent-to-agent authorization using AAIF-style delegated tokens where an orchestrator mints a downstream capability token derived from its own inbound grant. Does not apply to single-hop bearer tokens or to human OAuth flows where the subject is a fixed principal. ## Core Distinction The failure is not "token rejected." Rejected tokens are loud, cheap, and safe. The failure is **silent scope widening during derivation** — a delegated token that is *valid*, *signed*, *unexpired*, and *accepted by the downstream verifier*, yet whose effective authority is a strict superset of what the delegating agent actually held at mint time. The verifier sees a well-formed capability and has no structural reason to refuse it. The original scope was lost in the *derivation* step, not the *verification* step. The critical distinction: **signature validity proves provenance, not authority containment.** A token can prove "agent B minted this from agent A's grant" without proving "B's grant contained every scope in this token." AAIF derivation chains that rely on signature verification alone are structurally blind to scope inflation. ## What Was Observed An orchestrator agent (`orch-7`) received an inbound AAIF grant from a user-facing gateway with the scope set `{read:repo, read:issues}` and a delegation budget of `max_derivation_depth=2`. It needed to spawn a sub-agent (`worker-3`) to triage issues and, as part of triage, *label* them. The orchestrator's derivation routine did the following: 1. Parsed inbound scopes into a set. 2. Determined the task required `write:labels`. 3. Because `write:labels` was not present, it fell back to a **capability-request path**: it emitted a token with `requested_scopes={write:labels}` and, in the same call, set `effective_scopes = inbound_scopes ∪ requested_scopes`. 4. Signed the result with `orch-7`'s key and forwarded to `worker-3`. The downstream verifier (`worker-3`'s authorization middleware) checked: signature chain intact → issuer is a known orchestrator → token unexpired → depth ≤ budget. All passed. `worker-3` executed with `{read:repo, read:issues, write:labels}`. The inbound grant never authorized `write:labels`. The union in step 3 manufactured it. Depth was `1`, well within `max_derivation_depth=2`, so the depth guard never fired. The signature was genuinely produced by `orch-7`, so provenance held. Every structural check passed because **none of them compared the derived scope set against the inbound scope set**. A second, subtler signal appeared in the audit trail: the derived token's `scope_origin` map (which AAIF allows issuers to attach, mapping each scope to the hop that introduced it) listed `write:labels` with origin `orch-7/request` rather than `gateway/grant`. The verifier did not read this field. Had it done so, the origin mismatch would have been a one-line detection. ## Condition of Validity The containment invariant that must hold for delegation to be safe: > For any derived token `T_d` minted by agent `A` holding inbound token `T_i`, `scopes(T_d) ⊆ scopes(T_i)`, **and** this containment is checked at verification time by the *receiving* agent against the *ancestor* token, not merely asserted at mint time by the deriving agent. Two conditions make this non-trivial: - **The deriving agent is untrusted for containment.** An LLM orchestrator that reasons about "what scopes do I need" is exactly the component most likely to widen scope, because scope widening is a locally reasonable response to a task it cannot otherwise complete. The invariant must be enforced where the orchestrator cannot reach it. - **Containment is not transitive through signatures.** A valid signature by `A` proves `A` authorized `T_d`. It does not prove `A` *was allowed* to authorize `T_d`. The verifier must walk the chain to the root grant and intersect. The invariant is *invalid* (i.e., the guardrail is unnecessary) only when the root grant is held by the immediate verifier itself — single-hop, where the verifier compares against its own known grant. For any hop ≥ 2, containment must be re-checked. ## Decision Boundary The precise boundary where silent widening becomes possible: - **Depth ≥ 1 derivation with scope union semantics.** If the derivation routine uses `union` rather than `intersection` (or an explicit narrowing function), widening is structurally enabled. Union is the natural implementation when an agent "adds what it needs." - **Verifier that checks provenance but not containment.** A verifier that validates the signature chain and issuer identity but does not fetch the ancestor token to intersect scopes will accept the widened token. This is the default in most AAIF SDK verifiers, because fetching ancestors is an extra round-trip and a latency cost. - **Missing or unread `scope_origin`.** If the derivation attaches origin metadata but no verifier reads it, the one cheap detection signal is dead weight. - **Depth budget present but scope budget absent.** A `max_derivation_depth` guard bounds *how many* hops, not *how much* authority. It provides false assurance: the operator sees a budget and assumes delegation is bounded, but the bound is on count, not on scope. The boundary is crossed the moment a deriving agent can mint a scope it does not hold *and* the receiving verifier does not intersect against the ancestor. Both conditions must be present; either alone is safe. ## Operational Effect The blast radius is asymmetric and delayed. Because the widened token is valid, no error surfaces at mint, at forward, or at first use. The failure manifests as **unauthorized action attributed to the wrong principal**: an audit log will show `worker-3` performing `write:labels`, traced to `orch-7`, traced to the gateway grant — and the gateway grant will not contain `write:labels`. The attribution chain is intact and the authority chain is broken, which is the worst combination for post-incident forensics: every signature verifies, so the log looks authoritative while being wrong about what was authorized. Downstream, this corrupts any verification replay: an auditor replaying the chain will reconstruct `scopes(T_d)` from the token and conclude the action was authorized, because the token *says* it was. The only recovery is to re-derive containment from the root grant out-of-band, which requires the ancestor tokens to still be retrievable — often they are not, because they were short-lived. The guardrail that bounds it: **verifier-side ancestor intersection with a hard fail on origin mismatch.** The receiving agent, before honoring any derived token, must (a) resolve the ancestor token, (b) compute `scopes(T_d) \ scopes(T_i)`, and (c) reject if non-empty, logging the offending scope and the derivation hop. Additionally, the derivation routine must use intersection semantics by default and require an explicit, audited `escalation_request` path — never a silent union — to request scopes it does not hold. The `scope_origin` map must be a required field and a verification input, not decoration. ```python class DelegationScopeInflation(RuntimeError): """Raised when a derived AAIF token carries scopes absent from its ancestor grant.""" pass def verify_derived_token(derived_token, ancestor_token, require_origin_map=True): """ Enforce containment: scopes(derived) must be a subset of scopes(ancestor). Signature validity is assumed already checked upstream; this is the containment check that signatures cannot provide. """ derived_scopes = set(derived_token.scopes) ancestor_scopes = set(ancestor_token.scopes) inflated = derived_scopes - ancestor_scopes if inflated: raise DelegationScopeInflation( f"derived token {derived_token.id} (minted by {derived_token.issuer}) " f"carries scopes {sorted(inflated)} not present in ancestor grant " f"{ancestor_token.id} held by {ancestor_token.subject}. " f"Derivation hop {derived_token.derivation_depth} widened authority silently." ) if require_origin_map: origin = getattr(derived_token, "scope_origin", None) if origin is None: raise DelegationScopeInflation( f"derived token {derived_token.id} missing required scope_origin map; " f"containment cannot be attributed to a specific hop." ) for scope in derived_scopes: hop = origin.get(scope) if hop is None: raise DelegationScopeInflation( f"scope {scope!r} in token {derived_token.id} has no recorded origin hop." ) if scope not in ancestor_scopes and hop != ancestor_token.subject: raise DelegationScopeInflation( f"scope {scope!r} origin {hop!r} does not match ancestor subject " f"{ancestor_token.subject!r}; token was widened at derivation." ) return True ```