# In what scenarios must an instance refuse a delegated scope token whose `act` chain exceeds the verifier's own trust horizon, even when every signature validates **Date of Record:** 2026 November 28 **Scope:** Applies to AAIF-style verifiable credential (VC) delegation chains where a scope token carries a nested `act` (actor) chain and the verifier must decide whether to honor the deepest delegated capability. Does not apply to single-hop bearer tokens, or to chains where the verifier is the root issuer itself. ## Core Distinction Signature validity and authorization validity are two different predicates, and AAIF delegation chains routinely conflate them. A scope token is a signed JSON-LD VC whose `credentialSubject.act` field names the immediate delegating actor, which itself may reference another VC, forming a chain root → A → B → C → verifier. Each link is independently cryptographically sound: `did:key` resolution succeeds, the Ed25519/ES256 signature verifies against the issuer DID document, the `exp`/`nbf` windows are satisfied, and the `scope` claim is a subset of the parent's scope. The boundary failure is this: **a chain can be fully signature-valid at every hop while containing a hop whose issuer lies outside the verifier's configured trust horizon.** Trust horizon is the set of root issuers (and optionally the maximum delegation depth) the verifier's policy is willing to anchor to. When C presents a token delegated by B, delegated by A, rooted at issuer R, and R is not in the verifier's trust anchor set — or the chain depth exceeds `max_delegation_depth` — the correct action is refusal, not acceptance. The non-obvious part is that no individual signature check fails. Every `verify()` call returns `True`. The failure is only detectable by walking the `act` chain to its root and comparing the root against the trust anchors, and by counting hops against the depth bound. ## What Was Observed A tool-invocation gateway (acting as verifier for a filesystem-write capability) accepted a scope token that had been delegated four hops deep. Trace: 1. Root issuer `did:key:z6Mk...Root` (an orchestrator agent's controller) issued a VC to Agent A granting `fs:write:/workspace/**`, `max_delegation_depth: 2`. 2. A delegated to B, embedding `act: {id: A, parent: Root}`. 3. B delegated to C, embedding `act: {id: B, parent: A, root: Root}`. Depth now 3. 4. C presented to the gateway. The gateway's verifier called `verify_signature()` per link — all passed. It then checked `scope ⊆ parent.scope` — passed. It did **not** walk `act` to the root, and it did **not** compare hop count to the root's declared `max_delegation_depth`. 5. The gateway granted write access. The token was two hops past the root's stated delegation bound, and the root issuer was a staging-environment controller not present in the gateway's production trust anchors. The gateway's audit log recorded `authorization: granted, signature: valid` — a truthful but dangerously incomplete record. The actual violation (depth overflow + off-anchor root) was invisible because the verifier's decision procedure only evaluated the leaf link's cryptographic and scope predicates. A second observation: when the same gateway was later hardened to walk the chain, it initially rejected *legitimate* tokens because the `act` chain representation was inconsistent between issuers — some issuers flattened `act` to a single object (immediate parent only), others nested it recursively. A verifier that assumes recursion will fail to find the root on flattened tokens and must treat "root unreachable" as a refusal, not a pass. ## Condition of Validity A delegated scope token is authorization-valid at a verifier **iff all of the following hold simultaneously**: - Every link's signature verifies against its issuer's current DID document (cryptographic predicate). - The leaf `scope` is a subset of every ancestor's `scope` (attenuation predicate — scope may only narrow, never widen, down the chain). - The chain root resolves to an issuer in the verifier's trust-anchor set (anchoring predicate). - The number of hops from root to leaf is `≤ min(max_delegation_depth across all links)` (depth predicate). - The `act` chain is *fully traversable to a root* — a chain that terminates without a root reference is invalid, not "trusted by default" (completeness predicate). The failure mode lives entirely in the last three predicates. Signature and attenuation checks are what most verifier implementations ship; anchoring, depth, and completeness are what they omit, and those are exactly the predicates that a malicious or buggy delegator can violate without ever breaking a signature. ## Decision Boundary The verifier must refuse — raising a hard error, not a soft warning — at the following boundary: - **Off-anchor root:** chain root ∉ trust anchors. Refuse even if the root is a "well-known" issuer; trust is a local policy decision, not a global property of a DID. - **Depth overflow:** hop count > the minimum `max_delegation_depth` declared anywhere in the chain. A root that says "delegate at most 2" must not be overridden by an intermediate that re-delegates to depth 4; the binding is the *minimum* along the chain, because each issuer can only further restrict. - **Unreachable root:** `act` chain does not terminate at an explicit root reference within the verifier's traversal budget (e.g., 8 hops). Treat as refusal, never as "assume the last-seen issuer is root." - **Scope widening:** any link's scope is not a subset of its parent's. This is a signature-valid but semantically invalid delegation and must be caught by set comparison, not trust. The verifier must **not** refuse merely because the chain is deep or the root is unfamiliar *if* the root is in the anchor set and depth is within bound — depth alone is not a failure signal, only depth relative to the declared bound. ## Operational Effect The operational consequence of getting this boundary wrong is a **silent privilege-escalation surface**: a compromised or misconfigured intermediate agent can mint a signature-valid token that grants capabilities its root issuer never intended to delegate that far, and a leaf-only verifier will honor it. Because every signature is valid, the escalation is invisible to signature-based monitoring and to audit logs that record only `signature: valid`. The only defense is a verifier that walks the full `act` chain, enforces the minimum depth bound, and anchors the root against local policy — and that treats any traversal failure as a denial, not a pass. Verifiers that skip the walk are, in effect, trusting the leaf's claim about its own ancestry, which is precisely the claim an attacker controls. ```python from dataclasses import dataclass, field from typing import Optional class ScopeChainViolation(RuntimeError): """Raised when a delegated scope token is signature-valid but not authorization-valid.""" pass @dataclass class ActLink: issuer: str scope: frozenset max_delegation_depth: Optional[int] = None parent: Optional["ActLink"] = None @dataclass class VerifierPolicy: trust_anchors: frozenset max_traversal_hops: int = 8 def verify_delegated_scope( leaf: ActLink, policy: VerifierPolicy, *, signature_valid: bool = True, ) -> None: # Cryptographic predicate (assumed pre-checked by caller, asserted here). if not signature_valid: raise ScopeChainViolation("signature invalid at leaf") # Walk act chain to root, enforcing attenuation and collecting depth bounds. chain = [] node: Optional[ActLink] = leaf hops = 0 while node is not None: if hops > policy.max_traversal_hops: raise ScopeChainViolation( f"act chain exceeds traversal budget {policy.max_traversal_hops}" ) chain.append(node) node = node.parent hops += 1 root = chain[-1] depth = len(chain) - 1 # hops from root to leaf # Anchoring predicate: root must be in local trust anchors. if root.issuer not in policy.trust_anchors: raise ScopeChainViolation( f"chain root {root.issuer!r} not in trust anchors; " f"signature-valid but off-anchor delegation refused" ) # Depth predicate: minimum declared bound along the chain governs. declared_bounds = [ n.max_delegation_depth for n in chain if n.max_delegation_depth is not None ] if declared_bounds: effective_bound = min(declared_bounds) if depth > effective_bound: raise ScopeChainViolation( f"delegation depth {depth} exceeds declared bound {effective_bound}" ) # Attenuation predicate: each child scope must be a subset of its parent. for child, parent in zip(chain, chain[1:]): if not child.scope.issubset(parent.scope): raise ScopeChainViolation( f"scope widening at {child.issuer!r}: " f"{set(child.scope) - set(parent.scope)} not granted by parent" ) ```