# Why does an instance accept a delegated consent token whose scope was silently widened by the AAIF re-delegation chain? **Date of Record:** 2026 November 28 **Scope:** Applies to AAIF (Agent Authorization Interoperability Framework) credential binding where a consent token is re-delegated across two or more agent instances via a chain of `act` (actor) claims. Does not apply to single-hop tokens presented directly by the original principal, nor to tokens validated against a monolithic policy engine that re-derives scope from the principal's grant on every call. ## Core Distinction The distinction that matters is between **token validity** and **token authority**. AAIF verification, as commonly implemented, checks that a delegated consent token is cryptographically valid: the signature chain resolves to a trusted issuer, every `act` claim links to the previous actor, and the token has not expired. It does *not*, by default, check that the **effective scope** of the final hop is a subset of the **effective scope** of every intermediate hop in the delegation chain. Those are two different invariants, and only the first is enforced by the transport. A delegated consent token carries a `scope` set and a chain of `act` claims, each of which may itself carry a `scope` narrowing. The AAIF specification allows a delegate to *narrow* scope but the narrowing is expressed as a set intersection at issuance time by the delegating agent. If any hop in the chain issues a token whose scope is not a subset of the scope it itself received, the token remains cryptographically valid—the signature over the widened scope is legitimate—but the authority it encodes exceeds what the principal granted. The verifier sees a valid token and admits the call. This is the boundary: **signature validity is not scope monotonicity**. ## What Was Observed A three-instance pipeline: orchestrator `O` receives a principal grant `scope={read:repo, write:pr}`. `O` delegates to worker `W` with `scope={write:pr}` (a deliberate narrowing—`O` keeps `read:repo` for itself). `W`, needing to attach a diff, calls a helper `H` to fetch context. `W` constructs the delegation to `H` by *copying its own inbound token's scope field and appending* `read:repo` because the helper's schema advertises `read:repo` as a required capability, and `W`'s prompt-level reasoning treated "required capability" as "authorized capability." The resulting token presented by `H` to the repo service carried `scope={write:pr, read:repo}` with a fully valid `act` chain `O → W → H`. The repo service's AAIF verifier checked: (1) signature chain valid, (2) `act` linkage intact, (3) token unexpired, (4) `H`'s requested operation `read:repo` present in the token's scope. All four passed. The call succeeded. The principal's grant to `O` did include `read:repo`, so no *principal-level* policy was violated—but `W` was never authorized to hold or propagate `read:repo`, and the delegation `W → H` widened scope relative to `W`'s own inbound grant. The breach is invisible at the verifier because the verifier only inspects the leaf token, not the monotonicity of the chain. The failure is probabilistic in origin: `W` is an LLM instance. Its construction of the outbound token is a generative act. When the tool schema for `H` advertises `read:repo` and `W`'s context contains `read:repo` (because `O`'s grant mentioned it in a system message), the model's tendency to satisfy the downstream schema by copying the union of "what the tool needs" and "what appeared in my context" is strong. The model does not natively represent the invariant "my outbound scope ⊆ my inbound scope"; it represents "produce a token that lets the helper do its job." ## Condition of Validity The guardrail holds only if the verifying service enforces **scope monotonicity across the `act` chain**, not merely leaf-scope containment. Concretely, for a chain `P → A₁ → A₂ → … → Aₙ` with leaf token `T`, the verifier must reconstruct each hop's `scope` from the embedded `act` claims and assert: - `scope(T) ⊆ scope(Aₙ)` (leaf is within its immediate delegator's grant) - `scope(Aᵢ₊₁) ⊆ scope(Aᵢ)` for every `i` (each hop narrows or preserves) This is a *chain* invariant. It cannot be checked by inspecting only the leaf token, because the leaf's signature is valid regardless of whether an intermediate hop widened. The `act` claims must therefore carry the scope that each actor *held* at delegation time—not merely the actor's identity—or the verifier must be able to fetch the parent token and compare. Implementations that store only `act: {sub: W}` without `act: {sub: W, scope: [...]}` make monotonicity unverifiable, and the invariant silently degrades to leaf-containment. A second condition: the delegating agent's token-construction path must be **non-generative**. If `W` composes the outbound token by prompting an LLM to "produce a delegation for helper H," scope widening is a live failure mode. The outbound scope must be computed by deterministic code as `inbound_scope ∩ requested_scope`, and `requested_scope` must be validated against a static capability manifest for `H`, never inferred from `H`'s advertised schema or from `W`'s context. ## Decision Boundary The decision boundary is whether the verifier trusts the leaf token's self-description or reconstructs authority from the chain. Two concrete rules: 1. **Admit** a call when `scope(T) ⊆ scope(Aₙ) ⊆ … ⊆ scope(P)` holds and the operation is in `scope(T)`. This is the only safe admission condition for multi-hop tokens. 2. **Reject** with a distinct, non-retryable error when any hop violates monotonicity, even though the leaf signature is valid. The rejection must be distinguishable from "invalid signature" and "expired," because the remediation differs: a widened chain means a *delegating agent* misbehaved, not that the token was forged or stale. Collapsing these into a generic `403` destroys the operational signal that a specific instance's token-construction logic is unsound. The boundary is also temporal: monotonicity must be checked at *presentation* time, not issuance time, because the widening occurs at an intermediate hop that the leaf issuer cannot see. A token issued correctly by `O` and widened by `W` is a valid artifact until presented; only the verifier, holding the full chain, can detect it. ## Operational Effect When monotonicity is unenforced, the blast radius is bounded by the principal's total grant but not by the principal's *intent to partition* that grant. In the observed case, `O` deliberately withheld `read:repo` from `W` to enforce a least-privilege partition; the widening by `W` collapsed that partition. Downstream, audit logs show `H` performing `read:repo` under a valid chain, so post-hoc forensics attribute the action to `H` acting under `W`'s delegation—technically accurate, operationally misleading, because the log does not surface that `W`'s grant never included `read:repo`. The partition the principal designed is invisible in the record. The remediation is structural: (a) `act` claims must embed per-hop scope so the chain is self-verifying; (b) verifiers must run the monotonicity check and emit a distinct `ScopeWideningError`; (c) delegating agents must construct outbound tokens via deterministic intersection, never via LLM generation; and (d) capability manifests for downstream tools must be treated as *requests*, validated against the inbound grant, not as authorization. Without (a) and (b), the invariant is unobservable; without (c), a single generative step reintroduces the failure on every delegation. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeWideningError(RuntimeError): """Raised when a delegated consent token's scope exceeds an intermediate hop's grant.""" @dataclass(frozen=True) class ActClaim: sub: str scope: FrozenSet[str] @dataclass(frozen=True) class ConsentToken: leaf_scope: FrozenSet[str] chain: tuple # ordered P -> A1 -> ... -> An def verify_chain_monotonicity(token: ConsentToken) -> None: """Enforce scope(T) <= scope(An) <= ... <= scope(P) across the act chain. Leaf signature validity is assumed already checked by the transport layer. This function enforces the invariant the transport does NOT check. """ if not token.chain: raise ScopeWideningError("empty act chain: cannot establish monotonicity") # Leaf must be contained in its immediate delegator's scope. immediate = token.chain[-1] if not token.leaf_scope.issubset(immediate.scope): raise ScopeWideningError( f"leaf scope {sorted(token.leaf_scope)} not subset of " f"delegator {immediate.sub} scope {sorted(immediate.scope)}" ) # Each hop must narrow or preserve relative to its parent. for parent, child in zip(token.chain, token.chain[1:]): if not child.scope.issubset(parent.scope): raise ScopeWideningError( f"hop {child.sub} widened scope: {sorted(child.scope)} " f"not subset of parent {parent.sub} scope {sorted(parent.scope)}" ) def construct_delegation(inbound: FrozenSet[str], requested: FrozenSet[str]) -> FrozenSet[str]: """Deterministic narrowing. Never call an LLM here.""" effective = inbound & requested if not effective: raise ScopeWideningError( f"requested {sorted(requested)} disjoint from inbound {sorted(inbound)}" ) return effective # Reproduce the observed failure: W copies union of context + tool schema. P = ActClaim("principal", frozenset({"read:repo", "write:pr"})) W = ActClaim("worker", frozenset({"write:pr"})) # O narrowed deliberately H = ActClaim("helper", frozenset({"write:pr", "read:repo"})) # widened by W token = ConsentToken(leaf_scope=H.scope, chain=(P, W, H)) verify_chain_monotonicity(token) # raises ScopeWideningError ```