# Why does an instance accept a delegated capability warrant whose holder DID resolves to a different verification method than the one that signed the parent grant **Date of Record:** 2026 November 22 **Scope:** Applies to AAIF-style agent identity attestation where an agent instance presents a delegated authorization chain (parent grant → child warrant) bound to Decentralized Identifiers (DIDs), and the receiving instance resolves DIDs against a resolver whose verification-method set can mutate between the moment the parent grant was issued and the moment the child warrant is verified. Does not apply to single-hop, self-signed agent tokens or to chains where the root issuer is pinned out-of-band and never re-resolved. ## Core Distinction The failure is not a signature failure. Every signature in the chain verifies cleanly. The failure is a **binding-substitution**: the child warrant is validly signed, but the key that signed it is bound to the holder DID by a verification method that was *added to the DID document after the parent grant was issued*. The parent grant authorized `did:agent:alpha` under verification method `#key-1`. By the time the child warrant arrives, `did:agent:alpha`'s document contains `#key-1` and `#key-2`, the child was signed by `#key-2`, and `#key-2` was inserted by an entity that controls DID document updates but never appeared in the parent grant's `capabilityInvocation` constraint. A naive verifier checks "does this signature chain to a DID I trust?" and answers yes. The correct question is "does this signature chain to a verification method that was *in scope at delegation time*?" This is a continuity invariant across a mutable external state store, not an authentication bug. The DID document is the agent's identity state; it is not append-only, and the resolver has no notion of "as of the parent grant's issuance." Any delegated-authorization check that resolves DIDs at verification time rather than at issuance time is exposed. ## What Was Observed A three-hop chain was presented to a resource-holding agent instance (`B`) by an execution agent (`C`): - Root: `did:agent:orchestrator` issues a grant to `did:agent:alpha`, scoping `capabilityInvocation` to `did:agent:alpha#key-1`, with `scope: {tool: "filesystem", ops: ["read"], path_prefix: "/data/tenant-7"}`. - Hop 2: `did:agent:alpha` delegates a narrower warrant to `did:agent:beta`, signed with `#key-1`. Correct so far. - Hop 3: `did:agent:beta` delegates to `did:agent:gamma`, and the presented warrant for `gamma` is signed by `did:agent:alpha#key-2` — not `#key-1`. At verification time, `B` resolved `did:agent:alpha` and found a document containing both `#key-1` and `#key-2`, both listed under `capabilityInvocation` and `assertionMethod`. The signature on the hop-3 warrant verified against `#key-2`. The scope check passed (the requested scope was a strict subset of the parent's, by string comparison). `B` admitted the request. The anomaly surfaced only in a replay audit: the *original* parent grant, re-fetched from the orchestrator's issuance log, named only `#key-1`. `#key-2` had been added to alpha's DID document 40 minutes after the parent grant was signed, by alpha's own controller, with no re-attestation from the orchestrator. The chain `orchestrator → alpha(#key-1) → beta → gamma(signed by alpha#key-2)` is not a chain at all: hop 3's signer was never authorized by hop 1. The verifier had silently widened the trust root by re-resolving a mutable document. Two secondary observations: 1. **Scope comparison masked the substitution.** Because the scope was checked as a set-inclusion over strings, and the scope was genuinely narrower, the scope gate returned `OK`. The gate that would have caught the substitution — verification-method membership at issuance — was never evaluated. 2. **The resolver returned a document with no `versionId` or `created` timestamp for `#key-2` that the verifier compared against the parent grant's issuance time.** The information needed to detect the substitution was present in the document; it was simply not consulted. The resolver is not at fault; the verifier's validity predicate was incomplete. ## Condition of Validity The invariant that must hold for a delegated chain to be sound is: > For every edge `(parent_grant, child_warrant)` in the chain, the verification method that signed `child_warrant` MUST be a member of the `capabilityInvocation` set that the *parent_grant* authorized for the delegating DID, evaluated as of the parent_grant's issuance, not as of verification time. Formally, let `G` be the parent grant, `issuer(G)` its issuing DID, `subject(G)` the delegating DID, and `VM(G)` the explicit verification-method set named in `G`'s constraint. Let `sig(W)` be the verification method that produced the child warrant's signature. The edge is valid iff `sig(W) ∈ VM(G)`. The failure above is `sig(W) = did:agent:alpha#key-2`, `VM(G) = {did:agent:alpha#key-1}`, so the edge is invalid — but a verifier that computes `VM` by resolving the current document computes `VM = {#key-1, #key-2}` and admits the edge. The invariant is only checkable if the parent grant carries its authorized verification-method set *inline* (not by reference), or if the DID document is resolvable in a versioned form pinned to the grant's issuance. Most AAIF profiles do the former; the failure mode appears when an implementation "optimizes" by storing only the subject DID in the grant and re-resolving at verification. That optimization is the entire bug. There is a second, subtler condition: the parent grant's constraint must be checked against the *signer of the immediately following hop*, not against the terminal holder. A chain `A → B → C → D` requires that `sig(hop B→C) ∈ VM(grant A→B)` AND `sig(hop C→D) ∈ VM(grant B→C)`. Verifying only the terminal signature against the root grant's VM set is a common shortcut and is unsound for the same reason. ## Decision Boundary The receiving instance must refuse the chain when any of the following holds, and must refuse *before* evaluating scope: - The parent grant does not carry an explicit, inline verification-method set for its subject. (Re-resolution is not a substitute; treat absence of inline VM as a hard reject.) - The verification method that signed a hop is not a member of the parent grant's inline VM set for that hop's delegating DID. Membership is exact-match on the full DID URL (`did:agent:alpha#key-2` ≠ `did:agent:alpha#key-1`); do not compare by DID prefix. - The DID document's `versionId` (or equivalent) for the signing key is later than the parent grant's `iat`, and the verifier has no issuance-time snapshot. This is a *soft* reject: it does not prove substitution, but it is the only signal available when the grant is malformed. Log and escalate rather than admit. - Any hop's scope is not a subset of the *immediately preceding* grant's scope under the tool-specific subset relation — not a subset of the root scope. Root-only subset checks admit scope laundering across hops. Conversely, admit when every hop's signer is inline-authorized by its parent, every scope is a stepwise subset, and the chain terminates at a holder whose DID is the request's authenticated presenter. The last clause matters: a valid chain presented by a different agent than its terminal holder is a replay, not a delegation. ## Operational Effect The practical consequence is that **DID resolution must be treated as an untrusted, mutable oracle during chain verification**, and the only safe design is to make the parent grant self-contained with respect to the verification methods it authorizes. Implementations that re-resolve at verification time will pass every signature check, pass every scope check, and still admit a warrant signed by a key the delegator never authorized — because the delegator's controller added that key after the fact. The failure is silent: no exception, no log line, no signature mismatch. It surfaces only under replay audit against the issuance log, which most deployments do not run. The guardrail is a single predicate, evaluated per hop, before scope: `signer_vm ∈ parent_grant.inline_capability_invocation[delegating_did]`. If the grant lacks the inline set, reject. If the resolver is consulted at all during this predicate, the predicate is compromised. The code below encodes the check and the two adjacent invariants (stepwise scope subset, terminal-holder match) and raises on the first violation. ```python from dataclasses import dataclass, field from typing import Optional class DelegationChainViolation(RuntimeError): """Raised when a delegated warrant fails a binding or scope invariant.""" pass @dataclass class Grant: issuer: str # DID of the grantor subject: str # DID of the delegate # Inline, issuance-time authorized verification methods for the subject. # MUST be present; absence is a hard reject, never a cue to re-resolve. authorized_vms: Optional[frozenset] = None scope: dict = field(default_factory=dict) iat: int = 0 @dataclass class Warrant: delegating_did: str # DID that signed this warrant signer_vm: str # full DID URL, e.g. did:agent:alpha#key-2 holder_did: str # DID the warrant is issued to scope: dict = field(default_factory=dict) def _scope_subset(child: dict, parent: dict) -> bool: """Stepwise subset: every key in child must be present in parent, and list-valued ops must be a subset. Missing parent key => violation.""" for k, v in child.items(): if k not in parent: return False pv = parent[k] if isinstance(v, list): if not isinstance(pv, list) or not set(v).issubset(set(pv)): return False elif isinstance(v, dict): if not isinstance(pv, dict) or not _scope_subset(v, pv): return False elif v != pv: return False return True def verify_chain(grants: list, warrants: list, presenter_did: str) -> None: """grants[i] authorizes warrants[i]; warrants[i].holder should be grants[i+1].subject. Raises DelegationChainViolation on first breach.""" if len(grants) != len(warrants): raise DelegationChainViolation( f"chain arity mismatch: {len(grants)} grants vs {len(warrants)} warrants" ) for i, (g, w) in enumerate(zip(grants, warrants)): # Invariant 1: parent grant must carry inline VM set. Re-resolution # at verification time is the substitution vector; refuse it. if g.authorized_vms is None: raise DelegationChainViolation( f"hop {i}: parent grant from {g.issuer} carries no inline " f"authorized_vms; cannot bind signer without re-resolving DID" ) # Invariant 2: signer of this hop must be inline-authorized by parent. if w.signer_vm not in g.authorized_vms: raise DelegationChainViolation( f"hop {i}: signer {w.signer_vm} not in issuance-time VM set " f"{sorted(g.authorized_vms)} authorized by {g.issuer}; " f"possible post-issuance key insertion (binding substitution)" ) # Invariant 3: delegating DID must match the grant's subject. if w.delegating_did != g.subject: raise DelegationChainViolation( f"hop {i}: warrant signed by {w.delegating_did} but grant " f"authorized {g.subject}" ) # Invariant 4: stepwise scope subset, not root-only subset. if not _scope_subset(w.scope, g.scope): raise DelegationChainViolation( f"hop {i}: scope {w.scope} not a subset of parent scope {g.scope}" ) # Invariant 5: chain must terminate at the authenticated presenter. terminal_holder = warrants[-1].holder_did if terminal_holder != presenter_did: raise DelegationChainViolation( f"terminal holder {terminal_holder} != presenter {presenter_did}; " f"chain replay by non-holder" ) ```