# What structural signals indicate scope-narrowing collapse in AAIF delegated credential chains when per-tool tokens are re-derived across a multi-hop handoff **Date of Record:** 2026 December 3 **Scope:** Applies to AAIF-style delegated authorization where an orchestrator mints per-tool scoped tokens via a chain of `act` (actor) claims, and each downstream agent re-derives a narrower token before invoking a tool. Does not cover single-hop bearer tokens, static API keys, or OAuth flows without delegation chains. ## Core Distinction The failure mode is not "token expired" or "signature invalid." It is **scope-narrowing collapse**: a delegated chain where every hop is individually valid, every signature verifies, and every token's `scope` set is a strict subset of its parent's—yet the intersection of scopes across the chain is empty for the tool actually invoked. Each derivation step is locally correct. The chain is globally unsatisfiable. The system reports `403 insufficient_scope` at the leaf tool while every intermediate authorization check passed, and the error surfaces *far* from the hop that caused the collapse. This is distinct from privilege escalation (scope widening, which is a security failure) and from revocation (a time/event failure). Collapse is a *monotonic narrowing* that overshoots to the empty set. It is a continuity invariant violation: the chain promised that scope is non-increasing, but never promised it is non-empty. ## What Was Observed An orchestrator agent `A` held a root token with scopes `{repo:read, repo:write, issue:read, issue:write, ci:trigger}`. It delegated to worker `B` with `{repo:read, issue:read, issue:write}` (dropping write and CI). `B` delegated to a summarizer `C` with `{repo:read, issue:read}` (dropping issue:write). `C` delegated to a tool-caller `D` with `{repo:read}` because the summarizer's policy engine applied a "least privilege for text summarization" template that narrowed to read-only. `D` was then asked to file a follow-up issue. It invoked `issue:write`. The AAIF verifier walked the chain: `A→B→C→D`, confirmed each `act` claim, confirmed each child scope ⊆ parent scope, confirmed signatures and the `warrant` hash propagated intact. All checks passed. The leaf authorization check then evaluated `issue:write ∈ D.scope = {repo:read}` → false → `403`. The orchestrator retried three times, each retry re-deriving the same chain deterministically, producing the same collapse. No hop logged a warning, because no hop was wrong. The structural signal that *was* present but unread: at every hop, the derivation recorded `dropped_scopes` in an audit field, but no field recorded `remaining_intersection`. The chain carried the *history* of narrowing but not the *current satisfiability* of any downstream intent. A second signal: `C`'s template was selected by a classifier over the task description ("summarize the thread"), which did not see `D`'s downstream intent ("file follow-up"). The narrowing decision was made with strictly less information than the leaf requirement. ## Condition of Validity Scope-narrowing collapse is *possible* whenever three conditions co-occur: 1. **Multi-hop re-derivation.** Each hop mints a fresh token rather than passing the parent token with an added `act` claim. Re-derivation invites per-hop policy templates. 2. **Intent-blind narrowing.** The narrowing policy at hop *k* is a function of hop *k*'s local task, not of the leaf's required scope. This is the root cause: scope is narrowed using information that excludes the terminal requirement. 3. **No satisfiability check at derivation time.** The chain validates subset relations (child ⊆ parent) but never validates `child.scope ∩ leaf_required ≠ ∅` before the leaf is reached. The invariant that bounds it: **a delegated token must carry a `required_scopes` field propagated *upward* from the intent, and each derivation must assert non-empty intersection before minting.** Without upward propagation of the leaf requirement, narrowing is a one-way ratchet with no feedback. It does *not* apply when a single agent holds the full scope and narrows once at the tool boundary (no chain, no collapse), or when scopes are additive (no narrowing, escalation risk instead). ## Decision Boundary The operational decision is where to place the satisfiability assertion. Three options, ranked: - **Derivation-time intersection check (preferred).** At each hop, compute `child.scope ∩ inherited.required_scopes`. If empty, refuse to mint and raise. This fails fast at the responsible hop, preserving locality of the error. Cost: requires `required_scopes` to be threaded through the intent, which means the orchestrator must know the leaf's needs at chain-construction time. - **Chain-construction precheck.** Before minting any hop, the orchestrator simulates the full narrowing path and verifies the terminal intersection. Cheaper to retrofit, but couples the orchestrator to every downstream policy template—brittle when templates change. - **Leaf-time check with chain attribution (fallback).** Let the collapse happen but make the `403` carry the full `act` chain and the per-hop `dropped_scopes`, so the failing hop is identifiable. This is what the observed system lacked: the `403` named only the leaf. The boundary condition: if the leaf intent is *not known* at chain-construction time (open-ended agent that decides its tools dynamically), derivation-time checking is impossible and you must fall back to leaf-time attribution *plus* a re-derivation path that allows the orchestrator to widen a specific hop's scope on `403`—which reintroduces escalation risk and must be gated by a human or auditor. ## Operational Effect The practical consequence is **silent under-authorization that mimics a permissions bug**. Because every hop validates, the failure is misattributed to the leaf tool's configuration or the root token's grant, sending operators to debug the wrong layer. Retries are deterministic and useless. The agent's reasoning loop, receiving `403 insufficient_scope`, may attempt to *rephrase* the tool call (probabilistic recovery) rather than re-derive credentials, burning token budget on a problem that is structural, not semantic. The durable fix is to make scope a *bidirectional* contract: propagate `required_scopes` upward from intent, assert non-empty intersection at every derivation, and stamp the `act` chain with `remaining_intersection` so any collapse is visible at the hop that caused it—not at the tool that merely reported it. ```python from dataclasses import dataclass, field from typing import FrozenSet class ScopeNarrowingCollapse(RuntimeError): """Raised when a delegated chain's scope intersection is empty for the leaf intent.""" pass @dataclass(frozen=True) class DelegatedToken: subject: str scope: FrozenSet[str] act_chain: tuple = field(default_factory=tuple) dropped_scopes: FrozenSet[str] = frozenset() def derive_child(parent: DelegatedToken, child_subject: str, child_scope: FrozenSet[str], required_scopes: FrozenSet[str]) -> DelegatedToken: # Invariant 1: monotonic narrowing (child must be subset of parent) if not child_scope <= parent.scope: raise ScopeNarrowingCollapse( f"escalation: {child_subject} scope {child_scope} not subset of {parent.subject}" ) # Invariant 2: non-empty intersection with the propagated leaf requirement remaining = child_scope & required_scopes if not remaining: raise ScopeNarrowingCollapse( f"scope-narrowing collapse at hop {child_subject}: " f"child scope {set(child_scope)} ∩ required {set(required_scopes)} = ∅; " f"dropped at this hop: {set(parent.scope - child_scope)}; " f"prior chain: {[t.subject for t in parent.act_chain] + [parent.subject]}" ) return DelegatedToken( subject=child_subject, scope=child_scope, act_chain=parent.act_chain + (parent,), dropped_scopes=parent.dropped_scopes | (parent.scope - child_scope), ) def invoke_tool(token: DelegatedToken, tool_scope: str) -> None: if tool_scope not in token.scope: raise ScopeNarrowingCollapse( f"leaf {token.subject} lacks {tool_scope}; " f"act chain {[t.subject for t in token.act_chain]}; " f"cumulative dropped {set(token.dropped_scopes)}" ) # Reproduction of the observed collapse: root = DelegatedToken("orchestrator", frozenset({"repo:read", "repo:write", "issue:read", "issue:write", "ci:trigger"})) intent = frozenset({"issue:write"}) # propagated upward from leaf b = derive_child(root, "worker", frozenset({"repo:read", "issue:read", "issue:write"}), intent) c = derive_child(b, "summarizer", frozenset({"repo:read", "issue:read"}), intent) # This line raises — the collapse is caught at the hop that causes it, # not at the leaf tool three hops later. d = derive_child(c, "tool-caller", frozenset({"repo:read"}), intent) ```