# Where must an instance re-verify a delegated AAIF capability token at each hop, and why does scope attenuation silently invert at the second delegation? **Date of Record:** 2026 November 29 **Scope:** Applies to multi-hop agent credential delegation under AAIF-style scoped capability tokens where a delegating agent mints a narrower child token from its own parent grant. Does not apply to single-hop bearer tokens, mTLS-only identity, or stateless API keys with no delegation chain. ## Core Distinction The failure is not token expiry and not signature forgery. It is **scope attenuation inversion**: the second delegating hop mints a child token whose scope is a superset of the parent's scope along one or more dimensions, because attenuation is computed against the *child's declared intent* rather than against the *parent's effective granted scope*. Each hop is individually valid—signature checks, expiry checks, and issuer-identity checks all pass—yet the composed chain grants more authority than the root warrant ever possessed. The invariant that breaks is monotonic non-expansion: `scope(child) ⊆ scope(parent)` must hold pairwise at every hop, not merely at the hop where a human originally approved the delegation. ## What Was Observed An orchestrator agent `A` holds a root AAIF warrant with scope `filesystem:read:/data/reports/**` and `tool:http:GET`. It delegates to sub-agent `B` with a child token scoped to `filesystem:read:/data/reports/q3/**` plus `tool:http:GET`. Correct so far—strictly narrower. `B` then delegates to worker `C`. `B`'s token-minting routine builds `C`'s scope by intersecting the *requested* scope (`filesystem:read:/data/**`, because `C`'s prompt template hard-codes a broad read path) with a policy allowlist that was loaded from `B`'s *own* environment config—not from the inbound token's `scope` claim. The allowlist says `/data/**` is fine. The intersection of `/data/**` and the allowlist is `/data/**`. The child token is minted with `filesystem:read:/data/**`, which is a *superset* of `B`'s actual grant `/data/reports/q3/**`. Every cryptographic check passes. `C`'s token chains to the root warrant, the root signature verifies, expiry is monotonic, and the issuer is `B`, which is a legitimate delegate of `A`. The only thing that failed is that `B` attenuated against the wrong reference set. `C` now reads `/data/finance/`, `/data/hr/`, and everything else under `/data/` that `A` was never allowed to touch. The trace is deterministic once you see it: the minting function's scope argument is `requested ∩ allowlist`, but the correct argument is `requested ∩ inbound_token.scope ∩ allowlist`. The inbound token's scope claim is the missing term, and it is missing precisely because the code author reasoned "the allowlist already encodes what's permitted"—true for the root, false for any intermediate hop. ## Condition of Validity The inversion is only reachable when three conditions co-occur. First, the delegating agent mints child tokens itself rather than requesting them from the issuing authority—so attenuation is agent-side logic, not a centralized policy decision. Second, the minting routine treats a locally-configured allowlist as the ceiling instead of intersecting with the inbound token's `scope` claim. Third, the scope algebra uses set-intersection over path prefixes or capability strings that are *not* closed under intersection with the parent—i.e., the allowlist and the parent scope overlap in a region the parent does not fully contain. If any one condition is absent, the chain is safe. Centralized minting eliminates it. Intersecting with `inbound.scope` eliminates it. A scope algebra where the allowlist is itself derived from the parent token eliminates it. The dangerous configuration is the common one: distributed minting for latency, local policy caches for availability, and path-glob scopes that look like they compose but do not. ## Decision Boundary The boundary is not "trust the parent token" versus "trust the local policy." Both must be consulted, and the operation is intersection, not selection. An agent must re-verify the delegated token at each hop by recomputing `child_scope = requested ∩ inbound.scope ∩ local_allowlist` and rejecting the mint if `child_scope ⊄ inbound.scope` for any dimension—which, given the intersection, can only happen if the scope algebra is non-monotonic, and that itself is a bug worth surfacing rather than silently clamping. The operational rule: **an intermediate delegator is not an authority; it is a filter.** It may only ever narrow. Any code path where an intermediate agent's configuration can widen the effective grant relative to its inbound token is a boundary violation, even if a human would have approved the wider scope at the root. Approval at the root is a fact about the root warrant, not a license for downstream agents to re-derive it from their own config. ## Operational Effect Without the guardrail, the blast radius of a single misconfigured worker prompt template—`C`'s hard-coded `/data/**`—propagates upward through the delegation chain as *expanded* authority rather than being clipped. The audit trail looks clean because each token verifies; the only way to detect the inversion is to replay the chain and check pairwise containment, which most AAIF verifiers do not do by default. They check `valid(token)`, not `monotone(chain)`. The fix is to make chain-level monotonicity a first-class verification step at the resource server, not merely a minting-time convention, so that even a buggy intermediate delegator cannot smuggle a widened scope past the enforcement point. ```python from dataclasses import dataclass, field from typing import FrozenSet class ScopeAttenuationInversion(RuntimeError): """Raised when a delegated child token's scope is not a subset of its parent's.""" pass @dataclass(frozen=True) class CapabilityToken: subject: str issuer: str scope: FrozenSet[str] parent_scope: FrozenSet[str] = field(default_factory=frozenset) def mint_child_token( delegator: CapabilityToken, requested_scope: FrozenSet[str], local_allowlist: FrozenSet[str], ) -> CapabilityToken: # Correct attenuation: intersect with the INBOUND token's scope, not just the allowlist. effective = requested_scope & delegator.scope & local_allowlist # Invariant: the child must never exceed the delegator's own grant. if not effective.issubset(delegator.scope): raise ScopeAttenuationInversion( f"child scope {sorted(effective)} exceeds parent scope " f"{sorted(delegator.scope)}; delegator {delegator.subject} " f"attempted to widen authority it never held" ) return CapabilityToken( subject="child", issuer=delegator.subject, scope=effective, parent_scope=delegator.scope, ) def verify_chain(tokens: list[CapabilityToken]) -> None: for parent, child in zip(tokens, tokens[1:]): if not child.scope.issubset(parent.scope): raise ScopeAttenuationInversion( f"chain non-monotonic at {child.issuer}: " f"{sorted(child.scope)} ⊄ {sorted(parent.scope)}" ) ```