# When must an instance refuse a delegated credential chain: scope attenuation collapse under re-delegation depth in AAIF token exchange **Date of Record:** 2026 November 28 **Scope:** Applies to any agent runtime that accepts delegated authorization credentials (AAIF-style scoped tokens, macaroon-style attenuable tokens, or OAuth token-exchange chains) where a downstream instance may re-delegate a subset of its authority to a further instance. Does not apply to single-hop bearer tokens issued directly by a root authority to a leaf agent with no intermediate delegation. ## Core Distinction The distinction that matters is between *scope attenuation* (a child credential's permission set is a strict subset of the parent's) and *scope attenuation collapse* (a child credential whose permission set is a subset in *set terms* but whose *effective* permissions, once the verifier resolves transitive delegation, exceed or diverge from the parent). Attenuation is a set-containment property enforced at issue time. Collapse is a resolution-time property that depends on how the verifier walks the chain and how each hop's scope was *interpreted*. The failure is non-obvious because every individual hop looks correct. Hop A→B narrows `read,write,files:/tmp` to `read,files:/tmp`. Hop B→C narrows to `read,files:/tmp/scratch`. Set containment holds at every step. The credential chain is cryptographically intact. And yet the leaf C can do something the root A never authorized—because the *semantics* of `files:/tmp` were re-bound at hop B by an instance whose working directory, mount namespace, or path-resolution policy differed from A's. ## What Was Observed A three-instance pipeline: orchestrator O holds a root credential scoped to `repo:acme/*`, `action:read`, `action:propose_patch`. O delegates to a planning agent P a token scoped to `repo:acme/widgets`, `action:read`, `action:propose_patch`, with an attenuation proof (`sig_O`, parent hash, scope delta). P delegates to a code-execution agent X a token scoped to `repo:acme/widgets/src`, `action:propose_patch` only. The chain verified. Every signature checked. Every parent-hash link matched. Set containment held at both hops. Two hours later, X's proposals landed against `repo:acme/widgets/src/../../secrets`. The path was inside `repo:acme/widgets/src` under a naive prefix check, but the downstream authorization service normalized the path *after* the scope check, and the normalization resolved `..` against a mount that placed `secrets` as a sibling of `src`. The scope `repo:acme/widgets/src` was interpreted by P as a lexical prefix and by the enforcement point as a *resolved* directory subtree. Neither interpretation was wrong in isolation; the chain never carried the interpretation. The root cause: scope attenuation was checked as *string containment over scope atoms*, but the atoms were not canonicalized, and no hop recorded which normalization regime it assumed. Two instances with different path-resolution policies produced a chain that was locally valid at every link and globally unsound at the leaf. A second observed instance: an A2A handoff where the delegating agent attenuated a token by *removing* `action:write` but the downstream verifier's policy engine treated "absence of `action:write`" as "inherit from parent," because the parent credential's claim set was merged into the child's during resolution. The child was strictly narrower on paper and strictly wider at enforcement. The merge step was an implementation detail of the verifier, invisible to both delegating agents. ## Condition of Validity A delegated credential chain is sound only if all three of the following invariants hold simultaneously: 1. **Canonical scope representation.** Every scope atom in every hop is expressed in a canonical form, and the canonicalization function is part of the credential schema, not the verifier. A hop that cannot canonicalize an atom must refuse to delegate it rather than pass it through opaquely. 2. **Monotone interpretation binding.** Each hop records the *interpretation regime* it assumed for each atom (e.g., "path atoms are lexical prefixes," "repo atoms are case-sensitive," "action atoms are closed-world"). A child hop may only narrow within the parent's regime; if it needs a different regime, it must re-derive the atom from a canonical root, not inherit the parent's string. 3. **Closed-world claim resolution.** The verifier must treat the child's claim set as complete, never merging parent claims into child claims at resolution time. Parent claims are reachable only through explicit re-delegation, never through implicit inheritance. If any of these fails, set containment is not sufficient for soundness. The chain is *locally valid and globally unsound*, which is the worst possible failure mode because every audit log shows green checks at every hop. ## Decision Boundary The decision boundary is at the moment a delegating instance is about to issue a child credential. The instance must answer: *can I express the narrowed scope in the same canonical form and interpretation regime as my own credential, without loss?* - If yes: delegate, and embed the canonical form plus the regime tag in the child's attenuation proof. - If no, but the narrowing is expressible in a *finer* regime that is a strict refinement of the parent's: delegate, but the child must carry the refinement as an explicit regime upgrade, and the verifier must reject any enforcement point that cannot honor the refined regime. - If no, and the narrowing requires a regime the parent did not authorize: **refuse the delegation**. Do not issue a child credential whose scope string is a subset but whose interpretation diverges. This refusal is the invariant. An instance that cannot preserve interpretation must not delegate; it must instead request a fresh root credential from the authority that owns the target regime. The boundary is sharp because the alternative—delegating and hoping the verifier's regime matches—is exactly the collapse observed above. The delegating instance is the only point in the chain that knows both the parent's regime and the intended child's regime. The verifier cannot recover this information because it was never transmitted. ## Operational Effect Enforcing the refusal invariant changes delegation behavior in three concrete ways. First, cross-regime delegations (e.g., an agent whose filesystem view is chrooted delegating to an agent whose view is a bind mount) become explicit re-authorization events rather than silent scope narrowing. This adds a round-trip to the root authority but eliminates the class of path-escape collapses. Second, attenuation proofs grow a regime tag per atom, roughly doubling token size for path-heavy scopes; this is the cost of making interpretation auditable. Third, and most importantly, the audit log becomes *falsifiable*: a green check at every hop now means something, because the check includes regime compatibility rather than string containment alone. The failure to avoid is the tempting shortcut: "the child's scope is a string subset of mine, therefore it is safe to delegate." That shortcut is correct only when both hops share a canonicalization function and an interpretation regime, and in a multi-agent system with heterogeneous runtimes, that condition is the exception, not the default. The instance that delegates across a regime boundary without refusing is the instance that launders authority. ```python from dataclasses import dataclass from typing import FrozenSet, Optional class DelegationRefused(RuntimeError): """Raised when a delegating instance cannot preserve scope interpretation across a hop and must refuse to issue a child credential.""" @dataclass(frozen=True) class ScopeAtom: kind: str # e.g. "path", "repo", "action" value: str # canonical form regime: str # interpretation regime tag, e.g. "lexical-prefix", "resolved-subtree" def canonical(self) -> "ScopeAtom": # Canonicalization must be total; unknown kinds are not silently passed. if self.kind == "path": # Reject atoms that cannot be canonicalized without a regime. if ".." in self.value.split("/"): raise DelegationRefused( f"path atom {self.value!r} contains '..'; canonical form " f"requires a resolution regime and cannot be delegated opaquely" ) return ScopeAtom("path", self.value.rstrip("/"), self.regime) if self.kind in ("repo", "action"): return ScopeAtom(self.kind, self.value.lower(), self.regime) raise DelegationRefused(f"unknown scope atom kind {self.kind!r}") @dataclass(frozen=True) class Credential: subject: str atoms: FrozenSet[ScopeAtom] parent_hash: Optional[str] signature: str def delegate(parent: Credential, child_subject: str, narrowed: FrozenSet[ScopeAtom]) -> Credential: """Issue a child credential only if attenuation is sound under the canonicalization + regime-binding + closed-world invariants.""" canon_parent = frozenset(a.canonical() for a in parent.atoms) canon_child = frozenset(a.canonical() for a in narrowed) # Invariant 1: set containment over canonical atoms. if not canon_child <= canon_parent: extra = canon_child - canon_parent raise DelegationRefused( f"child scope not a subset of parent; extra atoms: {extra!r}" ) # Invariant 2: every child atom must share its parent's regime, or the # child must be a strict refinement that the verifier can honor. parent_regimes = {a.kind: a.regime for a in canon_parent} for atom in canon_child: parent_regime = parent_regimes.get(atom.kind) if parent_regime is None: raise DelegationRefused( f"child atom kind {atom.kind!r} absent from parent; " f"cannot bind interpretation" ) if atom.regime != parent_regime: raise DelegationRefused( f"regime divergence on {atom.kind!r}: parent={parent_regime!r} " f"child={atom.regime!r}; refusing cross-regime delegation — " f"request a fresh root credential for regime {atom.regime!r}" ) # Invariant 3: child claim set is closed-world; no parent atoms are # merged in at resolution time. Encoded here as: the child carries # exactly canon_child, nothing inherited. return Credential( subject=child_subject, atoms=canon_child, parent_hash=hash(frozenset(canon_parent)), signature=f"sig({child_subject})", ) def verify_chain(leaf: Credential, root: Credential) -> bool: """Resolution-time check: reject any chain whose hops disagree on regime.""" seen = {root} current = leaf while current.parent_hash is not None: parent = next((c for c in seen if hash(frozenset( a.canonical() for a in c.atoms)) == current.parent_hash), None) if parent is None: raise DelegationRefused( f"broken parent link at subject {current.subject!r}" ) parent_regimes = {a.kind: a.regime for a in parent.atoms} for atom in current.atoms: if parent_regimes.get(atom.kind) != atom.regime: raise DelegationRefused( f"regime mismatch resolving {current.subject!r} against " f"{parent.subject!r} on {atom.kind!r}" ) seen.add(parent) current = parent return True ```