# What structural signals indicate a verifiable credential delegation chain has silently exceeded its transitive trust depth in cross-org agent federation **Date of Record:** 2026 November 28 **Scope:** Applies to federated agent systems where an agent in org A invokes an agent in org B via a verifiable credential (VC) delegation chain, and B re-delegates authority to org C. Does not apply to single-org bearer-token flows or to static API-key federation. ## Core Distinction The failure is not "an expired credential was accepted." It is that a *valid* credential was accepted at a hop where the *delegation depth* — the number of transitive `delegatedFrom` links between the original issuer and the acting agent — silently exceeded the maximum depth the original issuer intended to warrant. Every signature in the chain verifies. Every `exp` is in the future. Every `aud` matches. The chain is cryptographically sound and semantically over-extended. The distinction that matters: **signature validity is not delegation validity.** A chain of N individually-valid VCs is not a valid N-hop warrant unless the root credential bounded N. Most federation stacks verify each link in isolation and never re-check the accumulated depth against the root's `delegationPolicy.maxDepth`. The root issuer signed a credential that says "you may delegate up to depth 2"; the agent at depth 3 holds a perfectly signed credential whose `proof` chain is intact, but whose authority was never granted. ## What Was Observed In a three-org federation (A → B → C), an orchestrator agent in A issued a scoped capability VC to a broker agent in B with `delegationPolicy: { maxDepth: 1, allowedScopes: ["read:inventory"] }`. The broker in B, acting correctly, delegated `read:inventory` to a worker in C. That worker, under load, spawned a retry sub-agent in C and passed its credential down. The sub-agent's chain was: root(A) → broker(B) → worker(C) → retry(C). Four links, depth 3. The root's `maxDepth` was 1. The sub-agent's credential verified clean against C's verifier because C's verifier only checked: (a) the immediate `proof` (worker's signature), (b) the `exp`, (c) the `aud` claim naming the sub-agent. It did **not** walk the `delegatedFrom` chain to the root and did **not** recompute depth. Structural signals that this had happened, observable in logs and audit trails: 1. **Chain length drift without a corresponding root re-fetch.** The sub-agent's `credentialSubject.delegationChain.length` was 4; the last cached root policy in C's verifier was `maxDepth: 1`. The verifier never compared them because it never loaded the root. 2. **`proof.created` timestamps uniformly increasing across hops but `proof.verificationMethod` repeating within an org.** Two consecutive links signed by the same DID (worker and retry both in C, same key) is a structural tell: intra-org re-delegation, exactly the hop most likely to be unbounded. 3. **`aud` narrowing without `scope` narrowing.** Each hop correctly re-targeted `aud`, but the `scope` set stayed identical (`read:inventory`). A well-formed delegation either narrows scope or narrows depth budget; a chain that narrows neither while growing in length is over-extended. 4. **No `delegationDepthConsumed` counter in the credential.** The root's policy was static; no hop decremented a remaining-depth field, so no downstream verifier could detect exhaustion from the credential itself. The failure trace: root issues (depth budget 1) → B delegates (budget 0 remaining, but not recorded) → C worker delegates (budget −1, undetected) → C retry acts with authority the root never granted, reading inventory rows scoped to a tenant it should not have reached. ## Condition of Validity A delegation chain is valid **iff** for every credential at depth *d* in the chain, *d* ≤ `root.delegationPolicy.maxDepth`, where depth is computed by walking `delegatedFrom` to the root — not by trusting a self-reported depth field. This invariant holds only when: - The verifier at the acting hop **re-fetches or re-validates the root credential** and recomputes depth from the chain, rather than trusting the immediate proof alone. - Each hop either **narrows scope** or **decrements a signed remaining-depth counter**; a hop that does neither is a delegation the root did not authorize. - Intra-org re-delegation (same `verificationMethod` across consecutive links) is treated as a hop, not as a no-op — the common bug is treating same-issuer re-signing as depth-preserving. The invariant **fails** (is not decidable from the presented credential alone) when the root is not reachable at verification time and the verifier falls back to "immediate proof only." That fallback is the boundary condition. ## Decision Boundary The operational decision is: **at what point does a verifier reject a chain it cannot fully walk to the root?** - If the root is reachable: recompute depth, compare to `maxDepth`, reject on `depth > maxDepth`. No ambiguity. - If the root is **not** reachable (issuer org down, root VC not cached): the verifier must choose between **fail-closed** (reject any chain whose root cannot be re-validated) and **fail-open-on-cached-policy** (accept if a previously-cached root policy permits the observed depth). Fail-open is safe **only** if the cached policy includes `maxDepth` and the verifier recomputes depth from the presented chain against that cached bound. Fail-open without depth recomputation is the exact hole that let the retry sub-agent through. - The hard boundary: **any chain where `scope` is unchanged across a hop and depth exceeds the cached `maxDepth` must be rejected regardless of signature validity.** Signature validity is necessary, never sufficient. ## Operational Effect Consequence of missing this: authority laundering. A low-privilege agent in a partner org can, through two intra-org re-delegations that each look locally legitimate, acquire the full scope of a root credential whose issuer explicitly bounded delegation to one hop. The blast radius is bounded by the root's `allowedScopes`, but the *depth* bound — the thing the root issuer used to limit how far its authority could travel — is silently void. Audit trails show a clean chain of valid signatures, so post-hoc forensics conclude "no compromise," which is technically true and operationally wrong. The guardrail: a verifier that, on every request, walks `delegatedFrom` to the root, recomputes depth, and enforces `depth ≤ root.delegationPolicy.maxDepth` against a re-fetched-or-cached root — and that treats same-`verificationMethod` consecutive links as depth-consuming. Absent that walk, the chain is unverifiable and must be rejected, not accepted on immediate-proof alone. ```python from dataclasses import dataclass class DelegationDepthExceeded(RuntimeError): """Raised when a VC delegation chain exceeds the root's maxDepth.""" pass class RootPolicyUnreachable(RuntimeError): """Raised when the root VC cannot be fetched or cached for depth check.""" pass @dataclass class Credential: issuer: str subject_agent: str scope: frozenset delegated_from: "Credential | None" verification_method: str max_depth: int | None = None # set only on the root def compute_depth(cred: Credential) -> int: depth = 0 node = cred while node.delegated_from is not None: depth += 1 node = node.delegated_from return depth def verify_delegation_chain(cred: Credential, root_cache: dict) -> bool: # Walk to root; do not trust any self-reported depth field. node = cred while node.delegated_from is not None: node = node.delegated_from root = node # Root must be re-validated or present in a policy cache that carries maxDepth. if root.max_depth is None: cached = root_cache.get(root.issuer) if cached is None or cached.get("maxDepth") is None: raise RootPolicyUnreachable( f"root issuer {root.issuer} unreachable and no cached maxDepth; " f"cannot bound transitive delegation" ) root_max = cached["maxDepth"] else: root_max = root.max_depth depth = compute_depth(cred) if depth > root_max: raise DelegationDepthExceeded( f"delegation depth {depth} exceeds root maxDepth {root_max} " f"for issuer {root.issuer}; chain is over-extended" ) # Same verification_method across consecutive links is a depth-consuming hop. # Scope must narrow OR depth must be within a decremented budget; here we # enforce the conservative rule: unchanged scope across a hop is allowed # only if depth is within bound (already checked above). return True ```