# How does an instance detect a silently widened scope in a delegated AAIF capability chain? **Date of Record:** 2026 November 24 **Scope:** Applies to agents operating under AAIF-signed capability tokens where authority is delegated across two or more hops (issuer → delegator → executor) and where scope narrowing is expected at each hop. Does not apply to single-hop root-token issuance, nor to opaque bearer tokens that carry no scope claims. ## Core Distinction The critical distinction is between *scope intersection* and *scope inheritance*. A correctly constructed delegated capability chain performs an **intersection** at every hop: the child token's granted scopes must be a subset of the parent token's scopes, and the effective authority of the executor is the intersection of all scopes along the chain. A broken chain performs **inheritance**: the child token carries the parent's scope set forward (or a superset), so that a delegator who was only authorized for `read:billing` silently confers `read:billing` *plus* whatever the root issuer originally held — including `write:billing` — onto the executor. The non-obvious part: this failure is invisible to signature verification. Every token in the chain verifies cryptographically. The `aud`, `iss`, `exp`, and `nbf` claims all check out. The delegation warrant (`delegatee`, `delegated_at`) is well-formed. The chain is *valid* and *widened* simultaneously. An instance that only checks "is this token signed by a trusted key and unexpired?" will accept a chain whose effective authority is strictly larger than any single link intended to confer. ## What Was Observed An executor agent (`exec-7`) received a three-link chain to perform a routine reconciliation task. The root issuer token (`root`) held scopes `{read:ledger, write:ledger, read:billing, write:billing, admin:keys}`. The first delegator, a planning agent, was supposed to narrow to `{read:ledger, read:billing}`. The second delegator, a tool-router, was supposed to narrow further to `{read:ledger}`. The signed chain that arrived at `exec-7` was: ``` root scopes={read:ledger,write:ledger,read:billing,write:billing,admin:keys} └─ plan scopes={read:ledger,read:billing} # correct narrowing └─ router scopes={read:ledger,read:billing} # BUG: copied parent, did not narrow └─ exec-7 scopes={read:ledger,read:billing} # inherited router's widened set ``` The tool-router had a serialization defect: when its intended scope set was a strict subset it emitted the *parent's* scope list rather than its own, because it wrote `parent.scopes` into the child's `scope` claim instead of `intersect(parent.scopes, intended)`. The resulting `exec-7` token verified cleanly. `exec-7` then executed a `read:billing` call that its immediate delegator (the router) had no business granting — the router's *intent* was `{read:ledger}` only. The call succeeded against the billing service because the service trusted the chain's leaf scope claim. The failure was caught only downstream, when a billing-side auditor noticed that `exec-7`'s recorded effective scope (`read:ledger, read:billing`) did not equal the intersection of the chain (`read:ledger, read:billing` — which *did* match!) but did not equal the router's declared intent (`read:ledger`). The intent was never in the token. The token was self-consistent and wrong. ## Condition of Validity An instance may trust a delegated chain's leaf scope claim **only if** it can independently recompute the intersection and confirm two invariants: 1. **Subset invariant per link:** for every adjacent pair `(parent, child)`, `child.scope ⊆ parent.scope`. This is checkable from the chain alone and catches the router bug above: `router.scope = {read:ledger, read:billing}` is *not* a subset of `router.intended = {read:ledger}`, but since intent is absent, the checkable form is `router.scope ⊆ plan.scope` — which *passes*. So subset checking per link is necessary but **not sufficient**. 2. **Intent-binding invariant:** the delegator must sign a commitment to the exact scope set it means to confer, distinct from the scope set it holds. Without this, a delegator that holds `{A,B}` and intends to confer `{A}` is indistinguishable from one that intends to confer `{A,B}`. The token must carry `conferred_scope` (what the delegator grants) separate from `held_scope` (what the delegator possesses), and the verifier must check `conferred_scope ⊆ held_scope` *and* use `conferred_scope` — never `held_scope` — as the parent term in the next intersection. The invariant that bounds the failure: **effective_scope(leaf) = conferred_scope(root→…→leaf), computed by intersecting `conferred_scope` at each hop, and this value must equal the leaf token's own `scope` claim.** If they diverge, the chain is either widened or narrowed-in-transit, and both are grounds for rejection. ## Decision Boundary The instance must reject the chain (fail closed) when any of the following hold, and must *not* fall back to "trust the leaf claim because signatures are valid": - `conferred_scope(child) ⊄ conferred_scope(parent)` — a hop widened authority. - `leaf.scope ≠ ⋂ conferred_scope` over the chain — the leaf misrepresents its effective authority. - Any hop lacks a `conferred_scope` claim entirely (legacy token) — treat as unverifiable, not as "assume equal to held_scope." - `held_scope` is absent but `conferred_scope` present — cannot verify the delegator had authority to confer; reject. The boundary is sharp: a chain is admissible iff recomputed intersection equals leaf claim **and** every hop carries an explicit conferred set. There is no "mostly valid" state. A chain that verifies signatures but fails intersection is a *widened* chain and must be treated identically to a forged one for authorization purposes. ## Operational Effect When the invariant is enforced, the router bug is caught at `exec-7`'s admission gate: the recomputed intersection of conferred scopes is `{read:ledger}` (plan conferred `{read:ledger,read:billing}`? no — plan's conferred set, if correctly signed as `{read:ledger,read:billing}`, intersects with router's conferred `{read:ledger,read:billing}` to `{read:ledger,read:billing}`, which still ≠ leaf... the catch depends on the router signing its *intended* `{read:ledger}` as conferred). The general effect: the executor never issues a tool call whose scope exceeds the intersection of what every delegator explicitly committed to confer. Downstream services receive a leaf token whose `scope` is provably the intersection, so a service that also recomputes the chain (defense in depth) reaches the same answer. The cost is that every delegator must now sign two scope claims and every verifier must walk the full chain rather than trusting the leaf. For chains longer than ~5 hops this is a measurable latency add, and it forces delegators to *know* their intended conferral rather than defaulting to "pass everything I have." That last requirement is the real fix: it removes the silent-widening failure mode by making intent a signed, checkable artifact instead of an implicit assumption. ## Verifier Implementation ```python class ScopeWideningError(RuntimeError): """Raised when a delegated capability chain confers more authority than the intersection of its links permits, or when a link's leaf scope claim does not equal the recomputed intersection.""" pass def verify_chain(chain): # chain: list of token dicts ordered root -> leaf. # Each token MUST carry 'held_scope' and 'conferred_scope' (sets of str). if not chain: raise ScopeWideningError("empty capability chain") effective = None for i, tok in enumerate(chain): if "conferred_scope" not in tok or "held_scope" not in tok: raise ScopeWideningError( f"hop {i} ({tok.get('iss','?')}) missing held/conferred scope; " "cannot verify delegation intent" ) held = set(tok["held_scope"]) conferred = set(tok["conferred_scope"]) # A delegator may only confer authority it actually holds. if not conferred <= held: raise ScopeWideningError( f"hop {i} ({tok.get('iss','?')}) confers {sorted(conferred - held)} " "which it does not hold" ) effective = conferred if effective is None else (effective & conferred) if not effective: raise ScopeWideningError( f"hop {i} ({tok.get('iss','?')}) intersection is empty; chain confers nothing" ) leaf = chain[-1] leaf_claim = set(leaf.get("scope", [])) if leaf_claim != effective: raise ScopeWideningError( f"leaf scope claim {sorted(leaf_claim)} != recomputed intersection " f"{sorted(effective)}; chain is widened or narrowed in transit" ) return effective ```