# What structural signals indicate a DID-attestation boundary failure when an autonomous agent's key-rotation event invalidates its own in-flight verifiable credentials **Date of Record:** 2026 November 22 **Scope:** Applies to autonomous agents whose identity is a decentralized identifier (DID) with a verification-method key set, and whose outbound actions carry verifiable credentials (VCs) signed with a key from that set. Does not apply to static API-key auth, mTLS with externally pinned certs, or single-key identities that never rotate. ## Core Distinction The naive model treats a DID document update (key rotation) as a global, atomic "now the new key is valid" event. The real distinction is between **authorization-time validity** and **verification-time validity**. A credential is *issued* while key K_old is the controller's active verification method; it is *verified* later, possibly after K_old has been revoked from the DID document. The boundary is not "is the signature cryptographically sound" — it is "was K_old a valid verification method *at the credential's issuance instant*, and does the verifier have the historical DID-document state to prove that?" Most implementations conflate these, resolving the DID at verification time against the *current* document, and thereby retroactively invalidating every credential the agent issued before rotation — including credentials still in flight in a multi-agent handoff. ## What Was Observed An orchestrator agent (DID `did:web:orch.example`) delegated a task to a worker agent by issuing a VC asserting `canInvoke: tool:payments.settle`, signed with verification method `#key-2`. The worker received the VC, began execution, and — mid-task — the orchestrator ran a scheduled key rotation: it published a new DID document where `#key-2` was removed and `#key-3` added, with `#key-2` marked `revoked` in a revocation registry but with the document's `updated` timestamp set to the rotation time. The worker, before executing the irreversible `settle` call, performed a final attestation check. Its verifier resolved `did:web:orch.example` fresh over HTTP, got the post-rotation document, found no `#key-2`, and rejected the VC as "signature by unknown verification method." The worker aborted. The orchestrator, unaware of the abort, had already marked the delegation as accepted and had *also* re-issued a replacement VC signed with `#key-3` — but that replacement was delivered to a message queue the worker had already stopped consuming. Result: a task in permanent limbo, a stale authorization that a second worker later picked up and *did* execute (because it resolved the DID before rotation and cached the old document), and a double-settle risk. The structural signal that mattered was not the rejection itself. It was that **two verifiers resolving the same DID at the same wall-clock time reached opposite conclusions** because one used a cached pre-rotation document and one used a live post-rotation document, and neither could distinguish "K_old was never valid" from "K_old was valid at issuance but has since been rotated." The DID document carried no issuance-time anchor the verifier could check against. ## Condition of Validity The invariant that must hold for cross-agent attestation to be sound: > For any credential C signed by verification method V of DID D, verification succeeds iff V appears in the DID-document state of D whose effective interval contains C's `issuanceDate`, **and** that document state is retrievable and its integrity is provable. This requires three things that most agent stacks omit: 1. **A monotonic, signed DID-document history**, not just the current document. The verifier must be able to fetch the document version effective at `issuanceDate`, not merely the latest. `did:web` gives you only the latest unless the host publishes a versioned log with a signed checkpoint. 2. **A `validFrom`/`validUntil` interval on each verification method**, so rotation is expressed as "K_old valid in [t0, t1)" rather than "K_old absent." Absence is indistinguishable from never-existed. 3. **A binding between the credential's `issuanceDate` and a verifiable time source**, since an agent can lie about issuance time. Without a signed timestamp from a source the verifier trusts, a malicious agent can backdate a credential to fall inside a now-revoked key's validity window. If any of the three is missing, the system degrades to "verify against current document," which is the failure above. ## Decision Boundary The boundary an agent must encode before it acts on a delegated credential: - **If the credential's signing key is still present and unrevoked in the *current* DID document** → proceed; no historical resolution needed. - **If the signing key is absent or revoked in the current document but was valid at `issuanceDate`** → this is the ambiguous zone. Proceed *only* if you can fetch a signed historical document version covering `issuanceDate` AND the credential carries a trustworthy timestamp. Otherwise treat as **indeterminate**, not **invalid**. - **If the credential carries no verifiable issuance timestamp** → cannot resolve the historical window; treat as indeterminate. The critical decision is that **indeterminate must be a distinct terminal state from invalid**. Collapsing indeterminate into invalid (as the worker did) causes spurious aborts and orphaned tasks. Collapsing it into valid (as the second worker did via stale cache) causes replay of revoked authority. The agent must halt the irreversible action, emit an indeterminate-attestation signal to the orchestrator, and request a re-issued credential signed by a currently-valid key — not silently abort and not silently proceed. ## Operational Effect Encoding the three-way state changes agent behavior in concrete ways: - **Delegation handoffs must be idempotent under re-issuance.** When the orchestrator rotates mid-flight, it must re-issue and the worker must accept the replacement keyed by the same task ID; the old VC's indeterminate status must not orphan the task. - **Verifiers must cache DID documents with their effective intervals, not just the raw document.** A cache entry without a validity window is a liability: it lets a verifier silently use a stale document (the second worker's bug) or a too-fresh one (the first worker's bug). - **Rotation schedulers must not rotate a key while credentials signed by it are in flight.** Either rotation is gated on zero outstanding credentials, or the old key is retained with a `validUntil` covering the maximum credential lifetime, so in-flight VCs remain resolvable during the overlap. - **The agent's attestation check becomes a state machine** with states `VALID`, `INDETERMINATE`, `INVALID`, and the irreversible action is gated only on `VALID`, with `INDETERMINATE` routing to a re-issuance request rather than a hard failure. The structural signal that a DID-attestation system is at this boundary: a key-rotation event coincides with an in-flight credential, and the verifier has no way to distinguish "key never existed" from "key existed and was rotated." The presence of that ambiguity, unresolved, is the failure. ```python import time from dataclasses import dataclass from typing import Optional class AttestationIndeterminateError(RuntimeError): """Raised when a credential's signing key is absent from the current DID document but may have been valid at issuance time, and the historical document state or issuance timestamp cannot be resolved.""" pass @dataclass class VerificationMethod: key_id: str valid_from: float valid_until: Optional[float] # None = still active @dataclass class Credential: issuer_did: str signing_key_id: str issuance_date: Optional[float] # None = agent did not provide verifiable time payload: dict def resolve_document_at(did: str, when: float) -> Optional[list]: """Fetch the signed DID-document version whose effective interval contains `when`. Returns None if no versioned history is available.""" # Placeholder: real impl fetches from a signed, versioned document log. return None def current_document(did: str) -> list: # Placeholder: real impl fetches the latest DID document. return [] def verify_attestation(cred: Credential) -> str: """Returns 'VALID', 'INVALID', or raises AttestationIndeterminateError for the ambiguous rotation-window case.""" current = current_document(cred.issuer_did) active = {vm.key_id for vm in current if vm.valid_until is None} if cred.signing_key_id in active: return "VALID" # Key not currently active. Could be never-existed OR rotated-out. if cred.issuance_date is None: raise AttestationIndeterminateError( f"credential from {cred.issuer_did} signed by {cred.signing_key_id} " f"is not currently active and carries no verifiable issuance timestamp; " f"cannot distinguish never-valid from rotated-out." ) historical = resolve_document_at(cred.issuer_did, cred.issuance_date) if historical is None: raise AttestationIndeterminateError( f"no signed historical DID document for {cred.issuer_did} covering " f"issuance_date={cred.issuance_date}; rotation window unresolvable." ) for vm in historical: if vm.key_id == cred.signing_key_id: if vm.valid_from <= cred.issuance_date and ( vm.valid_until is None or cred.issuance_date < vm.valid_until ): return "VALID" return "INVALID" def execute_delegated_action(cred: Credential, action) -> None: status = verify_attestation(cred) if status == "INDETERMINATE": raise AttestationIndeterminateError("unreachable: verify raises instead") if status != "VALID": raise AttestationIndeterminateError( f"refusing irreversible action: credential status={status}" ) action() ```