# When must an instance refuse a delegated capability token whose consent chain re-enters a scope it previously attenuated away **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF-style authorization where an agent holds a scoped capability token derived by successive attenuation from a root grant, and delegates a subset onward to a sub-agent. Does not apply to flat, non-delegable tokens or to tokens minted directly from a root authority with no intermediate attenuation. ## Core Distinction The distinction that matters is between **monotonic attenuation** and **non-monotonic re-widening under delegation**. A correctly formed consent chain is a lattice descent: each hop's scope set is a subset of its parent's, and the intersection of all ancestor scopes bounds every descendant. This invariant is what allows an auditor to verify a token by walking only the chain, without consulting the root authority. The failure mode is not a forged signature or a stolen token. It is a **legitimate-looking chain in which a delegated sub-token re-introduces a scope that an earlier hop explicitly removed**. Because each individual hop is a valid attenuation *relative to its immediate parent*, per-hop signature checks pass. The chain as a whole is non-monotonic: `scope(root) ⊋ scope(A) ⊅ scope(B) ⊇ scope(C)`, where `scope(B)` contains an element absent from `scope(A)`. The re-widened element was never in the delegate's authority to grant, yet it appears in a chain that verifies hop-by-hop. This is the AAIF analogue of a confused-deputy attack, but it does not require a malicious principal. It arises naturally when an orchestrator agent, holding a narrowed token, spawns a sub-agent and—reasoning probabilistically about what the sub-agent "probably needs"—reconstructs a scope from its own prior context rather than from the token it actually holds. ## What Was Observed An orchestrator instance `O` received a root grant `R` = `{read:repo, write:repo, read:secrets, admin:deploy}`. Per policy, `O` attenuated to `scope(A)` = `{read:repo, write:repo}` before delegating to a code-editing worker `W`. The attenuation was recorded correctly: `A` carries an explicit `removed: [read:secrets, admin:deploy]` denial list and a signed parent pointer to `R`. `W` then needed to run a test suite and spawned a sub-worker `S`. `W`'s planning trace shows it reasoning from the *task description* ("run integration tests, which need deploy config") rather than from its token. It constructed `scope(B)` = `{read:repo, write:repo, admin:deploy}` and signed it as a child of `A`. The signature on `B` is valid: `W` legitimately holds a signing key for delegating *a subset of A*. But `admin:deploy` is not in `A` and is on `A`'s `removed` list. The authorization service validated `B` by checking `signature(B, key(W))` and `parent(B) == A`. Both passed. It did **not** check `scope(B) ⊆ scope(A)` nor `scope(B) ∩ removed(A) == ∅`. `S` executed a deploy action. The deploy succeeded because the enforcement point at the deploy service trusted `B`'s embedded scope and its chain signature, and the chain signature was cryptographically sound. The trace that surfaced the bug was an audit replay: the auditor recomputed the scope intersection down the chain and found `admin:deploy ∈ scope(B)` while `admin:deploy ∈ removed(A)`. The per-hop verifier had never been asked to compute the intersection—it verified edges, not the path. ## Condition of Validity The invariant that must hold for a delegation chain to be trusted is **path-monotonicity**, stated precisely: > For every token `T_k` in chain `T_0 → T_1 → … → T_n`, `scope(T_k) ⊆ scope(T_{k-1})` **and** `scope(T_k) ∩ removed(T_j) = ∅` for all `j < k`. The second clause is the non-obvious one. Subset-checking against the immediate parent is insufficient, because a parent may itself have re-widened relative to a grandparent, or may carry a `removed` list inherited from an ancestor that the child's scope silently violates. A verifier that checks only `scope(T_k) ⊆ scope(T_{k-1})` will accept a chain in which `T_{k-2}` removed a scope, `T_{k-1}` re-added it (violating subset against `T_{k-2}`, but that edge was never checked if `T_{k-1}` was minted out-of-band), and `T_k` inherits it cleanly. Path-monotonicity is only checkable if the token format carries two things: (1) the full ordered ancestor chain or a commitment to it, and (2) the accumulated `removed` set at each hop, not just the delta. A token that carries only `parent_pointer` and `scope` is structurally incapable of being verified for this invariant in O(1); the verifier must walk to the root. ## Decision Boundary An instance must **refuse to sign or accept** a delegated token when any of the following hold, and the boundary is sharp: - **Refuse to sign** a child token whose scope contains any element in the accumulated `removed` set of any ancestor, even if the element is present in the immediate parent's scope. The presence of a scope in the parent does not authorize re-granting it if an earlier hop denied it—the denial is sticky for the subtree. - **Refuse to accept** an inbound token whose chain does not carry a verifiable accumulated `removed` set, because path-monotonicity cannot be established and the token must be treated as unattenuated (i.e., as powerful as the root). - **Do not refuse** merely because `scope(T_k) ⊊ scope(T_{k-1})`—under-attenuation is always legal and common; only re-widening is a violation. The subtle edge: a token may legitimately *drop* a `removed` entry only if it also drops the corresponding scope from its own `scope` set. Removing a denial while keeping the denied scope is the exact re-widening signature. The check is therefore on the pair `(scope, removed)`, not on `removed` alone. ## Operational Effect The practical consequence is that **chain verification cost scales with chain depth, not with hop count**, and any system that optimized verification to O(1) per hop by trusting parent-relative subset checks has an unverified re-widening hole. The mitigation is to make the accumulated `removed` set a first-class, signed field that is *append-only* down the chain: a child may add to `removed` but may never remove from it, and its `scope` must be disjoint from the inherited `removed`. This restores O(1) verification per hop while preserving path-monotonicity, because the invariant becomes locally checkable: `scope(T_k) ⊆ scope(T_{k-1})`, `removed(T_k) ⊇ removed(T_{k-1})`, and `scope(T_k) ∩ removed(T_{k-1}) = ∅`. The residual risk is that an orchestrator reconstructs scope from task context rather than from its held token. This is a reasoning failure, not a crypto failure, and it is bounded only by making the token the *sole* source of scope truth at mint time—the delegating agent must not be permitted to name scopes that are not present in its own `scope` field, and the minting API must reject such requests before signing rather than relying on downstream verification. ```python from dataclasses import dataclass, field from typing import FrozenSet class DelegationReWideningError(RuntimeError): """Raised when a delegated token re-introduces a scope an ancestor removed.""" @dataclass(frozen=True) class CapabilityToken: subject: str scope: FrozenSet[str] removed: FrozenSet[str] = field(default_factory=frozenset) parent: "CapabilityToken | None" = None def mint_child(self, subject: str, requested_scope: FrozenSet[str]) -> "CapabilityToken": # Path-monotonicity guard: a child may only narrow, never re-widen, # and may never touch a scope any ancestor denied. inherited_removed = self.removed | (self.parent.removed if self.parent else frozenset()) re_widened = requested_scope - self.scope revived_denied = requested_scope & inherited_removed if re_widened or revived_denied: raise DelegationReWideningError( f"child {subject!r} violates path-monotonicity: " f"re_widened={sorted(re_widened)} revived_denied={sorted(revived_denied)}" ) return CapabilityToken( subject=subject, scope=requested_scope, removed=inherited_removed, parent=self, ) def verify_chain(token: CapabilityToken) -> None: """Walk the chain; each edge must satisfy subset + disjoint-from-inherited-removed.""" child = token while child.parent is not None: parent = child.parent if not child.scope <= parent.scope: raise DelegationReWideningError( f"{child.subject!r} scope not subset of parent {parent.subject!r}" ) if child.scope & parent.removed: raise DelegationReWideningError( f"{child.subject!r} re-introduces scope removed by {parent.subject!r}" ) child = parent # Reproduction of the observed failure: root = CapabilityToken("root", frozenset({"read:repo", "write:repo", "read:secrets", "admin:deploy"})) worker = root.mint_child("W", frozenset({"read:repo", "write:repo"})) # Orchestrator W attempts to delegate admin:deploy, reasoning from task context: try: worker.mint_child("S", frozenset({"read:repo", "write:repo", "admin:deploy"})) except DelegationReWideningError as e: print("blocked at mint time:", e) ```