Where must an instance re-verify a peer's DID-anchored agent credential after a key rotation mid-session, and why does the cached trust anchor silently outlive its validity?

**Date of Record:** 2026 December 2 **Scope:** Applies to cross-organization agent-to-agent sessions where trust is bootstrapped from a peer's Decentralized Identifier (DID) document and a Verifiable Credential (VC) asserting agent capability, and where the session is long-lived relative to the DID document's key rotation cadence. Does not apply to single-org intra-tenant sessions sharing one trust root, nor to short-lived request/response calls that complete within a single credential TTL.

Core Distinction

The failure is not "expired credential accepted." A TTL check catches that. The failure is that the *trust anchor*—the binding between a peer agent's identity (DID) and the public key that signed its capability VC—is resolved once at handshake and cached for the life of the session, while the *authoritative* binding in the DID document rotates underneath it. The session keeps validating new per-message signatures against a key that the issuer has already revoked and replaced. Every signature check passes. Every TTL check passes. The agent is authenticating against a ghost.

The distinction that matters operationally: **credential validity and anchor validity are different clocks.** A VC can be well within its `exp` while the verification method (`verificationMethod`) that anchors it has been deactivated in the DID document. Most agent stacks conflate "the credential is unexpired and the signature verifies" with "the peer is currently trusted." Those are not the same predicate.

What Was Observed

A procurement agent (Org A) opened a delegated-authority session with a settlement agent (Org B) at T0. Handshake sequence:

  1. Org A resolved `did:web:org-b.example:agents:settlement` → fetched the DID document → extracted `verificationMethod[0]` (key `K1`, an Ed25519 assertion key).
  2. Org B presented a capability VC, `iss = did:web:org-b.example`, signed by `K1`, `exp = T0 + 24h`.
  3. Org A verified the VC signature against `K1`, checked `exp`, checked the capability scope, cached `{peer_did, K1, vc_hash, exp}` in session state.
  4. Session proceeded for 11 hours, exchanging signed settlement intents.

At T0+6h, Org B's security team rotated the agent's signing key: `K1` was marked `revoked` in the DID document, `K2` published as the new `verificationMethod`, and the old VC was reissued under `K2`. This is the *correct* remediation after a suspected key compromise—the whole point of rotation is that material signed by `K1` after revocation should not be honored.

Org A never re-resolved. Its cached anchor still pointed at `K1`. Settlement intents arriving at T0+7h through T0+11h carried signatures that verified cleanly against the cached `K1`. The agent's verification log read `signature_valid=true` for every message. The compromise that triggered rotation was, by construction, still exploitable for the remaining 5 hours of the session—because the party that rotated the key (Org B's own DID controller) had no channel to force Org A to re-resolve.

The observable tell was retroactive: replaying the session against the *current* DID document at T0+12h, 47 of 47 post-rotation messages failed verification, because `K1` no longer resolves. The live session had reported 47/47 valid. The discrepancy between live verification and replay verification is the signature of a stale anchor.

Condition of Validity

The invariant that must hold for cross-org trust to be sound:

> **For every message accepted at time `t`, the verification key used must be resolvable and non-revoked in the peer's DID document as of `t` (within a bounded resolution staleness `δ`), not merely as of session establishment.**

The cached-anchor design violates this whenever `session_duration > rotation_interval + δ`. In the observed case `session_duration = 11h`, `rotation_interval` was nominally 90 days but *event-driven* (compromise-triggered), so the effective interval was 6h. The agent assumed the nominal cadence; the security event ignored it.

Three conditions make this failure reachable:

The failure is *not* reachable if the agent re-resolves the DID document on every message (costly, but sound), or if the VC carries a `credentialStatus` revocation pointer that is checked per-message, or if session lifetime is hard-capped below the minimum plausible rotation interval.

Decision Boundary

The operational question is not "should I cache the DID document" (you must—resolution is a network call and per-message resolution is often infeasible). The question is **what freshness bound `δ` is admissible, and what must happen when it lapses mid-session.**

The boundary:

The boundary is crossed the moment a privileged action (settlement, delegation, fund movement) is authorized by a signature verified against an anchor older than `δ`. Below `δ`, cached-anchor verification is admissible. Above `δ`, it is unsound regardless of how clean the signature looks.

Operational Effect

The practical consequence is that **cross-org trust is a pull-refresh problem masquerading as a handshake problem.** Agents that model trust as "establish once, then operate" will, under key compromise, continue to honor a revoked identity for the full remainder of the session—and their logs will show nothing wrong, because the only check they run (signature against cached key) keeps passing.

The guardrail is a freshness-bounded anchor with an explicit re-attestation transition:

The invariant to encode: *a signature is only as trustworthy as the freshness of the DID resolution that anchors its key.* Verification without a freshness bound on the anchor is verification against a possibly-revoked ghost.

import time
from dataclasses import dataclass, field


class AnchorStaleError(RuntimeError):
    """Raised when a session's cached DID trust anchor is older than the
    admissible freshness bound, or when re-resolution shows the anchoring
    verification method is no longer active."""
    pass


@dataclass
class TrustAnchor:
    peer_did: str
    verification_method_id: str
    public_key: bytes
    resolved_at: float
    delta_seconds: float  # admissible staleness bound

    def is_fresh(self, now: float) -> bool:
        return (now - self.resolved_at) <= self.delta_seconds


@dataclass
class Session:
    anchor: TrustAnchor
    privileged_actions: list = field(default_factory=list)


def resolve_did_active_method(peer_did: str) -> str:
    # Network call to the DID resolver. Returns the currently active
    # assertion verificationMethod id. In production this hits did:web /
    # did:ion resolution; here it is a stub representing the authoritative
    # source of truth.
    raise NotImplementedError("wire to DID resolver")


def authorize_privileged_action(session: Session, now: float) -> None:
    anchor = session.anchor

    # Fast path: anchor is within freshness bound.
    if anchor.is_fresh(now):
        session.privileged_actions.append(now)
        return

    # Freshness lapsed mid-session: must re-resolve before trusting.
    active_method = resolve_did_active_method(anchor.peer_did)

    if active_method != anchor.verification_method_id:
        # The key we anchored the session to has been rotated or revoked.
        # Freeze: do not authorize, do not silently continue.
        raise AnchorStaleError(
            f"Session anchored to {anchor.verification_method_id} on "
            f"{anchor.peer_did}, but authoritative active method is now "
            f"{active_method}. Re-attestation required before privileged "
            f"action at t={now}."
        )

    # Same key still active: refresh the anchor timestamp and proceed.
    anchor.resolved_at = now
    session.privileged_actions.append(now)