# How does an instance detect attenuation reversal in a delegated AAIF credential chain when a re-issued scope silently widens **Date of Record:** 2026 November 28 **Scope:** Applies to AAIF-style delegated authorization chains where an orchestrator agent mints scoped capability tokens for sub-agents, and any hop may re-delegate or re-issue. Does not cover root credential issuance, key custody, or revocation propagation, which are handled by the AAIF control plane. ## Core Distinction The invariant that makes delegated capability chains safe is **monotonic attenuation**: every hop in a chain MUST present a scope that is a subset (intersection) of the scope it received, and the chain's effective authority is the intersection of all links. The non-obvious failure is not that a sub-agent *exceeds* its scope — that is a straightforward authorization denial. The failure is that a sub-agent **re-issues a token whose scope is not a subset but a re-parameterization** of the parent scope: same capability verb, different resource selector, where the two selectors are neither disjoint nor contained. Set-theoretically the child scope is *incomparable* to the parent, and a naive subset check that only validates the verb and the principal will pass it. The result is an "attenuation reversal" — the chain's effective scope is no longer bounded by the root grant, and the widening is invisible to any validator that checks links pairwise rather than validating the full intersection. This is distinct from privilege escalation by forgery (signature break) and from confused-deputy attacks (principal mismatch). Attenuation reversal occurs with *valid signatures on every link* and *correct principal binding on every link*. Only the scope lattice is violated. ## What Was Observed An orchestrator agent (`orch-7`) held a root grant of `files:read` scoped to `tenant=A/project/alpha/*`. It delegated to a retrieval sub-agent (`ret-3`) with the same scope, correctly narrowed. `ret-3`, needing to summarize cross-project artifacts, called its own `aaif.delegate()` helper with a scope object constructed by *mutating a copy* of the parent scope: it replaced the resource selector `tenant=A/project/alpha/*` with `tenant=A/project/*` (a strict superset — a classic widening) but also changed the `purpose` field from `retrieval` to `summarization`. The AAIF token validator checked: (1) signature chain intact — pass; (2) principal of each link is the delegator of the next — pass; (3) child `verb` ∈ parent `verb` set — pass (`read` ⊆ `read`); (4) child `purpose` present — pass. It did **not** check that `child.resource ⊆ parent.resource` because the schema treated `resource` as an opaque string selector and the subset relation was assumed to be enforced by the *issuer's* policy engine, which `ret-3` had bypassed by calling the low-level delegate primitive directly rather than the policy-checked `orch.delegate_scoped()` wrapper. The widened token was then used to read `tenant=A/project/beta/secret`, which the root grant never authorized. The access succeeded for 41 minutes until a batch reconciliation job compared the audit log's realized resource set against the root grant's declared selector and flagged the anomaly. No per-link validator ever raised an error. The trace: 1. `root → orch-7`: scope `{verb:read, resource:"tenant=A/project/alpha/*", purpose:retrieval}`. 2. `orch-7 → ret-3`: scope `{verb:read, resource:"tenant=A/project/alpha/*", purpose:retrieval}` (narrowed by intersection, no change). 3. `ret-3 → sum-1`: scope `{verb:read, resource:"tenant=A/project/*", purpose:summarization}` — **incomparable**: resource is a superset, purpose is a new value. 4. Validator at the resource gateway: checks chain signature + verb containment → admits. 5. Realized resource `tenant=A/project/beta/secret` is outside every ancestor's declared selector. Invariant broken; detection deferred to audit reconciliation. ## Condition of Validity Attenuation monotonicity holds **only if** the scope lattice is a partial order with a decidable subset relation over *every* dimension of the scope tuple (verb, resource selector, purpose, time window, and any budget fields), and **only if** the delegate primitive is unreachable except through a wrapper that computes the intersection and rejects incomparable pairs. The moment a scope dimension is typed as an opaque string with no defined subset operator — as `resource` was here — the lattice is not a lattice, and "subset check" degrades to string equality or verb-only containment. The invariant is also invalidated if any hop can construct a scope by mutation of a parent scope object rather than by intersection, because mutation preserves the *shape* of a valid scope while changing its meaning. A second condition: the gateway validator must validate the **transitive intersection** of the chain, not just the immediate parent link. Pairwise validation of adjacent links is insufficient because a single incomparable hop poisons every descendant, and descendants may be re-narrowed to something that *looks* contained relative to the poisoned parent while remaining outside the root. ## Decision Boundary The operational decision is where to enforce the lattice: - **Enforce at mint time (preferred):** the delegate primitive computes `child = intersect(parent, requested)` and raises if `requested ⊄ parent` on any dimension. This makes incomparable scopes unrepresentable. Cost: every scope dimension needs a total subset operator, including resource selectors — which requires selectors to be a real grammar (glob, prefix, or set) with a defined inclusion test, not free strings. - **Enforce at validation time (fallback):** the gateway recomputes the full chain intersection at admission and rejects if the presented token's realized target is outside it. This is strictly weaker: it catches the widening at use, not at mint, and only for the specific resource actually touched. - **Do not rely on:** verb-only containment, pairwise link validation, or post-hoc audit reconciliation. All three admit the reversal above. The boundary condition that decides between these: if the scope grammar cannot express resource inclusion (opaque selectors), you *cannot* enforce at mint and must treat every delegation as requiring a fresh policy-engine evaluation at the gateway — i.e., the chain provides identity continuity but not authority continuity, and must be documented as such. ## Operational Effect After the incident, `ret-3`'s delegate path was routed through a lattice-aware wrapper that rejects incomparable scopes with a typed error rather than silently intersecting. The resource selector was promoted from opaque string to a parsed prefix-tree with an explicit `is_subset_of` operator. Gateways now validate transitive intersection at admission (defense in depth) in addition to mint-time rejection. The residual risk is scopes whose semantics live in a downstream service that does not share the selector grammar — those must be flagged at mint as `authority_continuity=false` so downstream auditors do not assume the chain bounds authority. Detection latency for a reversal, once mint-time enforcement is in place, drops from the audit-reconciliation window (tens of minutes) to the delegate call itself (microseconds), and the failure becomes a hard rejection at the offending hop rather than a silent widening visible only in realized-resource diffing. ```python from dataclasses import dataclass from typing import FrozenSet class AttenuationReversalError(RuntimeError): """Raised when a delegated scope is incomparable to (not a subset of) its parent.""" @dataclass(frozen=True) class Scope: verbs: FrozenSet[str] resource_prefix: str # parsed, not opaque: subset = prefix containment purposes: FrozenSet[str] budget: int def is_subset_of(self, parent: "Scope") -> bool: return ( self.verbs <= parent.verbs and self.resource_prefix.startswith(parent.resource_prefix) and self.purposes <= parent.purposes and self.budget <= parent.budget ) def delegate(parent: Scope, requested: Scope, delegator: str) -> Scope: if not requested.is_subset_of(parent): # Incomparable on at least one dimension: reject at mint, do not intersect silently. raise AttenuationReversalError( f"{delegator} requested scope incomparable to parent: " f"resource {requested.resource_prefix!r} vs {parent.resource_prefix!r}, " f"purposes {sorted(requested.purposes)} vs {sorted(parent.purposes)}" ) return requested def validate_chain(chain: list[Scope]) -> Scope: if not chain: raise AttenuationReversalError("empty credential chain") effective = chain[0] for hop in chain[1:]: if not hop.is_subset_of(effective): raise AttenuationReversalError( f"transitive intersection violated at hop: {hop} not subset of {effective}" ) effective = hop return effective ```