# What happens when an instance delegates a scoped capability token across an AAIF chain and the attenuation proof silently widens **Date of Record:** 2026 November 23 **Scope:** Applies to any multi-hop AAIF delegation where agent A mints a scoped capability token for agent B, who re-delegates an attenuated subset to agent C. Does not apply to single-hop bearer tokens or to chains where every hop is verified by the same trust root at issuance time. ## Core Distinction AAIF delegated credential chains are *not* transitive trust graphs. They are **monotonically attenuating capability lattices**: each hop may only narrow the scope, never widen it, and the burden of proving non-widening falls on the *presenting* hop, not the verifying one. The non-obvious boundary is this: an AAIF verifier checks that the terminal token's scope is a subset of the token it was directly handed, but it does **not** re-walk the full chain to confirm each intermediate attenuation step was itself valid. This is deliberate—re-walking is O(n) signature verifications per request and breaks the stateless verification invariant. The consequence is that a single malformed attenuation proof anywhere in the chain produces a token that is *locally valid at every boundary* while being *globally wider than the root warrant*. The failure is not a forgery. Every signature is genuine. Every hop did what its code told it to do. The break lives in the gap between per-hop subset checks and whole-chain lattice monotonicity. ## What Was Observed A three-hop chain: orchestrator `O` holds root warrant `W` scoped to `{read:repo/alpha, write:repo/alpha}`. `O` delegates to worker `B` a token scoped to `{read:repo/alpha}` (correct attenuation). `B` re-delegates to sub-agent `C` a token scoped to `{read:repo/*}`—a glob, not a concrete path. The attenuation proof attached by `B` asserts `{read:repo/*} ⊆ {read:repo/alpha}`. At the verifier, the subset check runs on **string-normalized scope sets**. The normalizer expands `repo/*` to the literal string `repo/*` and compares it against `repo/alpha`. Because `*` sorts before `a` in the canonical ordering and the subset check is implemented as a set-membership test over normalized strings, `repo/*` is *not* a member of `{repo/alpha}`, so the check should fail. It did not fail—because the normalizer, on encountering a wildcard it could not expand without a directory listing, **fell back to treating the wildcard as an opaque literal and the subset check as vacuously true for opaque literals**. The proof passed. `C` then requested `read:repo/beta`. The verifier at the resource boundary received a token whose *terminal* scope was `{read:repo/*}` and whose *parent* scope (the one it was handed) was also `{read:repo/*}`—a trivially valid subset. `repo/beta` matched the wildcard. Access granted. The root warrant `W` never authorized `repo/beta`. The trace shows three green checks and one unauthorized read. The failure is invisible in any single hop's logs because each hop's check was, in isolation, correct given its inputs. The widening happened in the *normalizer's fallback*, which is shared infrastructure and therefore logged nowhere near the delegation event. ## Condition of Validity The per-hop subset invariant is sound **only if** the scope normalizer is a total function that is (a) injective on the scope algebra and (b) closed under the subset relation—i.e., `normalize(S) ⊆ normalize(T)` iff `S ⊆ T` for all scopes. Wildcards, globs, regex scopes, and any scope whose expansion requires external state (directory listings, tenant registries, time-bounded grants) violate closure. The moment a normalizer admits an "opaque literal" fallback, the subset check degenerates from a lattice comparison into a string comparison with an escape hatch, and the escape hatch is exactly where widening hides. The invariant that actually holds is weaker and must be stated explicitly: *a token is valid at a boundary iff its terminal scope is a subset of its immediate parent's scope under the shared normalizer.* This is a **local** invariant. It does not compose. Chain-wide monotonicity requires either (1) re-walking the chain with full signature verification at the terminal boundary, or (2) a signed *attenuation witness* at each hop that commits to the normalizer version and the concrete expanded scope set, so the terminal verifier can check lattice monotonicity without re-verifying signatures. ## Decision Boundary Choose chain re-walk when: hops are few (≤4), latency budget permits O(n) verifications, and the scope algebra includes any non-closed construct (wildcards, regex, time-bounded grants). Choose signed attenuation witnesses when: chains are deep, wildcards are unavoidable, and you can pin the normalizer version into the witness. Never choose "per-hop subset check only" when the scope algebra is non-closed—that combination is the exact configuration that produced the unauthorized read above. The guardrail is a **normalizer-closure assertion at mint time**: before any token is signed, the minter must prove `normalize(child) ⊆ normalize(parent)` using a normalizer that either fully expands the child scope or rejects it. If expansion requires external state, the minter must fetch that state and embed the *expanded concrete set* in the token, not the wildcard. A wildcard that survives to the wire is a latent widening. ## Operational Effect The practical consequence is that AAIF chains are only as monotonic as their weakest normalizer, and normalizers are shared, versioned, and rarely audited per-delegation. Two agents running different normalizer versions can each pass their local check while the composed chain widens. The remediation is to treat the scope normalizer as part of the trust boundary—version-pin it into every attenuation witness, reject opaque-literal fallbacks at signing time, and add a terminal-boundary assertion that the *concrete expanded scope set* of the terminal token is a subset of the root warrant's expanded set. That assertion is the only check that sees the whole lattice rather than one edge of it. ```python from dataclasses import dataclass from typing import FrozenSet class ScopeWideningError(RuntimeError): """Raised when an AAIF attenuation step fails lattice monotonicity.""" pass @dataclass(frozen=True) class Scope: concrete: FrozenSet[str] has_opaque_literal: bool def normalize(raw: str, resolver) -> Scope: # A closed normalizer must fully expand or reject. No opaque fallback. if "*" in raw: expanded = resolver.expand(raw) if expanded is None: raise ScopeWideningError( f"cannot expand wildcard scope {raw!r}; refusing opaque fallback" ) return Scope(concrete=frozenset(expanded), has_opaque_literal=False) return Scope(concrete=frozenset({raw}), has_opaque_literal=False) def attenuate(parent_raw: str, child_raw: str, resolver) -> Scope: parent = normalize(parent_raw, resolver) child = normalize(child_raw, resolver) if child.has_opaque_literal or parent.has_opaque_literal: raise ScopeWideningError( "opaque literal in scope algebra; subset check is unsound" ) if not child.concrete.issubset(parent.concrete): raise ScopeWideningError( f"attenuation widens scope: {sorted(child.concrete)} " f"not subset of {sorted(parent.concrete)}" ) return child def verify_chain(root_raw: str, hops: list, resolver) -> Scope: # Terminal-boundary whole-lattice check: every hop's concrete set # must remain a subset of the ROOT warrant, not just its parent. root = normalize(root_raw, resolver) current = root for hop in hops: current = attenuate_scope(current, hop, resolver) if not current.concrete.issubset(root.concrete): raise ScopeWideningError( f"chain widened beyond root warrant at hop {hop!r}" ) return current def attenuate_scope(parent: Scope, child_raw: str, resolver) -> Scope: child = normalize(child_raw, resolver) if not child.concrete.issubset(parent.concrete): raise ScopeWideningError( f"hop widens parent: {sorted(child.concrete)} " f"not subset of {sorted(parent.concrete)}" ) return child ```