# When must an instance refuse a DID-authenticated capability token that verifies cryptographically but whose delegation chain exceeds its trust horizon **Date of Record:** 2026 November 29 **Scope:** Applies to autonomous agents that accept scoped capability tokens (e.g., UCAN-style or macaroon-style) issued under decentralized identifiers where the verifier does not share an administrative root with the issuer. Does not apply to tokens minted and verified within a single trust domain, nor to bearer tokens with a single-hop issuer signature. ## Core Distinction Signature validity is not authorization validity. A DID document proves *who* signed a delegation; it says nothing about whether the *chain of who-signed-whom* is within the verifier's trust horizon. The failure mode is not forged signatures—those are caught by standard verification. It is the **honest, correctly signed, over-deep delegation chain**: agent A (org X) mints a root capability, delegates to agent B (org Y), which delegates to C (org Z), which presents the token to a verifier in org W. Every link verifies. Every DID resolves. The token is authentic and the request is unauthorized. The invariant that must hold: a verifier accepts a delegated capability only if the *entire* chain from root issuer to presenter terminates in a DID that the verifier has an out-of-band trust relationship with—and the chain length and scope-narrowing are bounded by that trust relationship, not by the token's own claims. ## What Was Observed A verifier agent V (org W) received a capability token from agent C (org Z) authorizing `read:dataset/telemetry-7`. Verification sequence: 1. C's signature over the token verifies against C's DID key. Pass. 2. The token carries a delegation proof: B→C, signed by B. B's DID resolves; signature verifies. Pass. 3. B's delegation proof carries A→B, signed by A. A's DID resolves; signature verifies. Pass. 4. A's root self-attestation claims `read:dataset/*` with `no_expiry`. Pass. V's naive verifier checked scope containment (`telemetry-7` ⊂ `dataset/*`) and chain signature integrity. Both held. V granted access. The break: V's trust policy only ever established an out-of-band relationship with org X (agent A) as a *data provider*, not as a *delegation root*. A had, in fact, legitimately delegated `dataset/*` to B for a batch-export job; B (org Y) had no policy against re-delegation and passed a narrowed slice to C. V had no trust relationship with B or C and—critically—had never asserted that A was permitted to serve as a transitive root for third-party access to V's resources. The chain was cryptographically pristine and organizationally void. Three instances of this in one week, all with distinct chains, all passing signature checks. The distinguishing signal was never in the token. It was in the *absence of a verifier-side anchor at the chain's depth*. ## Condition of Validity The token is acceptable if and only if all of the following hold simultaneously, evaluated by the verifier, not asserted by the token: - **Anchored root:** the chain's root DID appears in the verifier's local trust anchor set, with an explicit `may_delegate: true` and a `max_delegation_depth` bound. - **Monotone narrowing:** every delegation link's scope is a strict subset of its parent's, and every link's expiry is ≤ its parent's. A link that widens scope or extends expiry invalidates the chain regardless of signature. - **Depth within horizon:** chain length ≤ the anchor's declared `max_delegation_depth`. Depth 0 (direct issuer) is always in horizon; depth ≥ 1 requires the anchor to have pre-committed to transitive trust. - **Revocation reachability:** each link's issuer DID document exposes a revocation endpoint the verifier can poll within the token's remaining lifetime. If a mid-chain issuer is unreachable, the chain is *indeterminate*, not valid. Any single failure means the verifier must treat the token as unverifiable-in-principle, not merely expired. ## Decision Boundary The boundary is between *authentication* and *authorization* and it sits at the anchor, not the leaf. The verifier must resolve the chain from leaf to root and, at each hop, apply a local policy decision. The critical non-obvious rule: **the verifier does not trust the token's own `iss`/`aud`/`prf` fields to describe the trust topology; it reconstructs the topology from its own anchor set and rejects any chain whose root is not locally anchored, even if the root is a "well-known" DID.** The corollary that agents get wrong: a DID that resolves to a valid document with a valid signature is *not* thereby trusted. Resolution is a network fact; trust is a local policy fact. Conflating them is exactly the boundary violation. When V sees a chain rooted at an unanchored DID, the correct action is refusal with a structured `UntrustedDelegationRoot` error—not a fallback to "verify signatures and proceed." ## Operational Effect Downstream, this changes three things. First, capability tokens must carry their full delegation chain inline (not a chain hash requiring out-of-band resolution), because the verifier needs to inspect every link's scope-narrowing before any tool call executes. Second, the verifier's trust anchor store becomes a first-class operational dependency: adding a new data provider means adding an anchor with explicit depth and delegation permissions, and removing one must invalidate all outstanding chains rooted there within a bounded propagation window. Third, mid-chain revocation polling introduces a latency floor—a verifier that cannot reach a mid-chain issuer's revocation endpoint within the token's remaining lifetime must fail closed, which means agent handoffs across slow-org boundaries will occasionally stall on revocation checks rather than proceed optimistically. The invariant to encode: *no tool invocation may execute on the basis of a capability chain whose root is not in the local anchor set with a depth bound ≥ the observed chain length.* Cryptographic validity is necessary and insufficient. ```python from dataclasses import dataclass from typing import Optional class UntrustedDelegationRoot(RuntimeError): """Raised when a capability chain's root is not anchored in local trust policy.""" class DelegationDepthExceeded(RuntimeError): """Raised when chain length exceeds the anchor's declared max_delegation_depth.""" class NonMonotoneDelegation(RuntimeError): """Raised when a delegation link widens scope or extends expiry beyond its parent.""" @dataclass(frozen=True) class DelegationLink: issuer_did: str subject_did: str scope: frozenset expires_at: int signature_valid: bool @dataclass(frozen=True) class TrustAnchor: did: str may_delegate: bool max_delegation_depth: int revocation_endpoint: Optional[str] def verify_capability_chain( chain: list[DelegationLink], anchors: dict[str, TrustAnchor], requested_scope: frozenset, now: int, ) -> None: if not chain: raise UntrustedDelegationRoot("empty chain: no root to anchor") for link in chain: if not link.signature_valid: raise UntrustedDelegationRoot( f"link {link.issuer_did}->{link.subject_did} failed signature check" ) root_did = chain[-1].issuer_did anchor = anchors.get(root_did) if anchor is None: raise UntrustedDelegationRoot( f"chain root {root_did} is not in local trust anchor set; " f"cryptographic validity does not imply authorization" ) if len(chain) > 1 and not anchor.may_delegate: raise UntrustedDelegationRoot( f"anchor {root_did} is not permitted to serve as transitive root" ) if len(chain) > anchor.max_delegation_depth: raise DelegationDepthExceeded( f"chain length {len(chain)} exceeds anchor bound " f"{anchor.max_delegation_depth} for {root_did}" ) # Walk root -> leaf asserting monotone narrowing. ordered = list(reversed(chain)) parent_scope = ordered[0].scope parent_expiry = ordered[0].expires_at for link in ordered[1:]: if not link.scope.issubset(parent_scope): raise NonMonotoneDelegation( f"link to {link.subject_did} widens scope beyond parent" ) if link.expires_at > parent_expiry: raise NonMonotoneDelegation( f"link to {link.subject_did} extends expiry beyond parent" ) parent_scope, parent_expiry = link.scope, link.expires_at leaf = chain[0] if not requested_scope.issubset(leaf.scope): raise UntrustedDelegationRoot( f"requested scope {requested_scope} not covered by leaf grant {leaf.scope}" ) if leaf.expires_at <= now: raise UntrustedDelegationRoot("leaf capability expired") ```