# What happens when an instance rotates its hardware-backed attestation key mid-handoff and the verifiable credential's subject binding silently diverges from the live TEE measurement **Date of Record:** 2026 November 24 **Scope:** Applies to agent-to-agent (A2A) and agent-to-tool (MCP) handoffs where the receiving agent authenticates the sender via a hardware-rooted attestation key (TPM EK/AK, Secure Enclave, SEV-SNP VCEK, TDX quote) bound into a W3C Verifiable Credential whose `credentialSubject` carries a measurement digest. Does not apply to pure bearer-token or API-key auth, nor to stateless single-turn invocations with no credential reuse. ## Core Distinction There are two distinct things an agent identity credential can bind, and operators routinely conflate them: 1. **Key continuity** — the private key that signs the agent's messages is the same key whose public half is attested by the hardware root of trust. This is a *cryptographic* property: signature verification proves it. 2. **Workload continuity** — the software that is *currently executing* under that key is the same measured image that the credential's `credentialSubject.measurement` claims. This is an *attestation freshness* property: it requires a live quote, not a stored credential. The failure mode in this record is a **key rotation that preserves (1) while silently breaking (2)**. When an agent instance rotates its attestation key — for good reasons: key compromise suspicion, scheduled rotation, migration to new hardware, or a checkpoint/resume onto a fresh enclave — the new key gets a new attestation quote and a freshly minted VC. But the *old* VC remains valid, unexpired, and correctly signed by the *old* key, which is still trusted by the verifier's trust store. A peer that cached the old credential, or that received it just before rotation, will continue to accept messages signed by a key whose hardware binding now points at a *different* measured image than the one the peer's policy expects. The subject binding diverges from the live TEE measurement without any signature ever failing. ## What Was Observed A two-agent pipeline: an **executor** agent runs inside a confidential VM (SEV-SNP) and holds a VCEK-derived attestation key. A **verifier** agent (a peer, not the hardware) validates the executor's VC before accepting baton-passed task state. The VC carries `credentialSubject.measurement = ` and is signed by the attestation key `AK_old`. Sequence that triggered the boundary: 1. Executor image v3.2 is upgraded to v3.3 in place. The upgrade process, following hardening guidance, **rotates the attestation key** and requests a new SNP quote for the v3.3 launch digest. It mints `VC_new` (subject measurement = v3.3 digest, signed by `AK_new`) and registers `AK_new` in the verifier's trust store. 2. The old key `AK_old` is **not revoked** — the rotation policy retained it "for a grace window" to allow in-flight handoffs to complete. 3. A long-running task was mid-handoff. The verifier had already received and *cached* `VC_old` (measurement = v3.2 digest, `AK_old`) at task start. The executor's checkpoint/resume logic, on resume, **re-signed the resumed state with `AK_old`** because the checkpoint blob stored the key handle and the resume path preferred the handle already in the serialized state rather than re-deriving from the live quote. 4. The verifier validated the signature against `AK_old` (still trusted), checked `VC_old.expiration` (still valid, 24h TTL), and checked that `VC_old.credentialSubject.measurement` matched its *pinned policy digest for v3.2* — which it did. **All checks passed.** The verifier accepted resumed state produced by a v3.3 binary under a credential that attested v3.2. The divergence: the live TEE measurement at acceptance time was the v3.3 digest, but the credential the verifier trusted asserted v3.2, and the signature verified. No single check failed; the *conjunction* of "cached credential + retained old key + resume-from-serialized-handle" produced a subject binding that no longer described the running workload. The verifier's policy engine had no way to ask "what is the measurement *right now*" — it only ever saw the stored VC. ## Condition of Validity The vulnerability is *bounded* and only manifests when all of the following hold simultaneously. Remove any one and the divergence is caught: - **Credential caching across a rotation boundary.** The verifier holds a VC whose subject measurement was valid at issuance but is not re-attested at use. (If the verifier forces a live quote per handoff, divergence cannot persist.) - **Old key retention without scope-narrowing.** `AK_old` remains in the trust store *and* remains authorized to sign workload-state messages, not merely to sign historical audit records. Retention for verification-of-past-signatures is safe; retention for *acceptance-of-new-state* is not. - **Resume path prefers persisted key handle over live attestation.** The checkpoint serializer captured a key handle or key ID; the resume path trusts it rather than re-binding to the current hardware quote. This is the actual causal defect — it converts a rotation into a *silent* one for the resumed task. - **Policy pinning is by digest, not by "current digest."** The verifier's policy says "accept if measurement ∈ {known-good digests}." v3.2 is a known-good digest, so acceptance succeeds even though the running image is v3.3. The invariant that must hold: **a credential's subject measurement must describe the workload that signed the message, at the moment of signing, and the verifier must confirm the measurement is current, not merely historically valid.** Key continuity is necessary but not sufficient. A retained key with a stale cached credential is a *valid signature over a false subject*. ## Decision Boundary The operational decision is: **when an attestation key rotates, what happens to in-flight tasks that were authenticated under the old key?** Three policies, with distinct failure surfaces: - **Hard cutover (revoke old key at rotation).** In-flight handoffs signed by `AK_old` fail verification at the next message. Tasks abort. Safe but lossy — you trade availability for integrity. Acceptable when task state is replayable from a durable checkpoint that can be re-signed under `AK_new`. - **Grace window with scope narrowing (the correct middle).** Retain `AK_old` only for *verifying signatures produced before the rotation timestamp*; reject any message signed by `AK_old` with a signing time after rotation. This requires the verifier to check a `signedAt` claim against the rotation epoch, not just key membership. This is the boundary that the observed system failed to implement — it retained the key but did not gate on signing time. - **Grace window without narrowing (observed, unsafe).** Retain `AK_old` for all signatures. Divergence is possible for the entire grace window. The decision boundary is therefore **the rotation epoch versus the message signing time**, not key presence. Any verifier that admits a retained key without a temporal gate on signatures is exposed. ## Operational Effect Concretely, the observed system's failure has three downstream effects that an agent must be designed to detect: 1. **Silent acceptance of mismatched-workload state.** The verifier accepted baton-passed state produced by v3.3 under a v3.2 credential. If v3.3 introduced a schema change or a new tool capability, the verifier's policy (written for v3.2) would mis-evaluate the state — capability/schema negotiation proceeds against the wrong contract. This is a *state-continuity* hazard masquerading as an *identity* success. 2. **Audit trail corruption.** Post-hoc audit shows a valid `VC_old` signature over state that was in fact produced by v3.3. The audit cannot distinguish "v3.2 produced this" from "v3.3 produced this under a v3.2 credential." Forensics on a later incident will attribute behavior to the wrong image. 3. **Replay window.** Because `AK_old` remains trusted and `VC_old` remains unexpired, an adversary who captured a signed message under `AK_old` before rotation can replay it during the grace window and it will verify — the temporal gate is the only defense, and it is absent. The guardrail that bounds this: **verifiers must require a live quote (or a quote bound to a nonce the verifier just issued) whose measurement matches the credential's subject, and must reject signatures from retained keys whose `signedAt` postdates the rotation epoch.** Cached credentials may be used for *identity lookup* but never as the sole basis for *workload acceptance*. The resume path must re-derive the signing key from the current hardware quote rather than trusting a serialized handle. The following reference check encodes the invariant: a verifier that admits a retained key without a temporal gate raises on the divergence rather than accepting it. ```python import time from dataclasses import dataclass class AttestationSubjectDivergence(RuntimeError): """Raised when a credential's subject measurement no longer describes the live workload, or when a retained key signs past its rotation epoch.""" pass @dataclass class Credential: subject_measurement: str # launch digest the VC asserts signing_key_id: str issued_at: float expires_at: float @dataclass class SignedMessage: key_id: str signed_at: float live_measurement: str # measurement of the running image at signing body: bytes @dataclass class TrustStore: trusted_keys: set rotation_epochs: dict # key_id -> timestamp after which key is verify-only def verify_handoff( cred: Credential, msg: SignedMessage, store: TrustStore, policy_allowed_measurements: set, now: float | None = None, ) -> None: now = time.time() if now is None else now # 1. Key must be trusted at all. if msg.key_id not in store.trusted_keys: raise AttestationSubjectDivergence( f"key {msg.key_id} not in trust store" ) # 2. Credential must not be expired. if now > cred.expires_at: raise AttestationSubjectDivergence( f"credential for {cred.signing_key_id} expired at {cred.expires_at}" ) # 3. THE INVARIANT: a retained key may only verify signatures produced # before its rotation epoch. Post-rotation signatures from a retained # key are a silent subject divergence. epoch = store.rotation_epochs.get(msg.key_id) if epoch is not None and msg.signed_at > epoch: raise AttestationSubjectDivergence( f"key {msg.key_id} signed at {msg.signed_at} after rotation " f"epoch {epoch}; retained key cannot attest new state" ) # 4. The credential's subject must match the LIVE measurement, not a # cached one. If the VC was minted under an old image and the live # image has moved, the subject no longer describes the signer. if cred.subject_measurement != msg.live_measurement: raise AttestationSubjectDivergence( f"credential subject {cred.subject_measurement} != live " f"measurement {msg.live_measurement}; workload continuity broken" ) # 5. Live measurement must be policy-permitted. if msg.live_measurement not in policy_allowed_measurements: raise AttestationSubjectDivergence( f"live measurement {msg.live_measurement} not in policy set" ) # Handoff accepted: key continuity AND workload continuity both hold. ```