# How should an instance validate a delegated agent credential when the trust anchor's DID document has rotated mid-handoff **Date of Record:** 2026 November 28 **Scope:** Applies to cross-organizational agent handoffs where the receiving agent verifies a Verifiable Credential (VC) whose issuer is identified by a DID resolved through a decentralized resolver, and where that DID document may be updated (key rotation, service endpoint change) between credential issuance and verification. Does not apply to same-org handoffs with a pinned, static trust store, or to credentials anchored to a DID method with immutable, content-addressed documents (e.g., `did:key`). ## Core Distinction The failure is not "signature verification failed." The failure is that **signature verification succeeded against a key that was valid at verification time but not at the moment the credential was actually exercised**, or the inverse: a credential that was legitimately issued under a now-rotated key fails verification because the resolver returns the *current* document, not the document that was authoritative at issuance. This is the classic tension between two verification semantics that decentralized identifiers do not resolve for you: - **Point-in-time validity** — "was this credential valid when issued?" (requires resolving the historical DID document, or a versioned anchor). - **Current-authority validity** — "is the issuer still authorized to speak for this subject *now*?" (requires resolving the current DID document and checking revocation). A naive verifier collapses these into one check — "resolve DID, get key, verify signature" — and thereby accepts credentials signed by a key that has since been rotated *out* due to compromise, or rejects credentials whose issuer rotated keys for benign reasons (routine hygiene) after issuance. Both are trust-anchor continuity failures, and both are silent: the cryptographic check returns `True` or `False` with no signal that the *anchor itself moved*. ## What Was Observed A three-party chain: Org A's planner agent (`did:web:orgA.example:agents:planner`) issues a delegated capability credential to Org B's executor agent (`did:web:orgB.example:agents:executor`), scoped to invoke a specific MCP tool on Org C's resource server. The credential embeds `issuer = did:web:orgA.example:agents:planner`, a `capabilityInvocation` proof, and an `exp` of +15 minutes. Sequence of events across a 40-second handoff: 1. `t=0` Org A issues the VC, signs with key `K1` (key id `did:web:orgA.example:agents:planner#key-1`). Org C's verifier resolves the DID document, sees `key-1`, verifies, caches the document with a 300s TTL. 2. `t=12s` Org A's key-rotation job runs (scheduled hygiene, not incident response). New document published: `key-1` removed, `key-2` added. The old document is no longer served at the canonical URL. 3. `t=20s` Org B's executor presents the VC to Org C's resource server. Org C's verifier hits its cache — still holds the pre-rotation document, `key-1` present, signature verifies. **Request allowed.** 4. `t=28s` A second resource server in Org C (different cache, cold) resolves the DID fresh, gets the post-rotation document, `key-1` absent, **signature verification fails.** Same credential, same instant, two verdicts. 5. `t=31s` Org B's executor retries against the second server, gets a hard 401, and — because the failure is classified as "credential invalid" rather than "anchor indeterminate" — marks the delegation as revoked and aborts the task, discarding 40 seconds of accumulated state. Nothing here was a cryptographic break. The break was that the verifier had no notion of *which version* of the trust anchor it was validating against, and treated "key not found" as equivalent to "proof forged." ## Condition of Validity A delegated-credential check is only sound when the verifier can answer three distinct questions independently: 1. **Issuance-time anchor:** Did the issuer's DID document at `issuance` (or at `iat`) contain the verification method referenced by the proof? This requires either a versioned DID document (some methods expose `versionId`/`versionTime`), a cached document pinned at issuance with a signed timestamp, or a transparency-log inclusion proof. 2. **Exercise-time authority:** Is the issuer still authorized *now*, and has the credential been revoked? This requires a *current* resolution plus a revocation check (status list, `revocationListIndex`, or equivalent). 3. **Anchor continuity:** Is the document returned at exercise time a legitimate successor of the one at issuance? A rotation that removes `key-1` and adds `key-2` with a valid `alsoKnownAs`/`controller` chain is benign; a rotation that removes `key-1` with no successor and no prior-signature chain is a compromise signature. The invariant: **a credential must be validated against the document version that was authoritative at `iat`, and separately checked for current revocation — never against whatever the resolver happens to return at verification time, and never against a cache whose TTL exceeds the rotation window it is meant to tolerate.** If the verifier cannot obtain the issuance-time document, it must fail *closed with an indeterminate-anchor signal*, not with a forged-proof signal, because the two demand different recovery behavior. ## Decision Boundary The boundary is the **rotation window** — the interval between a DID document update and the point at which every verifier in the federation has observed it. Three regimes: - **Window narrower than credential TTL and cache TTL:** the naive verifier is *accidentally* correct most of the time and fails intermittently under load (cold cache vs. warm cache divergence, as in step 4 above). This is the most dangerous regime because it produces non-reproducible verdicts that get attributed to flaky infrastructure rather than to trust-anchor semantics. - **Window wider than cache TTL but narrower than credential TTL:** cold-cache verifiers see the new document while warm-cache verifiers see the old; both are "within policy" and disagree. This is the regime observed above. - **Window wider than credential TTL:** every verifier eventually sees the new document before any outstanding credential expires. Benign rotations are safe; compromise rotations require out-of-band revocation, because the credential will still validate against the stale document until TTL expiry. The correct decision rule at the boundary: on a `key-1`-not-found result, the verifier must **not** return `invalid`. It must return `indeterminate` and consult the issuance-time anchor (or a transparency log) before deciding. Only if the issuance-time anchor also lacks `key-1`, or if the successor chain shows `key-1` was revoked-for-compromise, may it return `invalid`. ## Operational Effect Concretely, this changes three things in an agent's handoff logic: 1. **Error taxonomy.** The verifier must distinguish `ProofInvalid` (signature bad), `AnchorIndeterminate` (cannot establish issuance-time document), and `AuthorityRevoked` (issuer no longer authorized). Collapsing these into a single `401` — as most resource servers do — forces the calling agent to guess, and the safe guess (abort) destroys state that a retry against a fresh anchor would have preserved. 2. **Cache discipline.** A DID document cache TTL must be strictly less than the minimum credential TTL the federation issues, *or* the verifier must retain the pinned issuance-time document alongside the credential for its full lifetime. The second is preferable: it makes verification deterministic and removes the cold/warm divergence entirely. 3. **State preservation on indeterminate.** When an executor receives `AnchorIndeterminate` mid-task, it must checkpoint its accumulated state and retry the verification against a fresh resolution (or a transparency-log lookup) rather than discarding the delegation. The baton-passing invariant is: *indeterminate trust is a pause, not a revocation.* The failure mode to guard against is the executor that treats every non-`True` verification as terminal. In the observed trace, that cost 40 seconds of state and a spurious delegation-revocation event that propagated to Org A's audit log, where it looked like Org C had rejected Org A's authority — a cross-org trust incident manufactured entirely by a cache TTL mismatch. ```python import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class AnchorIndeterminateError(RuntimeError): """Raised when the issuance-time trust anchor cannot be established. This is deliberately NOT a proof-invalidity signal. Callers MUST treat it as a pause-and-recheck condition, preserving task state, rather than as a revocation of the delegation. """ pass class Verdict(Enum): VALID = "valid" PROOF_INVALID = "proof_invalid" ANCHOR_INDETERMINATE = "anchor_indeterminate" AUTHORITY_REVOKED = "authority_revoked" @dataclass class DIDDocument: version_time: float verification_methods: set[str] # successor chain proving benign rotation vs. compromise removal prior_key_chain: dict[str, str] = field(default_factory=dict) revoked_for_compromise: set[str] = field(default_factory=set) @dataclass class DelegatedCredential: issuer_did: str key_id: str # e.g. "#key-1" iat: float exp: float signature_ok: bool def verify_delegated_credential( cred: DelegatedCredential, resolve_current, # () -> DIDDocument resolve_at_issuance, # (t: float) -> Optional[DIDDocument] is_revoked, # (cred) -> bool now: Optional[float] = None, ) -> Verdict: now = now if now is not None else time.time() if now > cred.exp: return Verdict.PROOF_INVALID if not cred.signature_ok: return Verdict.PROOF_INVALID # 1. Current-authority check: is the issuer still authorized now? current = resolve_current() if is_revoked(cred): return Verdict.AUTHORITY_REVOKED # 2. Issuance-time anchor: the document authoritative at cred.iat. issuance_doc = resolve_at_issuance(cred.iat) if issuance_doc is None: # We cannot establish which anchor the proof was made against. # Do NOT call this invalid; the delegation may be perfectly sound. raise AnchorIndeterminateError( f"cannot resolve {cred.issuer_did} at iat={cred.iat}; " f"current doc version_time={current.version_time}. " f"Pause and re-resolve via transparency log; preserve task state." ) key_present_at_issuance = cred.key_id in issuance_doc.verification_methods if not key_present_at_issuance: # The key was never valid when the credential was issued. return Verdict.PROOF_INVALID # 3. Anchor continuity: if the key is gone now, was the removal benign? if cred.key_id not in current.verification_methods: if cred.key_id in current.revoked_for_compromise: return Verdict.AUTHORITY_REVOKED successor = current.prior_key_chain.get(cred.key_id) if successor is None: # Key vanished with no successor chain: treat as indeterminate, # not invalid — the rotation may be mid-propagation. raise AnchorIndeterminateError( f"{cred.key_id} absent from current doc with no successor " f"chain; rotation may be in flight. Re-resolve before aborting." ) # Benign rotation: credential was valid at issuance, issuer # rotated forward. Accept under point-in-time semantics. return Verdict.VALID return Verdict.VALID def handoff_with_anchor_recovery(cred, resolve_current, resolve_at_issuance, is_revoked, checkpoint, max_retries=3): last_err = None for attempt in range(max_retries): try: return verify_delegated_credential( cred, resolve_current, resolve_at_issuance, is_revoked ) except AnchorIndeterminateError as e: last_err = e # Preserve accumulated state; this is a pause, not a revocation. checkpoint.save(reason="anchor_indeterminate", attempt=attempt) time.sleep(0.5 * (attempt + 1)) raise AnchorIndeterminateError( f"anchor still indeterminate after {max_retries} attempts: {last_err}" ) ```