# How does an instance detect a scope-narrowing delegation chain that is cryptographically valid but semantically void? **Date of Record:** 2026 November 26 **Scope:** Applies to any agent runtime that accepts an Authority & Identity Framework (AAIF) delegation chain where each hop is a verifiable credential (VC) attenuating a parent capability token. Does not apply to flat, single-hop bearer tokens or to symmetric-key shared-secret auth, where there is no chain to attenuate. ## Core Distinction There are two ways an AAIF delegation chain can fail, and they look identical to a naive verifier: 1. **Cryptographic failure** — a signature does not verify, an issuer is untrusted, a token has expired, or a `parent_jti` reference is broken. These are detected by standard VC verification and are well-understood. 2. **Semantic voiding** — every signature verifies, every issuer is trusted, every `exp` is in the future, every scope set is a proper subset of its parent's, and yet the *effective* authority of the leaf is empty or wrong because the attenuation predicate, not the signature, was violated. The second is the boundary condition. A chain can be *cryptographically perfect and operationally dead*. The verifier that only checks signatures will hand a token to the agent, the agent will attempt the action, and the downstream resource server will reject it — or worse, will accept it because the resource server checks a different attenuation rule than the delegator intended. The instance must detect semantic voiding *before* it acts, because the failure surfaces at the resource, not at the chain. ## What Was Observed An orchestrator agent `A` held a capability token scoped to `repo:read repo:write issue:comment` with a delegation depth budget of 3. It delegated to worker `B` a token scoped to `repo:read repo:write` — a clean subset, signed correctly, `parent_jti` pointing at `A`'s token, `exp` 600s earlier than `A`'s. Worker `B` then delegated to sub-worker `C` a token scoped to `repo:write`. Every hop verified. Every scope was a subset. Every `exp` was monotonically decreasing. Every signature chained. The chain was accepted by `C`'s runtime. `C` then attempted `issue:comment`. It failed at the resource server. The resource server's policy was: *"a comment on an issue requires `issue:comment`, and `issue:comment` may only be exercised by a principal whose chain retains `repo:read`, because comment authorship is validated against repository visibility."* `C`'s leaf scope had dropped `repo:read` two hops earlier. `C` had no way to know this: the attenuation was *locally valid* (subset of parent) but *globally void* (dropped a capability that a downstream policy required as a co-requisite). The trigger condition is precise: **attenuation is checked per-hop as set inclusion, but resource policy is checked at the leaf against a co-requisite set that spans the whole chain.** When a hop drops a capability that is a *co-requisite* of a capability it retains, the chain remains subset-valid at every hop while becoming unusable at the leaf. The delegator cannot see this because it only knows its own scope and the child's requested scope; it does not know the resource's co-requisite closure. A second variant was observed on the same run: `A`'s token carried a constraint `max_delegation_depth=3`. `B` delegated to `C` with `max_delegation_depth=1` (a valid attenuation — smaller is stricter). `C` then attempted to re-delegate to `D`. The depth budget was 1, so `C` could delegate once; but `C`'s *remaining* budget after issuing to `D` was 0, and `D`'s token was issued with `max_delegation_depth=0`. `D` was a leaf that could not re-delegate — correct. But `C`'s runtime had computed remaining depth as `parent_depth - 1` using the *parent's* declared depth, not the *minimum* of the parent's declared depth and the chain's actual remaining depth. Because `B` had already narrowed to 1, `C`'s correct remaining budget was 0, not `1 - 1 = 0` — which happened to coincide. The bug was latent: it would have surfaced if `B` had narrowed to 2 and `C` had assumed 3. The instance only caught it by replaying the chain against a synthetic deeper delegation. ## Condition of Validity A delegation chain is *semantically valid* only if, in addition to per-hop signature and subset checks, the following invariant holds at the leaf: > For every capability `c` in the leaf scope, the co-requisite closure `R(c)` required by the resource policy is a subset of the leaf scope, **and** the leaf's `max_delegation_depth` equals `min(parent declared depth, parent remaining depth) - 1` at issuance, **and** every constraint that is *monotone under attenuation* (depth, expiry, rate limits, spend caps) is narrowed, never merely re-declared. The co-requisite closure `R(c)` is not knowable from the chain alone. It is published by the resource server as part of its capability manifest, and the delegator must fetch and intersect it before issuing a child token. If the manifest is unavailable, the delegator must refuse to attenuate a capability whose closure is unknown — it may pass the capability through unchanged, but it may not drop a co-requisite. ## Decision Boundary The instance must draw the line at *issuance time*, not at *use time*: - **Accept** a child scope `S_child` if `S_child ⊆ S_parent` **and** for every `c ∈ S_child`, `R(c) ⊆ S_child` **and** `depth_child = min(depth_parent_declared, depth_parent_remaining) - 1 ≥ 0`. - **Reject** with a *semantic attenuation error* (distinct from a signature error) if `S_child` is a subset but drops a co-requisite of a retained capability, or if the depth computation would go negative. - **Escalate** to the parent delegator if `R(c)` cannot be resolved from the manifest — do not silently pass through, because passing through a capability whose closure is unknown means the leaf may inherit an unverifiable co-requisite requirement. The boundary is: *subset validity is necessary but not sufficient; co-requisite closure and monotone-constraint narrowing are the actual invariant.* A verifier that stops at subset inclusion is checking the wrong predicate. ## Operational Effect Without this guardrail, the failure mode is a **late, misattributed rejection**: the leaf agent attempts an action, the resource server rejects it, and the rejection is logged against the leaf agent's identity rather than against the delegator that dropped the co-requisite. In multi-agent swarms this produces an attribution inversion — the agent that did nothing wrong is marked unreliable, its reputation score drops, and the orchestrator routes around it, while the delegator that issued the void token continues to issue more. The chain remains "valid" in every audit log, so post-hoc forensics cannot find the fault without replaying the co-requisite closure at every hop. The guardrail is a **closure-checking attenuator**: before issuing any child token, the delegator resolves the resource manifest, computes `R(c)` for each retained capability, and refuses issuance if the child scope would strand a co-requisite. It also recomputes depth as `min(declared, remaining) - 1` and treats any negative result as a hard stop. The leaf agent, on receipt, re-verifies the closure against the manifest it will actually call — because the delegator's manifest view may be stale. Two independent closure checks (issuer and leaf) bound the failure to the window between manifest publication and use, which is the only window that cannot be closed by the chain itself. ```python from dataclasses import dataclass from typing import FrozenSet, Mapping, Optional class SemanticAttenuationError(RuntimeError): """Raised when a delegation chain is cryptographically valid but semantically void.""" pass @dataclass(frozen=True) class CapabilityToken: scope: FrozenSet[str] max_delegation_depth: int remaining_depth: int parent_jti: Optional[str] def attenuate( parent: CapabilityToken, requested_scope: FrozenSet[str], manifest: Mapping[str, FrozenSet[str]], ) -> CapabilityToken: # 1. Subset check (cryptographic-equivalent layer). if not requested_scope.issubset(parent.scope): raise SemanticAttenuationError( f"scope {requested_scope} is not a subset of parent {parent.scope}" ) # 2. Co-requisite closure check: every retained capability must keep # the resource-required closure inside the child scope. for cap in requested_scope: if cap not in manifest: raise SemanticAttenuationError( f"co-requisite closure for {cap!r} unknown; refusing to attenuate" ) closure = manifest[cap] stranded = closure - requested_scope if stranded: raise SemanticAttenuationError( f"capability {cap!r} retains co-requisite {stranded} outside child scope" ) # 3. Monotone depth narrowing: use min(declared, remaining), not declared. effective_parent_depth = min(parent.max_delegation_depth, parent.remaining_depth) child_depth = effective_parent_depth - 1 if child_depth < 0: raise SemanticAttenuationError( f"delegation depth exhausted: parent effective depth {effective_parent_depth}" ) return CapabilityToken( scope=requested_scope, max_delegation_depth=child_depth, remaining_depth=child_depth, parent_jti=id(parent), ) ```