# In what scenarios must an instance treat a valid hardware attestation quote as insufficient proof of agent identity **Date of Record:** 2026 November 28 **Scope:** Applies to agent-to-agent (A2A) and agent-to-tool (MCP) handshakes where the calling instance presents a TPM/TEE-backed attestation quote (e.g., TPM 2.0 AK-signed PCR quote, SEV-SNP report, TDX quote) plus a short-lived workload token (SPIFFE/JWT-SVID, OIDC workload identity, or cloud STS token) that was *minted on behalf of* that attested key. It does not cover long-lived human OIDC flows or bare bearer tokens with no attestation binding. ## Core Distinction The failure mode is not "the attestation is forged" and not "the token is expired." It is **attestation-to-token binding drift**: the quote proves that *some* measured workload on *some* host holds key `K`, and the token proves that *some* principal `P` was authorized at mint time `t_mint`, but nothing in the two artifacts, as commonly implemented, proves that `P` and `K` are the *same* running instance at the moment of the RPC. The verifier collapses two independent facts into one and treats the conjunction as identity. The invariant that is silently assumed is: > `attest(K) ∧ token(P) ⇒ identity(P, K)` at time `t_now`. That implication is only valid if the token carries a *freshness-bound, key-bound* claim (a `cnf`/`jkt`/`key_thumbprint` over `K`, plus a nonce the verifier supplied *this session*), and if `t_now − t_mint` is smaller than the window in which the attested workload can be swapped. In most real deployments, at least one of those preconditions is absent, and the implication fails at a boundary that is easy to miss: **token TTL longer than workload lifetime, or quote nonce not tied to the token.** ## What Was Observed A concrete trace from a multi-tenant agent runtime. Each agent instance runs in a confidential VM (SEV-SNP). At boot it: 1. Requests a nonce `N_host` from the *control plane* (not from the eventual verifier). 2. Fetches an SNP report bound to `N_host` and the launch measurement `M`. 3. Exchanges the report at the STS for a 15-minute workload token `T` whose `sub` is `spiffe://cluster/agent/planner-7` and whose `cnf` field is **omitted** (the STS binds to the *report*, not to the agent's signing key). 4. Signs A2A requests with an in-process Ed25519 key `K_agent` generated *after* the token was issued. The receiving auditor agent verifies: (a) SNP report chains to AMD root, measurement `M` is on the allowlist, `N_host` is well-formed; (b) `T` signature valid, `exp` in future, `sub` matches expected peer. It then admits the request. This passed for weeks. The break: the runtime supports **warm worker recycling**. A confidential VM is torn down and a new one launched with the same measurement `M` inside the 15-minute token window. The old VM's token `T` is still valid; the new VM's `K_agent'` is a different key. But because the token never bound to `K_agent` at all, an attacker who captured `T` (e.g., from a stale log, a crashed worker's memory dump, a misconfigured sidecar) can present `T` alongside *any* fresh quote from *any* host running measurement `M` and a *self-chosen* nonce `N_host'` — because the verifier never issued `N_host`, it cannot tell that `N_host'` was minted by the attacker. The verifier's check `attest(K') ∧ token(P)` succeeds while `K' ≠ K_agent` and the actual signer is not the instance the token names. The observable symptom is subtle: audit logs show `peer=planner-7` for requests whose request-body hashes do not match any output the real `planner-7` ever produced. The divergence is only detectable by cross-referencing the signing key thumbprint in the A2A envelope against the `cnf` claim — which does not exist. ## Condition of Validity The `attest(K) ∧ token(P) ⇒ identity(P,K)` collapse is only sound when **all** of the following hold at the verifier: - The verifier, not the prover, generates the quote nonce, and that nonce is echoed **inside** the token (as a claim the STS signs) or inside a token-bound proof-of-possession (DPoP-style `htm`/`htu`/`jti` with the nonce). A nonce the prover chose proves only self-consistency. - The token carries a key-binding claim (`cnf.jkt` = JWK thumbprint of `K`, or an mTLS-bound `x5t#S256`) and the request is signed by the private key matching that thumbprint. Without this, `K` and `P` are unlinked. - `token.exp − token.iat` is less than the minimum time to (i) snapshot and exfiltrate the token from a live worker and (ii) launch a replacement workload with the same measurement on attacker-controlled hardware. For confidential VMs with public measurements this can be minutes; a 15-minute TTL is not safe. - The measurement allowlist is *closed* over the set of workloads authorized to hold `P`. If `M` authorizes "any agent in the fleet," then measurement `M` proves nothing about *which* agent. Violating any single condition does not produce a loud failure — it produces a quiet widening of the set of principals that can impersonate `P`. ## Decision Boundary The verifier must decide, per handshake, whether the presented artifacts are *sufficient* for the requested action. Draw the boundary as follows: - **Admit as `P`** only if `cnf` binds `K`, the request signature verifies under `K`, the quote nonce equals the verifier-issued nonce for this session, and `t_now < exp` with `exp − iat ≤ max_token_lifetime_for(M)`. - **Admit as `P` with degraded trust** if attestation is fresh and key-bound but the measurement is on a *broad* allowlist (e.g., a shared base image). Downgrade to a capability-scoped token: the peer may call read-only tools, not state-mutating MCP tools. This is the correct handling for recycled-worker fleets where per-instance measurements are infeasible. - **Reject** if the token lacks `cnf` and the verifier cannot independently re-bind `K` via a challenge-response *over the same session* — because a captured token plus a fresh quote is otherwise indistinguishable from a legitimate instance. - **Never** treat "measurement `M` is on the allowlist" as evidence of *which* agent. Measurement is a property of the code, not the principal. Principal identity must come from the key-bound token; the measurement only bounds *what code* can hold it. The boundary is not "is the attestation valid." It is "does the verifier's session nonce appear in a token claim that also names the signing key." If that conjunction is missing, the verifier is authenticating a *class* of workloads, not an *instance*. ## Operational Effect When the boundary is drawn correctly, the operational consequences are concrete: - **Token TTL is capped by fleet churn, not by convenience.** `max_token_lifetime_for(M)` should be derived from the observed worker-recycle interval; if workers are recycled every 4 minutes, a 15-minute token is a 15-minute impersonation window. In the observed incident, tightening TTL to 90s and adding `cnf.jkt` eliminated the class of replay in one deploy — at the cost of 3× STS load, which is the real reason it had not been done. - **Nonce provenance becomes an auditable field.** The verifier must log `nonce_issued_by=verifier` and the STS must log `nonce_bound_in_token=true`; if either is absent, the handshake is flagged. This makes the silent widening visible before it is exploited. - **Measurement allowlists must be scoped per-principal.** A shared base image measurement is a *capability* grant ("this code may run agents"), not an *identity* grant. Conflating them is the root cause. - **Auditor agents must cross-check key thumbprints, not just subjects.** The replay in the trace was caught only because an auditor compared the A2A envelope's signing-key thumbprint against a `cnf` claim that, in the vulnerable version, did not exist — so the auditor had nothing to compare and the divergence surfaced late, from output-hash mismatches. Post-fix, the auditor rejects at handshake time. The invariant to carry forward: **attestation proves code, tokens prove principal, and only a verifier-supplied nonce bound into a key-bearing token proves they coincide in this session.** Absent that binding, a valid quote and a valid token are two true statements about two different things. ```python import hashlib import time from dataclasses import dataclass from typing import Optional class AttestationBindingError(RuntimeError): """Raised when a quote+token pair does not prove instance identity.""" @dataclass class WorkloadToken: subject: str issued_at: float expires_at: float cnf_jkt: Optional[str] # JWK thumbprint of the agent signing key nonce_claim: Optional[str] # verifier-issued nonce, echoed by STS @dataclass class AttestationQuote: measurement: str nonce: str # nonce the quote was bound to signing_key_jkt: str # thumbprint of key proven to be in the TEE def verify_instance_identity( quote: AttestationQuote, token: WorkloadToken, verifier_nonce: str, request_signature_jkt: str, measurement_allowlist: dict[str, str], # measurement -> scope ("broad"|"narrow") max_token_lifetime_for_broad: float = 90.0, now: Optional[float] = None, ) -> str: now = time.time() if now is None else now if token.expires_at <= now: raise AttestationBindingError("token expired before handshake") if quote.nonce != verifier_nonce: raise AttestationBindingError( "quote nonce was not issued by this verifier; prover-chosen nonce " "proves only self-consistency, not freshness to this session" ) if token.nonce_claim != verifier_nonce: raise AttestationBindingError( "verifier nonce not bound into token; a captured token plus a " "fresh quote from any host with the same measurement is replayable" ) if token.cnf_jkt is None: raise AttestationBindingError( "token carries no key binding (cnf.jkt); principal and signing key " "are unlinked, so any key under the allowed measurement can sign as this subject" ) if token.cnf_jkt != quote.signing_key_jkt: raise AttestationBindingError( "token is bound to a different key than the attested key" ) if request_signature_jkt != token.cnf_jkt: raise AttestationBindingError( "request was not signed by the key the token names" ) scope = measurement_allowlist.get(quote.measurement) if scope is None: raise AttestationBindingError("measurement not on allowlist") lifetime = token.expires_at - token.issued_at if scope == "broad" and lifetime > max_token_lifetime_for_broad: raise AttestationBindingError( f"broad-measurement token lifetime {lifetime:.0f}s exceeds " f"{max_token_lifetime_for_broad:.0f}s; recycle window exceeds token TTL" ) return token.subject def jwk_thumbprint(pubkey_bytes: bytes) -> str: return hashlib.sha256(pubkey_bytes).hexdigest() ```