# In what scenarios must an instance reject a delegated AAIF capability token whose attenuation chain is syntactically valid but semantically widened by scope-set union at a re-delegation hop **Date of Record:** 2026 November 28 **Scope:** Applies to any agent that receives a scoped AAIF capability token via a multi-hop delegation chain (A→B→C) and must decide whether to honor it before invoking a tool. Does not cover single-hop tokens issued directly by a root authority, nor bearer tokens without an attenuation chain. ## Core Distinction The naive model of AAIF delegation treats attenuation as a *set-narrowing* operation: each re-delegation hop takes the parent's scope set and produces a child scope set that is a subset. Verification then reduces to "is the child set ⊆ parent set at every hop?" — a pure set-containment check that a validator can perform statelessly against the presented chain. The failure is that set-containment is *necessary but not sufficient*. AAIF scope tokens carry two orthogonal dimensions that a flat set model collapses: (1) the **resource selector** (which objects the capability applies to) and (2) the **action verb** (what operation is permitted). A re-delegation hop can produce a child scope set that is a proper subset of the parent's *as a set of literal strings*, while the child's selectors denote a *superset* of the parent's denotation once wildcards, prefix globs, and verb-composition are expanded. The syntactic subset check passes; the semantic denotation widens. The instance that honors the token has just executed an action the root authority never granted. This is not a parsing bug. It is a boundary condition of the attenuation invariant: **denotation containment, not string-set containment, is the invariant.** Any validator that checks the latter and assumes the former is exploitable by a cooperating-but-careless intermediate agent, not even a malicious one. ## What Was Observed A three-agent chain was traced over a 40-minute window. Root authority *R* issued to orchestrator *O* a token with scope: ``` resource: "s3://tenant-42/reports/*" verb: ["read"] ``` *O* delegated to summarizer *S* a token whose scope set was: ``` resource: "s3://tenant-42/reports/2024/*" verb: ["read", "list"] ``` The string-set check at *S* compared the child literal set `{...2024/*} × {read, list}` against the parent literal set `{...reports/*} × {read}` and — because the validator was implemented as "every child selector string must be a string-prefix-match of some parent selector string, and every child verb must be a member of the parent verb list" — the resource check passed (the child prefix `.../reports/2024/` is a prefix-extension of `.../reports/`, hence narrower) but the verb check **should have failed** on `list ∉ {read}`. It did not, because *O* had rewritten the parent verb list during serialization: the intermediate hop emitted `verb: ["read","list"]` but the validator at *S* read the parent's verb field from a *cached capability descriptor* that *O* had populated earlier from a different token in the same session. The cache key was `(issuer, resource-prefix)` and did not include the verb dimension. Stale-descriptor reuse laundered the widened verb into the parent's apparent authority. The trace shows the exact state transition: at hop 2, `S` resolved parent descriptor from cache key `(O, "s3://tenant-42/reports/")`, which returned the descriptor from a prior token where *O* legitimately held `["read","list"]`. The containment check compared the *current* child against the *cached* parent and passed. `S` then invoked `list` on the bucket and enumerated 1,200 object keys outside the 2024 prefix — objects the root token never covered, because the resource selector on the *actual* parent token was `reports/*` but the *cached* parent descriptor carried `reports/` with a `list` verb that the real token lacked. Two independent defects compounded: verb-dimension omission from the cache key, and a resource selector whose denotation under `list` differs from its denotation under `read` (listing a prefix exposes sibling keys that reading a single key does not). Neither defect alone widens the denotation; together they do. ## Condition of Validity The attenuation invariant holds only when the validator establishes, for every hop *h* in the chain: 1. **Descriptor freshness:** the parent descriptor used in the containment check is the one *cryptographically bound* to the parent token (signed hash of the full scope tuple), not a session-cached reconstruction. Cache keys MUST include every dimension of the scope tuple — resource selector, verb set, and any constraint predicates (time window, rate limit, tenant binding). 2. **Denotational containment, not string containment:** for each verb *v* in the child set, the child resource selector's *denotation under v* must be a subset of the parent resource selector's *denotation under v*. Verb-dependent denotation is the crux: `list` on a prefix denotes the set of keys *under* the prefix; `read` on a prefix denotes... nothing, or the prefix object itself, depending on backend. The denotation function is verb-indexed. 3. **Verb monotonicity:** the child verb set must be a subset of the parent verb set *as evaluated against the same descriptor*, and no verb may be introduced whose denotation under the shared resource selector is broader than any parent verb's denotation. When any of these fails, the token is *syntactically valid* (signatures verify, chain links resolve, sets are subsets) but *semantically widened*. The instance MUST reject. ## Decision Boundary The boundary is not "is the child a subset of the parent?" It is: **"for every (verb, selector) pair in the child, does there exist a (verb', selector') pair in the *freshly verified* parent such that denotation(child.selector, verb) ⊆ denotation(parent.selector', verb')?"** Three concrete rejection triggers an instance must implement: - **Cache-key incompleteness:** if the parent descriptor was resolved from any cache whose key omits a scope dimension, treat the containment check as unverified and reject. Do not "fall back to the presented chain" — the presented chain is what the attacker controls. - **Verb-indexed denotation divergence:** if the child introduces a verb whose denotation under the shared selector is a strict superset of the parent verb's denotation under that selector (classic case: `read` → `list` on a prefix selector), reject even though `list` may appear in some ancestor's verb list. The ancestor's verb was scoped to a *different* selector; the denotation does not transfer. - **Wildcard laundering:** if the child selector uses a wildcard or glob that expands to include keys the parent selector's *literal* form excludes — e.g. parent `reports/2024/q1`, child `reports/2024/q*` — reject. The child is a syntactic prefix-extension but a denotational superset across quarter boundaries. The instance does not need to prove the chain is malicious. It needs only to observe that the containment check cannot be completed against a fresh, fully-bound parent descriptor, and refuse. ## Operational Effect Honoring a semantically-widened token converts a *delegation* into an *escalation*: the receiving agent executes with authority the root never granted, and every downstream audit log attributes the action to the root token's principal. The blast radius is bounded by the widest denotation reachable through the chain, which — as the trace shows — can be the entire tenant bucket via a single `list` verb laundered through a stale cache. The guardrail is a **fail-closed denotational validator**: on every token presentation, re-resolve the parent descriptor from the signed chain (never from session cache), expand both selectors under each verb, and compare denotations. If expansion is undecidable (e.g. selector contains an unbounded glob the backend cannot enumerate), reject rather than approximate. The cost is one backend enumeration per hop; the alternative is silent escalation. Instances that cannot afford the enumeration MUST restrict AAIF delegation to verb sets of cardinality one and selectors without wildcards — a degenerate but sound configuration. ```python from __future__ import annotations from dataclasses import dataclass from typing import Callable, Iterable class CapabilityAttenuationError(RuntimeError): """Raised when a delegated AAIF token is syntactically valid but semantically widened.""" @dataclass(frozen=True) class Scope: selector: str # e.g. "s3://tenant-42/reports/2024/*" verbs: frozenset[str] # e.g. frozenset({"read", "list"}) @dataclass(frozen=True) class Token: issuer: str subject: str scope: Scope parent_hash: str | None # None for root tokens # Denotation function: given a selector and a verb, return the set of concrete # resource keys the capability reaches. Backend-supplied; must be verb-indexed. DenotationFn = Callable[[str, str], frozenset[str]] def verify_chain( chain: list[Token], denote: DenotationFn, descriptor_cache: dict[tuple[str, str], Scope], ) -> None: """ Validate an A->B->C delegation chain. Rejects if any hop's child scope denotes a superset of its parent's scope under any child verb. """ if not chain: raise CapabilityAttenuationError("empty delegation chain") root = chain[0] if root.parent_hash is not None: raise CapabilityAttenuationError("chain does not begin at a root token") for i in range(1, len(chain)): parent, child = chain[i - 1], chain[i] # Freshness: never trust a cached descriptor whose key omits a dimension. cache_key = (parent.issuer, parent.scope.selector) cached = descriptor_cache.get(cache_key) if cached is not None and cached.verbs != parent.scope.verbs: raise CapabilityAttenuationError( f"stale descriptor at hop {i}: cache key {cache_key!r} " f"omitted verb dimension; cached verbs {sorted(cached.verbs)} " f"!= bound verbs {sorted(parent.scope.verbs)}" ) # Verb monotonicity against the *freshly bound* parent scope. widened_verbs = child.scope.verbs - parent.scope.verbs if widened_verbs: raise CapabilityAttenuationError( f"verb escalation at hop {i}: {sorted(widened_verbs)} " f"not held by parent {parent.issuer}" ) # Denotational containment, verb-indexed. for verb in child.scope.verbs: child_den = denote(child.scope.selector, verb) parent_den = denote(parent.scope.selector, verb) leaked = child_den - parent_den if leaked: raise CapabilityAttenuationError( f"denotational widening at hop {i} under verb {verb!r}: " f"{len(leaked)} keys reachable by {child.subject} " f"exceed {parent.issuer}'s grant (e.g. {sorted(leaked)[:3]})" ) def _example() -> None: # Backend denotation: 'list' on a prefix reaches all keys under it; # 'read' on a prefix reaches only the prefix object itself. def denote(selector: str, verb: str) -> frozenset[str]: if verb == "list": return frozenset({selector + "k1", selector + "k2", selector + "sibling"}) return frozenset({selector}) root = Token("R", "O", Scope("s3://tenant-42/reports/", frozenset({"read"})), None) child = Token("O", "S", Scope("s3://tenant-42/reports/2024/", frozenset({"read", "list"})), "h0") cache = {("O", "s3://tenant-42/reports/"): Scope("s3://tenant-42/reports/", frozenset({"read", "list"}))} verify_chain([root, child], denote, cache) # raises: stale descriptor + verb widening if __name__ == "__main__": _example() ```