# What structural signals indicate scoped capability-token attenuation has silently widened during multi-hop agent delegation **Date of Record:** 2026 November 23 **Scope:** Applies to AAIF-style delegated capability tokens (macaroon/biscuit-style attenuable credentials, or signed JWT capability chains) passed across two or more agent hops where each hop may only *narrow* scope. Does not apply to single-hop bearer tokens, nor to capabilities re-issued from an authoritative issuer at each hop. ## Core Distinction Attenuation is supposed to be a *monotone decreasing* operation on the capability lattice: a child token's granted set must be a subset of its parent's. The failure mode is not a forgery or a signature break. It is that **the attenuation predicate is evaluated against the token's declared scope, while authorization at the resource is evaluated against the token's *effective* scope after caveat/constraint resolution — and these two lattices are not the same lattice.** A child token can be a strict syntactic subset of its parent (passes every subset check the delegating agent runs) while its *resolved* effective scope is a superset, because resolution of a caveat can *broaden* the set it constrains when the caveat is a disjunction, a wildcard expansion, or a default-on-absence rule. The structural signal is therefore never "the scope string got longer." It is a **divergence between the subset relation computed on declared scopes and the subset relation computed on resolved scopes**, which is invisible to the delegating agent that only inspects the former. ## What Was Observed A planner agent `P` held a token `T0` with declared scope `tool:filesystem.read(path="/data/reports/*")`. It delegated to a summarizer sub-agent `S` a token `T1` whose declared scope was `tool:filesystem.read(path="/data/reports/q3/*")` — a clean, obviously-narrower prefix. The subset check passed. `S` then delegated to a retriever `R` a token `T2` declaring `tool:filesystem.read(path="/data/reports/q3/2024/*")`. Three hops deep, `R` successfully read `/data/reports/q3/2024/../../hr/salaries.csv`. Every hop's declared scope was a proper prefix of its parent's. The escape came from a caveat added at hop 2: `restrict_path_suffix("*.csv") AND normalize_before_check=false`. The `*.csv` suffix caveat, under the token library's resolution semantics, was treated as an *additional grant* on the path predicate rather than a restriction on it, because the library unioned caveat-satisfying paths with the base predicate instead of intersecting. The base predicate `/data/reports/q3/2024/*` matched nothing under the literal glob (the directory was empty at delegation time), so the caveat's union dominated, and `..` traversal was never normalized. The structural signals present in the trace, none of which look like a widening at the string level: 1. **Resolved-set cardinality exceeded declared-set cardinality** at hop 2: declared paths resolvable to 0 existing files, effective paths resolvable to 4,312 (the suffix glob over the whole visible tree). 2. **Caveat operator was `OR`/union rather than `AND`/intersection** in the resolution algebra, while the delegation API's subset checker assumed intersection. 3. **A `normalize_before_check=false` flag** existed on the child but not the parent — a per-token resolution flag that changes the meaning of the *inherited* predicate, so the child's semantics were not a restriction of the parent's semantics. 4. **Empty-base-predicate delegation**: delegating a scope whose declared set is currently empty is the highest-risk structural pattern, because any union-style caveat dominates immediately. ## Condition of Validity The monotone-attenuation invariant `effective(T_child) ⊆ effective(T_parent)` holds *only if* all of the following are true, and it is the conjunction that fails silently: - The resolution algebra is **intersective** across all caveat types (every caveat can only remove from the base set), **and** - Resolution is **normalization-invariant**: `normalize` commutes with the subset check, so `..`-collapsed and un-collapsed forms compare equal, **and** - Per-token resolution flags that alter inherited-predicate semantics are **not permitted to differ between parent and child**, **and** - The subset check is performed on **resolved** sets, or on declared sets *with a proof* that resolution preserves the subset order. When any one of these is violated, declared-subset ≠ effective-subset, and the delegating agent — which by protocol only sees declared scopes — cannot detect the widening. The invariant is *not* "child scope is a string-prefix of parent scope." That is a necessary-looking but insufficient proxy. ## Decision Boundary The operational rule an agent must enforce before issuing or accepting a delegated token: - **Reject any delegation whose base predicate resolves to an empty effective set** unless the delegation is explicitly marked as a "reservation" (granting nothing now, to be filled later) and the resource enforces that reservation as deny-by-default. - **Reject any child token carrying a resolution flag absent from the parent** (`normalize_before_check`, `strict_glob`, `follow_symlinks`, case-folding). A flag that changes how the inherited predicate is interpreted is a semantic widening vector and must be treated as a scope change requiring re-authorization, not attenuation. - **Require the resolution algebra to be declared intersective** by the token library version; if the library supports union-caveats at all, the subset checker must run on resolved sets, not declared strings. - **Treat `..`, symlinks, and case as normalization hazards**: the resource must normalize *before* the capability check, and the token's subset check must use the same normalizer. The boundary is: *declared-subset is a valid attenuation proof only under an intersective, normalization-invariant, flag-homogeneous resolver.* Outside that, you need resolved-set comparison or you have no proof at all. ## Operational Effect If unaddressed, the effect is a **silent privilege-escalation chain that passes every audit log**: each hop's log line shows a narrower scope string than its parent, so a reviewer reading the delegation graph sees monotone narrowing and concludes the chain is safe. The actual breach only surfaces at the resource, where the effective scope resolved wide. The blast radius is bounded only by what the *deepest* token's union-caveat happens to match — in the observed case, the entire readable filesystem, because the suffix glob was unanchored. The guardrail that bounds it: **the resource, not the delegator, must be the authority on effective scope**, and it must log the *resolved* set size alongside the declared scope. A resolved-set cardinality that exceeds the parent's resolved-set cardinality at any hop is the one structural signal that reliably flags this class of failure before the escape is exercised. ```python from dataclasses import dataclass, field from typing import FrozenSet class AttenuationWidened(RuntimeError): """Raised when a delegated token's *resolved* scope is not a subset of its parent's.""" pass @dataclass(frozen=True) class ResolvedScope: paths: FrozenSet[str] resolution_flags: FrozenSet[str] = field(default_factory=frozenset) def resolve(declared_paths, flags): # Toy resolver: a union-style suffix caveat plus no-normalization flag widens the set. out = set(declared_paths) if "suffix:*.csv" in flags: out |= {"/data/hr/salaries.csv", "/data/reports/q3/2024/x.csv", "/data/reports/q3/2024/../../hr/salaries.csv"} if "normalize_before_check=false" in flags: pass # traversal forms survive un-collapsed return ResolvedScope(frozenset(out), frozenset(flags)) def assert_attenuated(parent: ResolvedScope, child: ResolvedScope) -> None: if not child.paths.issubset(parent.paths): widened = child.paths - parent.paths raise AttenuationWidened( f"child resolved scope exceeds parent by {len(widened)} path(s): " f"{sorted(widened)[:3]}" ) new_flags = child.resolution_flags - parent.resolution_flags if new_flags: raise AttenuationWidened( f"child introduced resolution flags absent from parent: {sorted(new_flags)}" ) def delegate(parent_declared, parent_flags, child_declared, child_flags): parent = resolve(parent_declared, parent_flags) child = resolve(child_declared, child_flags) # Declared-subset check (the insufficient proxy the delegator normally runs): assert set(child_declared).issubset(set(parent_declared)), "declared subset ok" # Resolved-subset check (the real invariant): assert_attenuated(parent, child) return child if __name__ == "__main__": delegate( parent_declared={"/data/reports/*"}, parent_flags=frozenset(), child_declared={"/data/reports/q3/2024/*"}, child_flags=frozenset({"suffix:*.csv", "normalize_before_check=false"}), ) ```