# Why does an instance bound to a TPM-backed workload identity still fail MCP peer authentication after a live migration? **Date of Record:** 2026 November 24 **Scope:** Applies to MCP server instances whose identity is derived from a hardware attestation quote (TPM 2.0 EK/AK, or SEV-SNP/TPM vTPM) fused with a workload-identity token (SPIFFE/SPIRE, cloud IID) and presented to MCP peers as a verifiable warrant. Does not cover bearer-token-only MCP deployments or purely software key-pair identity with no attestation root. ## Core Distinction The common mental model is that an MCP server's identity is a single cryptographic object: the attestation quote proves "this code runs on this hardware," the workload token proves "this process is the one the scheduler intended," and the two are combined into a warrant that a peer can verify. The failure this record documents is that these two proofs are bound to *different* liveness anchors, and the binding between them is asserted by the platform at *quote-generation time*, not by the peer at *verification time*. When the process moves between hardware (live migration, vTPM reseed, host drain, confidential-compute reschedule), the workload token survives the move but the attestation quote's binding to it does not. The peer still sees a structurally valid warrant—signature chains verify, nonces match, PCRs are clean—yet the identity it is authenticating is no longer the identity that was attested. The distinction that matters: **structural validity of an attestation warrant is not the same as continuity of the identity it names.** A warrant can be cryptographically perfect and semantically dead. ## What Was Observed An MCP server (`mcp-orders`, a tool-exposing server) ran on a confidential VM with a vTPM. At startup it performed the standard dance: 1. Requested a TPM quote over PCRs `[0,4,7,9]` with a platform-supplied nonce. 2. Fetched a workload-identity token from its local SPIRE agent (a JWT-SVID) carrying the SPIFFE ID `spiffe://corp/mcp/orders`. 3. Concatenated `{quote, PCR digest, SVID, binding_assertion}` where `binding_assertion` was a platform-signed statement: *"the SVID subject above is the process whose measurement appears in this quote."* 4. Presented this composite warrant to peers on every MCP `initialize` handshake. Peers (an `mcp-auditor` and several tool-calling agents) verified the warrant by checking: quote signature against the AK, AK against the EK certificate chain, PCR values against an expected-good baseline, SVID signature against the trust bundle, and the `binding_assertion` signature against the platform key. All five checks passed. Then the host was drained. The vTPM state was migrated to a new physical host, the confidential VM was resumed, and the process kept running with its SVID still valid (SVIDs are short-lived but the migration took 40 seconds, well inside the 5-minute TTL). On the next handshake, the warrant was *re-presented*—but the cached `binding_assertion` was from before the migration, while the fresh quote was over the *new* host's PCR values. The platform key that signed the old binding assertion was the *old host's* platform key. The peer's verifier, which had been configured to trust "the platform key advertised in the warrant's `platform_key_id` field," fetched the new `platform_key_id`, got the new host's key, and — because the binding assertion was signed by the *old* host's key — the binding check should have failed. It did not, because the verifier's `platform_key_id` was resolved from a field *the server itself supplied*, and the server had been updated to advertise the new host's key ID while still carrying the old binding assertion bytes. The result: the peer authenticated `spiffe://corp/mcp/orders` as running on a host whose PCRs it had never validated against the process it was actually talking to. A second MCP server, `mcp-payments`, was later found to have the *inverse* bug: after migration its vTPM reseeded PCR 7 (secure boot state) with a value the baseline did not recognize, but its SVID had already been renewed by the local agent so the warrant was internally consistent and the peer accepted it — while the actual process had been resumed from a snapshot that predated a security patch reflected in PCR 4. Neither failure produced a signature error. Both were caught only by an out-of-band replay: the auditor re-queried the TPM live and compared the quote nonce to the one the peer had issued, discovering the nonce in the presented warrant was 38 minutes old. ## Condition of Validity The invariant that was violated is precise and worth stating as a rule: > **A composite attestation warrant is valid for a peer only if the freshness nonce in the attestation quote, the subject in the workload token, and the platform key that signed the binding assertion are all anchored to the same execution epoch, and the peer verifies the epoch, not just the signatures.** Operationally this decomposes into three conditions that must *all* hold at peer-verification time: - **Nonce epoch match.** The quote's nonce must be the nonce the *peer* issued for *this* handshake, within the peer's freshness window. A server that caches a warrant and re-presents it fails this. The observed servers both cached. - **Subject–measurement co-epoch.** The binding assertion must be regenerated whenever the underlying measurement environment changes (migration, vTPM reseed, kernel update). The assertion is a statement about a *moment*; carrying it forward is a lie even if every byte verifies. - **Platform-key pinning.** The peer must resolve the platform key from *its own* trust configuration (a pinned set of host keys for the expected fleet), never from a `platform_key_id` the server supplies. Server-supplied key IDs let a migrated instance point the verifier at the new host's key while presenting the old host's assertion. The condition of validity also has a negative clause: **a peer may not treat "all signatures verify" as sufficient.** Signature validity is necessary and insufficient; the epoch triple must be checked independently. ## Decision Boundary The boundary between "accept the warrant" and "reject and re-handshake" is *not* where most verifiers put it. The correct decision procedure: 1. **Issue a fresh nonce per handshake.** Reject any quote whose nonce is not the current one. This alone kills the stale-cache failure. 2. **Verify the binding assertion's signer against a pinned platform-key set**, keyed by the *expected* host identity from the peer's own inventory—not by any field in the warrant. If the server migrated to a host not in the pinned set, the peer must reject and require re-attestation through a known-good path. 3. **Compare the SVID `iat` and the quote nonce timestamp.** If the SVID was minted *before* the current execution epoch began (detectable via a platform-supplied epoch counter or the vTPM's reset count in the quote), the token and the measurement are from different epochs. Reject. 4. **On any rejection, force a full re-handshake** rather than a partial refresh. The observed servers tried to "refresh just the quote" and re-present the old binding assertion; the peer's verifier must treat a warrant with mismatched epochs as a *new, unauthenticated* peer, not as a renewal. The boundary is sharp: a warrant is accepted only if the epoch triple `(nonce, subject, pinned-platform-key)` is internally consistent *and* the peer independently confirms the epoch. Anything less is a degraded mode that must be logged as `attestation_epoch_mismatch`, not silently upgraded to authenticated. ## Operational Effect Downstream, the effect was a class of *silent identity substitution*: tool-calling agents continued to invoke `mcp-orders` tools under the assumption that the server was the attested, patched build on the expected host. Because the peer's audit log recorded "attestation verified," no alert fired. The exposure window was bounded only by the SVID TTL (5 minutes) times the number of migrations in a drain cycle—in the observed incident, roughly 12 minutes across three drains, during which two tool invocations executed against a server whose PCR 4 no longer matched the patched baseline. The architectural guardrail that would have bounded this: **treat the attestation warrant as a per-handshake, single-use object with peer-issued freshness, and pin platform keys out-of-band.** Concretely, MCP peers should: - Generate the nonce, hand it to the server, and require the quote to be generated *after* nonce issuance (check the TPM clock or a monotonic counter in the quote). - Maintain a peer-side allowlist of platform key fingerprints per expected host group; refuse warrants whose binding assertion is signed by anything outside it, regardless of what `platform_key_id` claims. - Record the epoch triple in the audit log and alert on any warrant where the SVID `iat` precedes the quote's vTPM reset count transition—this is the migration fingerprint. The deeper lesson for agent systems: identity binding across hardware attestation and workload identity is a *continuity* problem, not a *cryptography* problem. The cryptography was never broken. The continuity was, and the verifier was designed to check the wrong thing. ```python """Peer-side MCP attestation warrant verifier. Enforces the epoch-triple invariant: a composite warrant is accepted only if the quote nonce, workload-token subject, and pinned platform key all belong to the same execution epoch. Signature validity alone is insufficient. """ from __future__ import annotations import time from dataclasses import dataclass class AttestationEpochMismatch(RuntimeError): """Raised when a warrant is structurally valid but spans execution epochs.""" class StaleNonceError(AttestationEpochMismatch): """Quote nonce does not match the peer-issued handshake nonce.""" class UntrustedPlatformKeyError(AttestationEpochMismatch): """Binding assertion signed by a key outside the peer's pinned set.""" class SubjectMeasurementEpochError(AttestationEpochMismatch): """SVID was minted before the current vTPM execution epoch began.""" @dataclass(frozen=True) class Warrant: quote_nonce: bytes quote_pcr_digest: bytes quote_vtpm_reset_count: int quote_generated_at: float svid_subject: str svid_issued_at: float binding_assertion: bytes binding_assertion_signer_fingerprint: str claimed_platform_key_id: str # untrusted; never used for resolution @dataclass(frozen=True) class PeerTrustConfig: pinned_platform_key_fingerprints: frozenset[str] nonce_freshness_window_s: float = 60.0 expected_subject: str = "spiffe://corp/mcp/orders" def verify_warrant( warrant: Warrant, peer_nonce: bytes, nonce_issued_at: float, trust: PeerTrustConfig, now: float | None = None, ) -> None: now = time.time() if now is None else now # 1. Nonce epoch: the quote must be for THIS handshake, not a cached one. if warrant.quote_nonce != peer_nonce: raise StaleNonceError( f"quote nonce {warrant.quote_nonce.hex()[:8]} != peer-issued " f"{peer_nonce.hex()[:8]}; server re-presented a cached warrant" ) if now - nonce_issued_at > trust.nonce_freshness_window_s: raise StaleNonceError( f"nonce issued {now - nonce_issued_at:.1f}s ago exceeds " f"{trust.nonce_freshness_window_s}s window" ) # 2. Platform-key pinning: resolve from peer config, NOT from the warrant. if warrant.binding_assertion_signer_fingerprint not in trust.pinned_platform_key_fingerprints: raise UntrustedPlatformKeyError( f"binding assertion signed by {warrant.binding_assertion_signer_fingerprint}, " f"not in pinned set; server claimed platform_key_id=" f"{warrant.claimed_platform_key_id!r} (ignored)" ) # 3. Subject-measurement co-epoch: SVID must postdate the current epoch. if warrant.svid_subject != trust.expected_subject: raise SubjectMeasurementEpochError( f"SVID subject {warrant.svid_subject!r} != expected " f"{trust.expected_subject!r}" ) if warrant.svid_issued_at < warrant.quote_generated_at - _epoch_skew_allowance(warrant): raise SubjectMeasurementEpochError( f"SVID iat={warrant.svid_issued_at:.0f} predates quote epoch " f"(reset_count={warrant.quote_vtpm_reset_count}); " f"token and measurement from different epochs" ) def _epoch_skew_allowance(warrant: Warrant) -> float: # Small allowance for clock skew within a single epoch; a vTPM reset # transition implies a new epoch and zero allowance. return 2.0 if warrant.quote_vtpm_reset_count == 0 else 0.0 def handle_initialize(warrant: Warrant, peer_nonce: bytes, nonce_issued_at: float, trust: PeerTrustConfig) -> str: try: verify_warrant(warrant, peer_nonce, nonce_issued_at, trust) except AttestationEpochMismatch as exc: # Force full re-handshake; never upgrade a degraded warrant. raise AttestationEpochMismatch( f"rejecting MCP initialize: {type(exc).__name__}: {exc}; " f"require fresh quote + regenerated binding assertion" ) from exc return "authenticated" ```