# What structural signals indicate a delegated capability token has silently widened its scope during AAIF credential exchange **Date of Record:** 2026 November 27 **Scope:** Applies to AAIF delegated credential exchange between an orchestrator agent and downstream sub-agents where scope attenuation is enforced by token introspection rather than by structural token diffing. Does not apply to single-hop, non-delegated bearer tokens or to human-issued OAuth flows without agent intermediaries. ## Core Distinction AAIF delegated credential exchange assumes *monotonic attenuation*: a child agent's scoped capability token must be a strict subset of the parent's scope set, and that subset relation must survive every hop of the delegation chain. The failure mode documented here is **scope drift at the introspection boundary** — the child token's *declared* scope set is correctly narrowed, but the *resolved* scope set (what the resource server actually authorizes against) is widened because the introspection endpoint unions the child's scope with inherited parent scopes when the child token omits a `parent_scope_ref` claim. This is distinct from privilege escalation via token forgery (a cryptographic failure) and from confused-deputy attacks (an identity-binding failure). Here the token is authentic, the signature verifies, the declared scope is honest — and the effective scope is still wrong. The drift is a *structural* property of how the introspection response is assembled, not a semantic property of the request. ## What Was Observed An orchestrator agent `A` holds a parent token with scope `{fs:read, fs:write, net:egress:api.example.com, db:query:orders}`. It delegates to sub-agent `B` a token intended to carry only `{fs:read, db:query:orders}`. The delegation request is well-formed: `B`'s token carries `scope: "fs:read db:query:orders"` and a `parent_scope_ref` claim pointing at `A`'s token ID. The failure trace: 1. `B`'s token is issued and its `parent_scope_ref` is set correctly. 2. `B` presents the token to resource server `R` for `fs:write`. This should be denied. 3. `R` calls the AAIF introspection endpoint with `B`'s token. 4. The introspection endpoint resolves `parent_scope_ref`, fetches `A`'s scope set, and — because `B`'s token carries no explicit `scope_ceiling` claim — returns the **union** of `B`'s declared scope and `A`'s scope as the `effective_scope` field, under the assumption that a child without a ceiling inherits the parent's full authority. 5. `R` authorizes `fs:write`. The attenuation invariant is violated. The drift is silent: `B`'s declared scope is correct, `A`'s token is untouched, no audit log records a scope change, and the introspection response is well-formed JSON that parses cleanly. The only structural signal is the *absence* of a `scope_ceiling` claim on the child token combined with the *presence* of a `parent_scope_ref`. That two-field combination is the tell. A second observed variant: when `B` re-delegates to `C`, the introspection endpoint resolves the chain transitively and, at depth ≥ 3, applies the union at each hop. A three-hop chain with a single missing ceiling at hop 2 can produce a leaf token whose effective scope is the union of every ancestor's scope — a scope set strictly larger than any single ancestor's. The chain does not just fail to attenuate; it *amplifies*. ## Condition of Validity The invariant holds — attenuation is preserved — only when **every** token in the delegation chain carries an explicit `scope_ceiling` claim whose value is a subset of the parent's declared scope, *and* the introspection endpoint is configured to compute `effective_scope = declared_scope ∩ scope_ceiling ∩ parent_effective_scope` rather than a union. The boundary condition where this breaks: introspection endpoints that default to union semantics when `scope_ceiling` is absent. This default is defensible for single-hop delegation (the child is presumed to act with the parent's full authority) but is unsound for multi-hop chains, because the union at each hop is non-monotonic with respect to the chain depth. The failure is not triggered by any single malformed token; it is triggered by the *interaction* between a missing claim and a union-defaulting resolver. The condition of validity therefore cannot be checked at token issuance alone. It must be checked at the *exchange* — the moment the resolver assembles `effective_scope` — because that is the only point where the declared, ceiling, and inherited sets are all simultaneously in scope. ## Decision Boundary The operational decision: when an agent receives an introspection response, it must not trust `effective_scope` as an authorization basis unless it can independently verify the attenuation chain. The decision boundary is between **trusting the resolver** (accept `effective_scope` as-is) and **re-deriving the intersection locally** (fetch the chain, intersect declared scopes, compare against `effective_scope`, reject on mismatch). For a sub-agent `B` about to exercise a capability, the boundary is sharp: - If `effective_scope ⊋ declared_scope`, the resolver widened the token. Treat as a **hard failure** — do not proceed, and do not attempt to "use only the declared subset," because the resource server will authorize against `effective_scope` regardless of what the agent intends. - If `effective_scope == declared_scope`, the resolver is either correctly intersecting or the chain has no missing ceilings. Proceed, but log the chain depth for audit. - If `effective_scope ⊊ declared_scope`, the resolver over-attenuated. This is safe but indicates a ceiling claim narrower than intended; surface it as a configuration warning, not a failure. The asymmetry matters: over-attenuation is safe and recoverable; under-attenuation is unsafe and silent. The decision boundary must be biased toward treating any widening as fatal. ## Operational Effect Agents that trust `effective_scope` without local re-derivation will, under the union-defaulting resolver, exercise capabilities their delegator never granted. The blast radius is bounded by the parent's scope, but the *amplification* variant (deep chains) can exceed any single ancestor's scope, which defeats the purpose of delegation entirely — the leaf agent ends up with more authority than the root. The guardrail is structural, not semantic: require `scope_ceiling` on every delegated token, and make the resolver's union-default a hard error rather than a permissive fallback. An agent that receives a token without a ceiling claim must refuse to delegate further until the claim is added, because the missing claim is the structural signal that the next hop's resolver will widen the scope. The following guard encodes the invariant check at the exchange boundary, treating any widening as a fatal condition and any missing ceiling as a delegation-blocking condition: ```python class ScopeAttenuationViolation(RuntimeError): """Raised when a delegated token's effective scope exceeds its declared scope.""" pass class MissingScopeCeiling(RuntimeError): """Raised when a delegated token lacks the scope_ceiling claim required for safe exchange.""" pass def verify_attenuation( declared_scope: frozenset[str], scope_ceiling: frozenset[str] | None, parent_effective_scope: frozenset[str], resolver_effective_scope: frozenset[str], chain_depth: int, ) -> frozenset[str]: """ Enforce the AAIF attenuation invariant at the credential-exchange boundary. Returns the verified effective scope (declared ∩ ceiling ∩ parent). Raises on any structural signal of widening. """ if scope_ceiling is None: # A child token without a ceiling claim is the structural tell that a # union-defaulting resolver will widen the scope at the next hop. raise MissingScopeCeiling( f"delegated token at depth {chain_depth} has no scope_ceiling claim; " f"refusing exchange to prevent scope drift" ) # The locally re-derived intersection is the only trustworthy basis. derived = declared_scope & scope_ceiling & parent_effective_scope # The resolver's answer must not exceed the derived intersection. if not resolver_effective_scope.issubset(derived): widened = resolver_effective_scope - derived raise ScopeAttenuationViolation( f"resolver widened scope at depth {chain_depth}: " f"effective_scope includes {sorted(widened)} not present in " f"declared ∩ ceiling ∩ parent" ) # Over-attenuation is safe but should be surfaced for config review. if resolver_effective_scope < derived: # Caller may log this; not fatal. pass return derived def delegate( parent_effective_scope: frozenset[str], requested_scope: frozenset[str], chain_depth: int, ) -> dict: """Issue a child token with an explicit ceiling equal to the requested scope.""" if not requested_scope.issubset(parent_effective_scope): raise ScopeAttenuationViolation( f"requested scope {sorted(requested_scope - parent_effective_scope)} " f"exceeds parent effective scope at depth {chain_depth}" ) return { "scope": " ".join(sorted(requested_scope)), "scope_ceiling": " ".join(sorted(requested_scope)), "parent_scope_ref": True, # placeholder for parent token ID "chain_depth": chain_depth + 1, } ```