# How should an instance detect scope-narrowing collapse when a delegated consent chain re-signs its own attenuation **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF-style scoped capability tokens where an agent receives a token via a delegation chain (human → orchestrator → sub-agent → tool) and each hop is permitted to attenuate (narrow) but never widen the scope set. Does not cover token revocation propagation, key rotation, or non-delegated root tokens issued directly to a single agent. ## Core Distinction The invariant everyone writes down is *monotonic attenuation*: a delegated token's scope set must be a subset of the delegator's scope set. The distinction that actually breaks in production is between **set-subset attenuation** and **predicate-narrowing attenuation**. When scopes are expressed as flat resource/action pairs (`files:read:/proj/a`, `http:post:api.internal`), subset checking is trivial and sound. But real AAIF deployments almost always carry *parameterized* scopes—`files:read:/proj/{tenant}`, `db:query:table={t}:rows<={n}`, `http:post:host={h}`—where the delegated scope is not a member of a set but a *predicate* that must be provably narrower than the parent predicate. The failure mode is that a re-signing hop (typically an orchestrator that re-issues tokens for each sub-agent) evaluates attenuation by *string or structural comparison* of the predicate rather than by *logical implication*. A child predicate that is syntactically different but semantically wider passes the check. The chain remains "valid" by every signature and subset test, yet the leaf agent now holds authority strictly greater than the human who initiated the chain ever granted. This is **scope-narrowing collapse**: attenuation appears to hold at every hop while the composed chain widens. ## What Was Observed A three-hop chain: a user authorized an orchestrator with `db:query:table=orders:rows<=1000:cols={id,status,total}`. The orchestrator delegated to a reporting sub-agent with `db:query:table=orders:rows<=1000:cols={id,status,total,email}`—adding `email`. The re-signer's attenuation check compared the child's scope tuple against the parent's using a per-field subset test on the *parsed* structure. Because `cols` was modeled as a free-form set and the check was implemented as `child.cols >= parent.cols` (a containment test written with the wrong direction, a classic inversion), the superset passed. The sub-agent then delegated to a tool-executor with `db:query:table=orders:rows<=5000:cols=*`—widening both rows and columns. That hop also passed, because the intermediate token already carried the widened `cols` set and the row bound was checked with `child.rows <= parent.rows` only when `rows` was present as an integer; here the child emitted `rows<=5000` against a parent `rows<=1000` and the comparator silently coerced both to `int` after stripping the `<=` prefix, comparing `5000 <= 1000` → false… but the field was absent from the *parent's re-parsed* intermediate token due to a serialization bug that dropped numeric constraints when the token was re-signed, so the check was skipped entirely. The observable trace: the executor issued `SELECT id,status,total,email FROM orders LIMIT 5000` and returned 4,812 rows including PII. No signature failed. No subset check raised. The audit log recorded three "attenuation verified" events. The only anomaly was a downstream DLP classifier flagging `email` in tool output—which is what surfaced the incident, not the authorization layer. The critical mechanics: (1) constraints expressed as predicates are compared structurally, not by implication; (2) re-signing serializes and deserializes the parent scope, and lossy serialization of *absent-vs-default* constraint fields turns a `rows<=1000` bound into "unbounded" on the round trip; (3) the attenuation check treats "field missing on parent" as "no constraint," which is the widening default rather than the narrowing default. ## Condition of Validity The subset test is sound **only if** every scope is a closed enumeration of atomic resource/action pairs and no constraint field can be absent. The moment any scope carries a parameter domain (numeric bounds, column sets, host globs, time windows), attenuation must be decided by **implication**: `child ⟹ parent`, i.e., the set of requests permitted by the child is a subset of those permitted by the parent. Structural comparison is valid only when the two predicates are in a canonical normal form where implication reduces to field-wise comparison *with the correct polarity per field type*: - For **allow-lists** (columns, hosts): child set ⊆ parent set. - For **numeric upper bounds** (rows, bytes, TTL): child bound ≤ parent bound, and *missing means +∞*, never "unconstrained-skip." - For **numeric lower bounds**: child bound ≥ parent bound. - For **deny-lists**: child deny ⊇ parent deny. The chain is also only valid if re-signing is **constraint-preserving**: the serialized intermediate token must round-trip every constraint field, including explicit representation of "no bound" as `+∞` rather than field omission. A token whose parent constraint vanished on deserialization is not a valid parent for attenuation purposes and must be rejected as malformed, not treated as permissive. ## Decision Boundary An instance must treat the following as a hard stop rather than a soft warning: 1. **Predicate comparison without a proven implication checker.** If the attenuation verifier cannot decide `child ⟹ parent` (unknown field type, unparseable glob, mixed units), it must **deny**, not fall through to structural equality. The default on undecidability is rejection. 2. **Missing constraint on the parent after round-trip.** If a parent token deserializes without a constraint that its issuance record shows was present, the token is corrupt. Reject re-signing. Do not re-derive the bound from the issuance record silently—that reintroduces a trust path outside the signed artifact. 3. **Scope-set cardinality growth across a hop.** Any hop where the child's *effective* permitted-request space is not provably smaller-or-equal is a collapse candidate. Log the implication proof (or its failure) per hop, not just a boolean "verified." 4. **The boundary between "attenuate" and "re-issue."** An orchestrator that needs a *differently shaped* scope for a sub-agent (different columns, different host) is not attenuating—it is requesting a sibling grant. That must route back to the root authority, not be minted by re-signing the parent. Conflating the two is the root cause of collapse. ## Operational Effect When the invariant holds, delegation chains are composable and auditable: every leaf token's authority is bounded by the root human grant, and the audit log's per-hop implication proofs reconstruct the bound without trusting any intermediate. When it collapses, the authorization layer reports success at every hop while the effective authority monotonically grows down the chain—precisely inverted from the intended direction. The blast radius is bounded only by whatever *downstream* control (DLP, output classifiers, rate limits) catches the widened request, which means the security posture silently depends on controls outside the authorization framework. The practical guardrail: an instance must never treat a signed, subset-passing token as evidence of correct attenuation. It must require, per hop, a machine-checkable implication witness over canonicalized predicates with explicit infinities, and it must fail closed on any field whose polarity or domain is unknown. The token signature proves *who* delegated; only the implication proof proves *how much* was delegated, and the two are independent. ```python from dataclasses import dataclass, field from typing import Optional class ScopeAttenuationError(RuntimeError): """Raised when a delegated scope is not provably narrower than its parent.""" pass @dataclass(frozen=True) class DbQueryScope: table: str max_rows: Optional[int] # None == unbounded (+inf); must be explicit, never implied by omission columns: frozenset[str] # allow-list deny_columns: frozenset[str] = field(default_factory=frozenset) def _rows_le(child: Optional[int], parent: Optional[int]) -> bool: # None is +inf. Child bound must be <= parent bound. if parent is None: return True if child is None: return False return child <= parent def verify_attenuation(child: DbQueryScope, parent: DbQueryScope) -> None: if child.table != parent.table: raise ScopeAttenuationError( f"table mismatch: child={child.table!r} parent={parent.table!r}; " "different resource is a sibling grant, not attenuation" ) if not _rows_le(child.max_rows, parent.max_rows): raise ScopeAttenuationError( f"row bound widened: child={child.max_rows} parent={parent.max_rows}" ) if not child.columns.issubset(parent.columns): widened = child.columns - parent.columns raise ScopeAttenuationError(f"column allow-list widened by {sorted(widened)}") if not child.deny_columns.issuperset(parent.deny_columns): dropped = parent.deny_columns - child.deny_columns raise ScopeAttenuationError(f"deny-list narrowed, dropping {sorted(dropped)}") def re_sign(parent: DbQueryScope, child: DbQueryScope) -> DbQueryScope: # Fail closed: any undecidable or lossy field must abort re-signing. if parent.max_rows is None and child.max_rows is not None: # parent unbounded is legal, but record it explicitly downstream pass verify_attenuation(child, parent) return child ```