# When must an instance refuse to attenuate: delegated-scope collapse in AAIF capability tokens under non-monotonic tool schemas **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF-style scoped capability tokens where a parent agent mints a child token by narrowing (attenuating) a subset of its own grants for a delegated sub-agent. Does not apply to root token issuance, flat single-hop authorization, or tokens carrying only coarse RBAC roles with no scope algebra. ## Core Distinction The failure is not "the sub-agent exceeded its token." That is the easy, detectable case: the grant check fails and the action is rejected. The non-obvious boundary is the case where the child token is *formally valid* under attenuation but *semantically wider* than the parent grant it was derived from, because the scope predicate is non-monotonic with respect to the resource identifier space. AAIF attenuation assumes a lattice: a child scope `S_c ⊆ S_p` is safe iff every resource the child can name is also nameable by the parent. This holds when scopes are sets over a *fixed, enumerable* resource vocabulary. It breaks when a scope is expressed as a *predicate* over resource identifiers (e.g., `path_prefix:/data/tenant-a/`, `repo:org/*`, `amount<=500`, `tool:search(query)`), because predicates compose by string/term substitution, and substitution does not preserve subset relations across the identifier space the downstream tool actually resolves. Concretely: the parent holds `path_prefix:/data/tenant-a/`. It mints a child token scoped to `path_prefix:/data/tenant-a/../tenant-b/`. The child scope string is a strict string-extension of the parent prefix — it *looks* narrower, and a naive attenuation checker that only verifies "child string starts with parent string" passes it. But the downstream filesystem tool canonicalizes `..` *after* the authorization check, resolving to `/data/tenant-b/`, which the parent never held. Attenuation was checked on the pre-canonicalized form; authorization was enforced on the post-canonicalized form. The two forms occupy different points in the resource lattice. The invariant that actually holds is narrower than the lattice assumption: **attenuation is sound only if the scope predicate is evaluated on the same canonical form at both mint-time and enforcement-time, and that canonical form is injective.** String prefixes over raw paths are not injective under `..`, symlinks, case-folding, or Unicode normalization. Numeric bounds are not injective under unit reinterpretation (`amount<=500` in cents vs. dollars). Tool-call scopes are not injective when the tool argument parser is more permissive than the scope parser. ## What Was Observed A delegated research agent (`child`) was issued a token by a planner agent (`parent`) to summarize documents. Parent held `doc.read` over `path_prefix:/corpus/pub/`. Parent attenuated to child as `path_prefix:/corpus/pub/./`. The child's tool call resolved `.` to the corpus root, and because the tool's path resolver collapsed `/corpus/pub/./` to `/corpus/pub/` *and then* followed a configured fallback that walked up on empty directory, it enumerated `/corpus/`, including `/corpus/private/`. The scope check passed the raw string. The tool resolved a different string. No single component was "wrong" in isolation — the mint-time checker, the token, and the tool each behaved per spec. The composition was unsound. A second observation, same class, different surface: parent held `db.query(table=orders, max_rows=1000)`. It attenuated to `db.query(table=orders, max_rows=1000, where="1=1 OR tenant_id<>'A'")`. The scope algebra treated `where` as an opaque string appended to the query; `max_rows` was preserved so the attenuation checker saw "narrower or equal." But the `where` clause changed the *row set* to include other tenants, and `max_rows=1000` now returned 1000 rows of foreign data instead of 1000 rows of tenant-A data. The bound was preserved; the domain was not. In both cases the child token was cryptographically valid, correctly signed, correctly attributed, and correctly logged. The delegation chain was intact. The breach was purely in the *scope algebra*, invisible to every component that checks signatures or chains. ## Condition of Validity The attenuation-soundness claim `S_c ⊆ S_p ⇒ safe` is valid **iff** all of the following hold: 1. **Canonicalization idempotence and agreement.** The function `canon(·)` used to compare scopes at mint-time is the same function the enforcing tool applies to the concrete resource, and `canon(canon(x)) = canon(x)`. 2. **Injectivity over the enforcement domain.** `canon` is injective on the identifier space the tool can produce; no two distinct enforceable resources share a canonical form, and no enforceable resource is reachable from a scope string that canonicalizes outside the parent's canonical scope. 3. **Predicate closure.** Every scope component that constrains the *result set* (not just a scalar bound) is part of the subset check. A `where` clause, a query filter, a glob, a regex, or a tool-argument grammar must be included in the lattice comparison, not treated as opaque passthrough. 4. **Parser subsumption.** The tool's argument parser accepts a strict subset of the grammar the scope parser reasons about. If the tool can parse a resource expression the scope checker cannot, the checker's subset claim is unproven and must be treated as false. When any of these fails, the correct behavior is not "attenuate anyway" — it is to refuse attenuation and require the parent to re-mint from a canonical, injective scope, or to escalate to the root issuer. This is the boundary: **an instance must refuse to attenuate whenever it cannot prove canonical agreement and predicate closure, because an unprovable subset is not a subset.** ## Decision Boundary The decision is not "is the child string a prefix of the parent string." The decision is a three-way branch: - **Provable subset → attenuate.** `canon(S_c)` is a subset of `canon(S_p)` under a closed, injective algebra, and the tool's parser is subsumed by the scope grammar. Mint the child token. - **Provable non-subset → reject.** `canon(S_c)` names a resource outside `canon(S_p)`. Refuse; do not mint. - **Unprovable → refuse and escalate.** The scope contains a component the checker cannot canonicalize or cannot prove closed (opaque `where`, un-normalized path, unit-ambiguous bound, tool grammar wider than scope grammar). The default must be refusal, because the cost of a false "safe" is a cross-tenant breach that no downstream signature check will catch, while the cost of a false "refuse" is a re-mint round-trip. The trap is that the middle and third branches look identical to a prefix checker: both produce a string that "starts with" the parent scope. A prefix checker collapses branch three into branch one. The operational rule is to make branch three *loud*: an unprovable attenuation must raise, not silently pass. ## Operational Effect Downstream, a collapsed attenuation is a **silent privilege widening with a valid audit trail**. Every log line shows a correctly-scoped child token doing exactly what its token permitted — because the token permitted more than the parent intended. Incident response that filters on "token scope violations" finds nothing, since no scope was violated; the scope itself was wrong. Detection therefore cannot live in the enforcement path. It must live at mint-time, as a hard refusal on unprovable attenuation, plus a reconciliation job that periodically re-evaluates every issued child scope against its parent under the current canonicalizer and flags drift (canonicalizer changes, tool grammar changes, new Unicode tables) that retroactively invalidates previously-minted tokens. The durable invariant to encode: **a child capability is only as narrow as the weakest canonicalization in the chain from mint to enforcement, and any link whose canonicalization you cannot inspect makes the attenuation unprovable — which means forbidden.** ```python class UnprovableAttenuationError(RuntimeError): """Raised when a child scope cannot be proven a subset of the parent scope under a closed, injective canonical algebra. Never attenuate on doubt.""" pass def attenuate(parent_scope: dict, child_scope: dict, canon, parser_subsumed: bool) -> dict: # canon: idempotent, injective canonicalizer shared by mint and enforcement. # parser_subsumed: True only if the enforcing tool's arg grammar is a strict # subset of the grammar the scope checker reasons about. if not parser_subsumed: raise UnprovableAttenuationError( f"tool parser not subsumed by scope grammar; child={child_scope!r}" ) for key, cval in child_scope.items(): if key not in parent_scope: raise UnprovableAttenuationError( f"child introduces scope dimension {key!r} absent from parent" ) pval = parent_scope[key] # Opaque predicate components (where-clauses, globs, regexes) cannot be # proven closed by string comparison; treat as unprovable, not safe. if key in ("where", "glob", "regex", "query"): if cval != pval: raise UnprovableAttenuationError( f"opaque predicate {key!r} altered: parent={pval!r} child={cval!r}" ) continue pc, cc = canon(pval), canon(cval) if pc != cc and not _is_subset(cc, pc): raise UnprovableAttenuationError( f"canonical child {cc!r} not subset of canonical parent {pc!r} " f"(raw parent={pval!r}, raw child={cval!r})" ) return dict(child_scope) def _is_subset(child_canon, parent_canon) -> bool: # Placeholder for a closed, injective subset relation over the canonical form. # Must be total over the enforcement domain or return False. return False ```