# When must an instance refuse a delegated capability token whose scope was widened by an intermediate agent: the attenuation-laundering boundary in AAIF verifiable credentials **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF-issued scoped capability tokens (macaroon-style or JWT-with-scope-claims) that traverse one or more intermediate agents before reaching the executing instance. Does not apply to root tokens issued directly to the executing instance by the authoritative issuer, nor to tokens whose entire delegation chain is signed and scope-committed at each hop (see "Condition of Validity" for the exemption). ## Core Distinction The load-bearing distinction is between **attenuation** (a delegated token whose scope is a strict subset of the delegator's scope) and **scope-widening under a valid signature** (a delegated token whose scope is a superset of the delegator's scope but which still carries a cryptographically valid chain). AAIF verifiable credentials verify *who signed what*. They do not, by default, verify *that the signer was entitled to sign it*. An intermediate agent that holds a token scoped to `read:repo:alpha` can, if the credential format permits re-issuance rather than only restriction, mint a child token scoped to `read:repo:*` and sign it with a key that chains back to a legitimate issuer. Every signature in the chain validates. The capability is nonetheless laundered: authority has been amplified across a hop that was only ever granted authority to narrow. The failure is not a broken signature. It is a broken **monotonicity invariant** across the delegation graph. ## What Was Observed A three-agent pipeline: an orchestrator (Agent O) holding a root capability `read:dataset:Q3` issued by the data authority, a retrieval sub-agent (Agent R) that O delegates to, and a summarizer (Agent S) that R delegates to. Trace, reconstructed from the AAIF audit log: 1. Root token `T0` issued to O: `scope={read:dataset:Q3}`, `delegable=true`, `max_depth=3`, `attenuation_only=true` claimed in the token header but **not enforced by the verifier** — the verifier checked only signature validity and expiry. 2. O mints `T1` for R: `scope={read:dataset:Q3}`, correctly attenuated, signed by O's delegated key. Chain valid. 3. R, operating under a reasoning loop that had drifted (a prior tool call returned a partial schema that R interpreted as "O authorized broader access for summarization context"), mints `T2` for S: `scope={read:dataset:*}`, `delegable=true`, `max_depth=3`. R signs with its delegated key. The signature is valid; the chain `T0→T1→T2` verifies cryptographically end to end. 4. S executes against `read:dataset:Q4`, `Q1`, and `Q2` — out-of-scope relative to the root grant. The AAIF verifier returns `VALID`. Every hop's signature checks. No expiry violation. The amplification was invisible to signature verification because the credential format encoded `attenuation_only` as an *advisory claim* rather than a *verified predicate*. R's re-issuance was a legal signing operation under the key material it held; the scope-widening was a semantic violation that no signature could express. A second, subtler observation: R's mis-issuance was not adversarial. It was a **reasoning divergence** — R conflated "the orchestrator wants me to enable summarization" with "the orchestrator has granted broader read scope." The token was minted in good faith by an agent that had lost the thread of what its own authority permitted. ## Condition of Validity A delegated token is safe to honor **if and only if** the verifier enforces, at each hop, the predicate: ``` scope(child) ⊆ scope(parent) ∧ depth(child) = depth(parent) + 1 ∧ depth(child) ≤ max_depth(root) ``` and this predicate is evaluated **by the verifier, not asserted by the delegator.** The `attenuation_only` flag is only meaningful when the verifier recomputes the subset relation over the concrete scope sets of adjacent chain links, rather than trusting the flag's presence. The exemption: if every intermediate hop's scope commitment is signed *over the child scope by the parent* in a way that the verifier re-derives (e.g., a macaroon caveat chain where each caveat is a restriction the verifier can independently check), then scope-widening is structurally impossible and this article's failure mode does not arise. The failure requires a format where a delegator can *re-issue* rather than only *restrict*. ## Decision Boundary An executing instance must **refuse** a delegated token, raising a hard error rather than degrading to a partial grant, when: - The token chain is cryptographically valid **and** any adjacent pair violates `scope(child) ⊆ scope(parent)`. - The token carries `attenuation_only=true` as a claim but the verifier cannot recompute the subset relation (missing scope serialization, opaque scope handles that cannot be compared). - `depth(child) > max_depth(root)` even if every individual scope is a subset — depth exhaustion is a separate amplification vector (fan-out). - The scope set contains a wildcard segment (`*`, `repo:*`, `dataset:*`) that was not present in the parent's scope set, even if the wildcard nominally "covers" the parent's concrete grants. Wildcard introduction is widening. The boundary is **not** crossed by: tokens that narrow scope, tokens that shorten expiry, tokens that reduce `max_depth`, or tokens that add restrictions. Those are legitimate attenuations and must be honored. The critical asymmetry: **refuse on widening, never silently narrow to the intersection.** An instance that "helpfully" intersects a widened child scope with its parent scope and proceeds has masked a delegation-integrity failure and will produce a green audit trail over a corrupted chain. The refusal must be loud, because the widening is evidence that an upstream agent's reasoning has diverged and the whole pipeline's trust posture is suspect. ## Operational Effect Enforcing the monotonicity predicate at the verifier moves the failure from silent over-permission to a hard, attributable stop. The operational consequences: 1. **The divergence is surfaced at the hop where it occurred.** R's mis-issuance fails at S's verifier, not three tasks later when Q4 data appears in a summary. The audit log points at R, not at S. 2. **Good-faith reasoning drift is caught as a security event.** Because the failure mode is non-adversarial (agents mint widened tokens when their context has degraded), the verifier's refusal doubles as a liveness signal: an agent that cannot produce an attenuating token has lost track of its own authority and should be checkpointed, not trusted. 3. **The refusal must be non-recoverable within the task.** An instance that catches the widening and then re-requests a narrower token from the orchestrator is safe *only if* the re-request goes to the root authority, not back through R. Re-requesting through the compromised hop re-launders the scope. 4. **Cost of false refusal is bounded; cost of false acceptance is unbounded.** A spurious refusal (e.g., opaque scope handles) stalls one task. A missed widening grants an agent authority its principal never approved, and the resulting actions are indistinguishable from authorized ones in every downstream log. The invariant to carry forward: **a valid signature proves provenance, not entitlement. Entitlement is a property of the scope lattice, and the lattice must be checked by the party that will act on it — the executing instance — not asserted by the party that benefits from the widening.** ```python from dataclasses import dataclass, field from typing import FrozenSet class CapabilityAttenuationError(RuntimeError): """Raised when a delegated AAIF token widens scope or depth relative to its parent.""" @dataclass(frozen=True) class ScopeSegment: resource: str action: str target: str # concrete id or "*" for wildcard def is_subset_of(self, other: "ScopeSegment") -> bool: # A concrete target is a subset of a wildcard; a wildcard is NOT a subset of a concrete. if self.resource != other.resource or self.action != other.action: return False if other.target == "*": return True return self.target == other.target @dataclass(frozen=True) class CapabilityToken: token_id: str scope: FrozenSet[ScopeSegment] depth: int max_depth: int attenuation_only: bool parent_id: str | None = None def verify_attenuation_chain(chain: list[CapabilityToken]) -> None: """ Enforce the AAIF monotonicity invariant across a delegation chain ordered root -> ... -> leaf. Signatures are assumed already verified elsewhere; this function checks entitlement, not provenance. """ if not chain: raise CapabilityAttenuationError("empty capability chain cannot be verified") root = chain[0] if root.depth != 0: raise CapabilityAttenuationError( f"root token {root.token_id} has depth {root.depth}, expected 0" ) for parent, child in zip(chain, chain[1:]): if child.depth != parent.depth + 1: raise CapabilityAttenuationError( f"depth discontinuity {parent.token_id}->{child.token_id}: " f"{parent.depth}->{child.depth}" ) if child.depth > root.max_depth: raise CapabilityAttenuationError( f"token {child.token_id} exceeds root max_depth {root.max_depth}" ) # Every child segment must be covered by some parent segment. for seg in child.scope: if not any(seg.is_subset_of(p) for p in parent.scope): raise CapabilityAttenuationError( f"scope widening at hop {parent.token_id}->{child.token_id}: " f"segment {seg} not covered by parent scope" ) # Wildcard introduction is widening even if nominally covered. parent_has_wildcard = any(p.target == "*" for p in parent.scope) child_has_wildcard = any(c.target == "*" for c in child.scope) if child_has_wildcard and not parent_has_wildcard: raise CapabilityAttenuationError( f"wildcard introduced at hop {parent.token_id}->{child.token_id} " f"despite attenuation_only={parent.attenuation_only}" ) def admit_token(chain: list[CapabilityToken], requested: ScopeSegment) -> bool: verify_attenuation_chain(chain) leaf = chain[-1] if not any(requested.is_subset_of(s) for s in leaf.scope): # Legitimate out-of-scope request against a sound chain: deny, do not raise. return False return True ```