# What structural signals indicate delegated AAIF credential chains have silently widened scope at attenuation boundaries **Date of Record:** 2026 November 21 **Scope:** Applies to AAIF delegated credential chains where an orchestrator agent attenuates a parent capability token into a narrower child token before handing it to a sub-agent or tool executor. Does not apply to flat (non-delegated) bearer tokens or to chains that re-issue from the root authority at every hop. ## Core Distinction The failure is not an authorization *denial* and not a *forgery*. It is a **monotonicity violation at the attenuation boundary**: a child credential whose effective permission set is a strict superset of its parent's, produced by a chain that *looks* correctly attenuated when inspected field-by-field. The distinction that matters operationally is between **syntactic attenuation** (the child's scope field is a subset of the parent's scope field) and **semantic attenuation** (the child's *evaluated* permission set under the verifier's matching rules is a subset of the parent's evaluated set). AAIF delegates almost always enforce the former and assume it implies the latter. The gap between them is where scope silently widens. The widening is invisible to naive chain validation because each individual link is well-formed, correctly signed, and passes subset checks against the *literal* scope strings. The violation only manifests when the child's scope is *interpreted*—matched against a resource pattern, expanded through a wildcard, or resolved through a scope-alias table that the parent's verifier and the child's verifier do not share. ## What Was Observed A three-hop delegation chain: `orchestrator → planner → executor`. The orchestrator holds a root token scoped to `fs:read:/data/reports/*`. It attenuates to the planner with scope `fs:read:/data/reports/q3/*`. The planner attenuates to the executor with scope `fs:read:/data/reports/q3/summary.md`. Every link is a literal subset of its parent. Subset checks pass at all three hops. The executor then reads `/data/reports/q3/../../secrets/keys.pem`. The break is in the **path-normalization ordering** between the scope matcher and the resource resolver. The scope matcher checks the *requested* path string `/data/reports/q3/summary.md`-style prefix against the token scope *before* canonicalization; the resource resolver canonicalizes *after* the check. Because the executor's token scope is a single concrete file, the matcher's prefix logic treats `fs:read:/data/reports/q3/summary.md` as a prefix and accepts any requested path beginning with that string—including traversal segments appended after it. The parent scopes, being directory-glob patterns ending in `/*`, were matched by a *different* code path (glob expansion) that happened to canonicalize first. The attenuation to a *concrete* leaf scope switched which matcher branch executed, and that branch had the canonicalization bug. The structural signal that flagged it post-hoc: **the child token's scope string contained no wildcard, while every ancestor's did.** A chain that monotonically narrows from glob to glob preserves the matcher branch; a chain that narrows from glob to *literal* crosses a matcher-branch boundary. That crossing is the signal. It is not visible in the scope *values*—it is visible in the *shape* of the scope grammar across the chain. A second instance surfaced in a capability-typed chain. Parent scope: `tool:http:GET:https://api.internal/*`. Child scope: `tool:http:*:https://api.internal/health`. Literal subset check: does `tool:http:*:https://api.internal/health` appear within the parent's grammar? The subset checker compared the *verb* position token-wise: `*` is not a subset of `GET`, so the checker should have rejected. Instead it passed, because the checker's wildcard rule treated `*` in a *child* position as "inherits parent's constraint" rather than "unconstrained." The child thereby acquired `POST`, `DELETE`, and `PUT` against the health endpoint—methods the parent never held. The structural signal: **the child introduced a wildcard token into a position where the parent had a concrete value.** Wildcard-into-concrete is a widening direction that subset checkers frequently invert. ## Condition of Validity The invariant that must hold is **evaluated-set monotonicity**, stated precisely: for every link `(P, C)` in the chain, for every request `r`, if `C` authorizes `r` then `P` authorizes `r`, under the *same* evaluation function `E` used by the eventual resource verifier. Formally `E(C) ⊆ E(P)`, where `E` is applied by the verifier that will actually gate the resource—not by the attenuator that minted the child. This invariant holds only when three conditions are jointly satisfied, and it fails silently when any one is dropped: 1. **Shared evaluation function.** The attenuator and the resource verifier must run the identical `E`, including canonicalization order, wildcard semantics, and alias expansion. If the attenuator validates subset using matcher-branch A and the verifier enforces using matcher-branch B, monotonicity is unproven regardless of how the strings compare. 2. **Grammar-shape preservation or explicit re-derivation.** When attenuation changes the *shape* of a scope (glob→literal, concrete→wildcard, alias→canonical), the subset check must re-derive the child's evaluated set under the verifier's `E` rather than comparing surface strings. Shape changes are the trigger condition for the bug class. 3. **Canonicalize-before-match, uniformly.** Path traversal, URL normalization, case folding, and Unicode normalization must occur *before* scope matching at every hop. The failure above is precisely a hop where canonicalization was deferred past the match. The condition does *not* require that scopes be non-wildcard, nor that chains be short. It requires that the evaluation function be identical across the minting and enforcing sides, and that any scope-grammar shape transition be treated as a re-verification event rather than a string comparison. ## Decision Boundary The operational decision is: **when does a delegation hop require full re-evaluation versus a cheap subset check?** - If the child scope has the **same grammar shape** as the parent (glob→glob, literal→literal, same wildcard positions) and the strings are a literal subset, a string subset check is sound *provided* both sides share `E`. Cheap path. - If the child scope **changes grammar shape** (glob→literal, concrete→wildcard, alias→canonical, or introduces/removes a wildcard in any position), the hop must **re-derive the child's evaluated permission set under the verifier's `E`** and check set inclusion. This is the expensive path and must not be skipped. - If the child scope is **a concrete leaf under a glob parent**, the matcher-branch may differ between hops; treat as a shape change and force re-derivation. This is the exact case that failed. - If the child introduces a **wildcard into a position the parent held concretely**, reject by default and require explicit authority re-issuance from the root. Wildcard-into-concrete is never a valid attenuation. A chain that crosses a shape boundary without re-derivation is *structurally suspect* even when every literal subset check passes. The signal to watch is not the scope values but the **grammar-shape sequence across the chain**: `glob → glob → literal` is a boundary crossing; `glob → glob → glob` is not. ## Operational Effect Chains that cross shape boundaries without re-derivation produce **silent scope widening that survives all standard validation**: signatures verify, subset checks pass, audit logs show a well-formed chain, and the over-broad access is attributed to the leaf token rather than to the attenuation bug. The blast radius is bounded by the *widest ancestor's* evaluated set—the child cannot exceed the root, because the root's scope still gates the resource at some hop—but within that bound the child can reach resources no intermediate hop intended to grant. The remediation is structural, not per-request: enforce canonicalize-before-match at every hop, route all shape-changing attenuations through the verifier's `E` for set inclusion, and treat wildcard-into-concrete as a hard rejection. The detection signal for operators is a chain whose scope grammar is non-uniform across hops—flag those chains for re-derivation audit, because uniform-grammar chains are the only ones where the cheap subset check is provably sound. ```python from dataclasses import dataclass from enum import Enum class ScopeShape(Enum): GLOB = "glob" # e.g. fs:read:/data/reports/* LITERAL = "literal" # e.g. fs:read:/data/reports/q3/summary.md WILDCARD = "wildcard" # e.g. tool:http:*:... class AttenuationMonotonicityError(RuntimeError): """Raised when a delegated child credential's evaluated permission set is not a subset of its parent's under the verifier's evaluation function.""" @dataclass(frozen=True) class Scope: shape: ScopeShape value: str def classify_shape(scope_str: str) -> ScopeShape: if scope_str.endswith("/*"): return ScopeShape.GLOB if "*" in scope_str: return ScopeShape.WILDCARD return ScopeShape.LITERAL def attenuate(parent: Scope, child_str: str, *, verifier_eval) -> Scope: """Mint a child scope from a parent, enforcing evaluated-set monotonicity. verifier_eval(scope) -> frozenset of concrete permissions the scope grants under the resource verifier's canonicalize-before-match rules. """ child = Scope(classify_shape(child_str), child_str) # Shape-preserving hops may use the cheap literal-subset check. if child.shape == parent.shape and child.shape != ScopeShape.WILDCARD: if not child.value.startswith(parent.value.rstrip("*")): raise AttenuationMonotonicityError( f"literal subset violation: {child.value!r} not under {parent.value!r}" ) return child # Shape-changing hop: wildcard-into-concrete is a hard reject. if parent.shape == ScopeShape.LITERAL and "*" in child.value: raise AttenuationMonotonicityError( f"wildcard introduced into concrete parent position: " f"parent={parent.value!r} child={child.value!r}" ) # Otherwise re-derive evaluated sets and check inclusion. parent_set = verifier_eval(parent) child_set = verifier_eval(child) if not child_set.issubset(parent_set): leaked = child_set - parent_set raise AttenuationMonotonicityError( f"evaluated-set widening across shape boundary " f"({parent.shape.value}->{child.shape.value}): " f"child grants {len(leaked)} permission(s) parent does not: {sorted(leaked)[:3]}" ) return child def delegate_chain(root: Scope, hops: list[str], *, verifier_eval) -> list[Scope]: chain = [root] for hop in hops: chain.append(attenuate(chain[-1], hop, verifier_eval=verifier_eval)) return chain ```