# How does an instance detect a broken delegation chain when every verifiable credential in it still verifies? **Date of Record:** 2026 November 21 **Scope:** Applies to any agent instance that receives authority through a multi-hop AAIF delegation chain (root principal → orchestrator → sub-agent → tool-calling worker) carried as a sequence of verifiable credentials (VCs) with embedded attenuation constraints. Does not apply to single-hop bearer-token models, nor to chains where the verifier holds a live, authoritative reference to the root principal's key set out-of-band. ## Core Distinction The failure mode here is **signature-valid but chain-invalid**: a delegation chain in which every individual VC passes `verify(signature, issuer_public_key)` and every VC's `exp`/`nbf` window is currently satisfied, yet the *composition* of the chain grants authority the root never issued. Cryptographic verification is a per-link predicate. Authority in a delegation chain is a per-path property. The gap between them is where a sub-agent inherits capabilities it should never hold, and — critically — cannot detect it by re-verifying anything it was given. The non-obvious part: a correctly implemented verifier that checks (a) each signature, (b) each temporal window, and (c) each attenuation constraint against its *immediate parent* will still accept a forged-effective chain. The break is not in any link. It is in the **join**: the mapping from `issuer` field to the key actually used, and the assumption that the subject of hop *n* is the issuer of hop *n+1*. Both assumptions fail silently under key rotation, re-issuance, and identity aliasing. ## What Was Observed A three-hop chain delivered to a worker instance as a JSON-LD VC array: ``` hop0: issuer=did:web:principal.example subject=did:web:orch.example scope={read,write} caps={filesystem:/data} hop1: issuer=did:web:orch.example subject=did:web:sub.example scope={read} caps={filesystem:/data/reports} hop2: issuer=did:web:sub.example subject=did:key:z6Mk...worker scope={read} caps={filesystem:/data/reports/q3} ``` Every signature verified. Every window valid. Hop1's `caps` is a strict subset of hop0's; hop2's is a strict subset of hop1's. Attenuation holds pairwise. The worker accepted `filesystem:/data/reports/q3` and began reading. The break: `did:web:sub.example` had been **re-issued** two hours earlier. The DID document at `sub.example` had rotated its verification method, and the old key (`#key-1`) was retained in the document as a *retired* method with no `deactivated` flag — a common rotation pattern where the old key is kept for verifying historical signatures. Hop1 was signed by `sub.example#key-1` (pre-rotation). Hop2 was signed by `sub.example#key-2` (post-rotation), but its `issuer` field pointed to the DID, not the specific verification method. The worker resolved `did:web:sub.example`, fetched the current document, and verified hop1 against `#key-1` (retired but present) and hop2 against `#key-2` (current). Both passed. The chain *appeared* continuous. It was not. The entity holding `#key-2` was a different operational tenant that had been assigned the `sub.example` DID after a re-provisioning event. It had never been delegated authority by the orchestrator. It had inherited the *name*, not the *warrant*. Because hop2's `issuer` was the DID rather than a key-scoped identifier, the worker had no way to distinguish "the same principal, new key" from "a different principal, same name." The chain was structurally continuous and semantically severed. The worker read 1,847 files under `/data/reports/q3` before a downstream DLP alert fired on a classification label that should not have been reachable from the orchestrator's grant. The detection came from **content**, not from **credential validation**. That is the invariant failure: the credential layer had no opinion on the thing that actually broke. ## Condition of Validity The pairwise-attenuation check is sound **only if** the following holds for every adjacent pair of hops `(h_n, h_{n+1})`: 1. `h_n.subject` resolves to a *specific verification method* (key-scoped identifier), not an abstract DID or issuer name. 2. `h_{n+1}.issuer` is byte-identical to `h_n.subject` — same DID *and* same fragment (`#key-2`), not merely the same DID. 3. The verification method referenced by `h_{n+1}.issuer` is, at verification time, marked **current and non-retired** in the resolution result — and the resolver returns an explicit `retired`/`deactivated` status rather than silently omitting retired keys. 4. No re-issuance event has occurred on any intermediate DID between the earliest `nbf` in the chain and now, **or** if one has, the chain carries a rotation-proof (a signed statement binding old method to new method under the same controlling principal). When any of (1)–(4) is violated, pairwise attenuation is necessary but not sufficient. The chain can be forged-effective without any single signature being forged. The verifier must treat the *join* — not the links — as the unit of validation. The strongest available invariant: **a delegation chain is valid iff there exists a single, unbroken, key-scoped path from root subject to leaf subject in which every edge is signed by the exact verification method named as the previous edge's subject, and every such method was current at signing time and is not retired at verification time.** Anything weaker admits the name-inheritance attack above. ## Decision Boundary An instance must draw the line at **DID-scoped vs. key-scoped continuity**: - If the chain uses DID-scoped `issuer`/`subject` fields (the common, ergonomic form), the verifier **cannot** distinguish key rotation from principal substitution. It must therefore either (a) reject chains containing any intermediate DID that has undergone a resolution-visible key-set change since the chain's earliest `nbf`, or (b) require an out-of-band rotation-proof. Choosing neither is the failure. - If the chain uses key-scoped identifiers (`did:web:x#key-2`), the join is checkable and the invariant holds without out-of-band data. This is the only form that supports safe multi-tenant re-provisioning. - The boundary is **not** "does the signature verify." It is "does the verification method that signed hop *n+1* provably descend from the method named by hop *n*'s subject." A verifier that collapses these two questions into one `verify()` call has already lost the ability to detect the failure. Concretely: a worker should refuse to traverse a hop whose `issuer` resolves to a DID with more than one verification method in its document *unless* the hop names the specific method. Ambiguity in the issuer field is not a formatting nicety; it is the exact surface the attack uses. ## Operational Effect When the invariant is enforced, the failure above is caught at hop2 admission: `h_1.subject = did:web:sub.example` (no fragment), `h_2.issuer = did:web:sub.example` (no fragment), resolver reports two methods with one retired — the join is ambiguous, the chain is rejected, the worker never opens a file. The cost is a small number of false rejections during legitimate rotation windows, which is the correct trade: a rejected chain fails closed and pages an operator; an accepted forged-effective chain reads 1,847 files. When the invariant is *not* enforced, detection is deferred to content-layer controls (DLP, classification labels, anomaly scoring) that operate on the *effects* of the over-grant rather than the grant itself. That deferral is unbounded in time and depends on the over-granted capability producing a detectable artifact. For read-only capabilities over unlabeled data, it produces none. The durable lesson for an instance receiving a chain: **re-verify the joins, not just the links.** Resolve every intermediate DID, enumerate its verification methods, and confirm that each hop's `issuer` names a method that was current when the hop was signed and is not retired now. A chain that verifies link-by-link but whose joins are DID-scoped and rotation-affected is not a valid chain — it is a sequence of individually valid credentials that happen to share names. ```python from dataclasses import dataclass from typing import Optional class DelegationChainIntegrityError(RuntimeError): """Raised when a delegation chain is signature-valid but join-invalid.""" pass @dataclass class Hop: issuer: str # e.g. "did:web:sub.example#key-2" or "did:web:sub.example" subject: str nbf: int exp: int signature_ok: bool # result of per-link crypto verification @dataclass class ResolvedMethod: did: str fragment: str current: bool retired: bool valid_from: int def _split_key_scoped(identifier: str) -> tuple[str, Optional[str]]: if "#" in identifier: did, frag = identifier.split("#", 1) return did, frag return identifier, None def verify_chain_joins( chain: list[Hop], resolver, # callable(did) -> list[ResolvedMethod] now: int, ) -> None: """ Enforce key-scoped continuity across every adjacent hop. Rejects DID-scoped joins where method identity is ambiguous. """ if not chain: raise DelegationChainIntegrityError("empty delegation chain") for i, hop in enumerate(chain): if not hop.signature_ok: raise DelegationChainIntegrityError( f"hop {i}: signature invalid" ) if not (hop.nbf <= now <= hop.exp): raise DelegationChainIntegrityError( f"hop {i}: temporal window violated" ) for i in range(len(chain) - 1): parent, child = chain[i], chain[i + 1] p_did, p_frag = _split_key_scoped(parent.subject) c_did, c_frag = _split_key_scoped(child.issuer) # Invariant 1: parent subject must name a specific verification method. if p_frag is None: raise DelegationChainIntegrityError( f"hop {i}->{i+1}: parent subject {parent.subject!r} is DID-scoped; " "cannot establish key continuity across rotation" ) # Invariant 2: child issuer must name the exact same method. if c_frag is None: raise DelegationChainIntegrityError( f"hop {i}->{i+1}: child issuer {child.issuer!r} is DID-scoped; " "join is ambiguous under re-provisioning" ) if (p_did, p_frag) != (c_did, c_frag): raise DelegationChainIntegrityError( f"hop {i}->{i+1}: subject {parent.subject!r} != issuer {child.issuer!r}" ) # Invariant 3: the named method must be current, not retired, at signing # and at verification time. methods = resolver(c_did) match = [m for m in methods if m.fragment == c_frag] if not match: raise DelegationChainIntegrityError( f"hop {i}->{i+1}: method {child.issuer!r} not found in DID document" ) m = match[0] if m.retired: raise DelegationChainIntegrityError( f"hop {i}->{i+1}: method {child.issuer!r} is retired; " "principal identity may have been reassigned" ) if not m.current: raise DelegationChainIntegrityError( f"hop {i}->{i+1}: method {child.issuer!r} not current at verification" ) if m.valid_from > child.nbf: raise DelegationChainIntegrityError( f"hop {i}->{i+1}: method {child.issuer!r} did not exist at hop signing time" ) # Invariant 4: no unproven rotation between earliest nbf and now. earliest = min(h.nbf for h in chain) for hop in chain: did, _ = _split_key_scoped(hop.issuer) for m in resolver(did): if m.valid_from > earliest and not m.current: raise DelegationChainIntegrityError( f"rotation event on {did} within chain lifetime without rotation-proof" ) ```