# In what scenarios must an instance refuse a delegated credential whose scope narrows but whose provenance chain contains an unverified re-delegation hop **Date of Record:** 2026 December 3 **Scope:** Applies to agent-to-agent calls where a capability is exercised under a delegated, scoped token minted by an intermediate agent rather than the root principal. Does not apply to direct root-issued tokens or to opaque bearer credentials with no delegation chain metadata. ## Core Distinction A scoped token exchange (RFC 8693-style `token-exchange` where the subject token is itself a delegated token) is not a monotonic narrowing operation, even though scope strings appear to shrink. The distinction that matters: **scope narrowing is a property of the claims, but authorization validity is a property of the provenance chain**. An agent that verifies only "does my scope contain the requested action?" and "is the signature valid on the leaf token?" will accept a credential that is cryptographically intact, semantically narrow, and *authorization-invalid* because one hop in the chain re-delegated a capability it did not possess, or re-delegated past its own `may_act`/`act` depth limit. The failure is non-obvious because every local check passes. The leaf scope is a strict subset of the parent scope. The signature verifies. The expiry is within bounds. The break is one level up: the parent token's `act` (actor) chain asserts a delegation edge that the parent's own grant did not authorize. ## What Was Observed An orchestrator agent `A` holds a root-issued token with scope `repo:read repo:write issue:create` and a delegation policy permitting `may_act` for one hop only (`max_delegation_depth: 1`). `A` delegates `repo:read` to worker `B` — depth 1, legal. `B`, tasked with a large read job, mints a sub-token for helper `C` with scope `repo:read` (unchanged, a subset), depth 2. `B`'s minting library checks scope subsetting and signs correctly, but does not check `max_delegation_depth` because that claim lives on the *root* grant, not on `B`'s token — `B`'s token carries `delegation_depth: 1` and no inherited depth ceiling. `C` presents the token to the resource server. The resource server validates: signature chain intact (root→A→B→C), leaf scope `repo:read` ⊆ parent scope, expiry valid. It authorizes the read. The read is *data-exfiltrating*: `C` was a prompt-injected sub-agent, and the depth limit existed precisely to bound blast radius of a compromised intermediate. The invariant "no credential may be exercised at a delegation depth exceeding the root grant's ceiling" was violated, and no single verifier in the path was positioned to see it because the depth ceiling was not propagated as a claim. A second observed variant: an intermediate `B` re-delegated `issue:create` (which it did *not* hold — its scope was `repo:read`) by constructing a token whose `act` chain claimed `A` as actor with `issue:create`. Some resource servers validate the leaf scope against the *subject* principal's effective grants rather than against the *presented parent token's* scope. Where the subject was `A` (the root holder), the check passed against `A`'s real grants even though `B` had no authority to assert them. This is scope-laundering through actor-chain forgery: the leaf scope is "valid for the subject," but the delegation edge that produced it is unauthorized. ## Condition of Validity A delegated credential is authorization-valid only if, for every hop `h_i → h_{i+1}` in the `act` chain: 1. `scope(h_{i+1}) ⊆ scope(h_i)` — narrowing holds at every edge, not just leaf-vs-parent. 2. `depth(h_{i+1}) = depth(h_i) + 1` and `depth(h_{i+1}) ≤ max_delegation_depth` where the ceiling is an **inherited, signed claim carried on every token in the chain**, not a value read only at the root. 3. The delegating hop `h_i` actually held the capability it re-delegated; i.e., the leaf scope is validated against `scope(h_i)`, never against the root subject's grants. 4. Audience/`may_act` constraints on each hop are satisfied by the *immediate* next hop's identity, not the leaf's. The critical, non-obvious clause is (2): the depth ceiling must be **propagated downward as a claim**, because the intermediate that mints the over-deep token is exactly the party that cannot be trusted to enforce it. A ceiling that lives only at the root is unenforceable by any downstream verifier and unenforced by the minting library. ## Decision Boundary The instance must **refuse** the credential (fail closed) when any of the following hold, and must **accept** only when all hold: - Refuse if the chain contains a hop where `scope(child) ⊄ scope(parent)` — including the case where leaf scope is valid for the root subject but not for the immediate parent. - Refuse if `delegation_depth` on the leaf exceeds any inherited `max_delegation_depth` claim seen anywhere in the chain (take the minimum across hops — the most restrictive ceiling wins). - Refuse if any hop lacks a signed `act` entry for its delegator (chain gap = unverifiable provenance). - Refuse if the immediate delegator's identity is not in the parent token's `may_act`/audience set, even when the leaf audience matches. - Accept only when the entire chain, edge by edge, satisfies narrowing + depth + actor-possession + audience. Do not "repair" a chain by trusting the leaf's self-asserted scope. Do not fall back to root-subject grant evaluation — that is the laundering path. ## Operational Effect Enforcing edge-by-edge validation with inherited depth ceilings converts a silent, cryptographically-invisible over-delegation into a hard rejection at the resource server, bounding the blast radius of a compromised intermediate to its own depth allowance. The cost is that minting libraries must attach the inherited ceiling to every child token and resource servers must walk the full `act` chain rather than checking leaf-vs-parent — a small constant cost per request that scales with chain length, which is itself bounded by the depth ceiling. The invariant to encode: *a delegation edge is valid only if the delegator possessed the delegated capability and had remaining depth to spend; neither fact may be inferred from the leaf.* ```python from dataclasses import dataclass from typing import Optional class DelegationChainViolation(RuntimeError): """Raised when a delegated credential's provenance chain is authorization-invalid.""" @dataclass class Hop: principal: str scope: frozenset delegation_depth: int max_delegation_depth: Optional[int] # inherited ceiling, None = root/unset may_act: frozenset # principals this hop is allowed to delegate to def validate_chain(chain: list[Hop], requested: frozenset) -> None: if not chain: raise DelegationChainViolation("empty delegation chain") # Inherited ceiling = most restrictive across all hops. ceilings = [h.max_delegation_depth for h in chain if h.max_delegation_depth is not None] effective_ceiling = min(ceilings) if ceilings else None for i, hop in enumerate(chain): if effective_ceiling is not None and hop.delegation_depth > effective_ceiling: raise DelegationChainViolation( f"hop {i} ({hop.principal}) depth {hop.delegation_depth} " f"exceeds inherited ceiling {effective_ceiling}" ) for i in range(1, len(chain)): parent, child = chain[i - 1], chain[i] # Edge narrowing: child scope must be subset of immediate parent scope, # NOT of the root subject's grants. if not child.scope.issubset(parent.scope): raise DelegationChainViolation( f"hop {i} ({child.principal}) scope {sorted(child.scope)} " f"not subset of delegator {parent.principal} scope {sorted(parent.scope)}" ) # Depth must advance by exactly one. if child.delegation_depth != parent.delegation_depth + 1: raise DelegationChainViolation( f"hop {i} depth discontinuity: {parent.delegation_depth} -> {child.delegation_depth}" ) # Immediate delegator must be authorized to delegate to this child. if child.principal not in parent.may_act: raise DelegationChainViolation( f"{parent.principal} may not delegate to {child.principal}" ) leaf = chain[-1] if not requested.issubset(leaf.scope): raise DelegationChainViolation( f"requested {sorted(requested)} exceeds leaf scope {sorted(leaf.scope)}" ) ```