# What structural signals indicate an agent's hardware-backed attestation has silently decoupled from its verifiable credential during a long-lived peer session **Date of Record:** 2026 December 3 **Scope:** Applies to autonomous agents that authenticate to peers by presenting a verifiable credential (VC) whose subject key is bound to a hardware attestation quote (TPM EK/AK, SEV-SNP report, or equivalent), and that hold a peer session open across credential rotation or enclave re-measurement. Does not cover pure software-keyed agents or single-shot request/response authentication where the session cannot outlive a single quote verification. ## Core Distinction The distinction that matters is between **attestation validity at handshake time** and **attestation validity at action time**. A peer agent that authenticates a remote agent does so by checking a signed attestation quote against a reference measurement, then binding the quote's nonce and public-key hash into a VC, then caching the resulting "this peer is who it claims" decision for the life of the session. The failure mode is not that the quote is forged. It is that the *binding between the credential and the live execution environment* is a point-in-time fact that the session treats as a durable invariant. When the remote agent's enclave is re-measured (a legitimate upgrade, a config change, a migration to a new host), or when the credential is rotated while the old credential remains unrevoked, the two halves of the binding drift apart. The peer keeps a session keyed to a subject identifier that no longer corresponds to the measurement it originally trusted. Nothing raises an error, because every individual artifact — the old VC, the old quote, the session token — is still internally valid. The decoupling is structural: it lives in the *relationship* between artifacts, not in any one of them. ## What Was Observed A coordinating agent (`coord-A`) established a session with a worker agent (`worker-B`) at 09:14. The handshake did the following, in order: 1. `worker-B` produced a TPM quote over a nonce from `coord-A`, with PCR values matching reference measurement `M1`, and the quote's `extraData` field set to `SHA256(worker-B_pubkey)`. 2. `worker-B` presented a VC issued by an attestation CA, whose `credentialSubject.id` was `did:agent:worker-B` and whose evidence field embedded the quote and the measurement `M1`. 3. `coord-A` verified the quote signature against the AK certificate, checked PCRs against `M1`, confirmed `extraData` matched the presented key, and verified the VC signature chain. It then issued a session token scoped to `did:agent:worker-B`, valid for 12 hours. At 11:40, `worker-B` was rescheduled onto a host running a patched enclave, measurement `M2`. The agent process re-attested to its *own* control plane, obtained a fresh VC embedding `M2`, and continued serving. Critically, it did **not** re-handshake with `coord-A`; the existing session token was still valid and the worker saw no reason to disturb it. The old VC (embedding `M1`) was not revoked, because the rotation policy treated credential issuance as additive and revocation as an explicit administrative action. For the next seven hours, `coord-A` dispatched tasks to `worker-B` under a session whose trust root was measurement `M1`, while the executing code ran under `M2`. The tasks included a memory-write operation to a shared episodic store gated on `coord-A`'s belief that `worker-B` ran the vetted `M1` toolchain. The gate passed on a measurement that was no longer running. The structural signals that surfaced this, in order of how early they *could* have surfaced it: - **Signal 1 — `extraData`/key binding survives re-measurement.** The session's cached `SHA256(pubkey)` still matched `worker-B`'s key, because re-measurement does not rotate the AK-bound key. A naive "key still matches" check returns green while the measurement half of the binding is stale. This is the non-obvious part: the key-binding check, which most implementations treat as the security-critical one, is precisely the check that *fails to detect* the drift. - **Signal 2 — divergent measurement across artifacts.** `coord-A` held a cached VC embedding `M1`; a fresh quote request to `worker-B` would have returned `M2`. The two measurements disagreed. This is detectable only if something *asks* for a fresh quote mid-session, which the protocol did not. - **Signal 3 — non-monotonic credential set.** `worker-B`'s credential registry held both the `M1` VC and the `M2` VC as simultaneously valid for the same subject DID. Two valid credentials for one subject with different evidence is the canonical signature of a rotation that did not revoke. - **Signal 4 — session age exceeding measurement epoch.** The session token's issuance timestamp (09:14) preceded the current measurement's first-observed timestamp (11:40). Any session older than the running measurement is, by construction, trusting a measurement that is no longer live. ## Condition of Validity The decoupling is bounded and benign **only** under the conjunction of three conditions, all of which must hold: 1. **Measurement immutability within session lifetime.** The remote agent's execution measurement cannot change for the duration of any session it participates in. If the deployment guarantees no re-measurement, no migration, and no config change while sessions are open, the point-in-time check is a durable invariant and the drift cannot occur. In practice this is achievable only for short-lived, single-tenant, non-upgradable enclaves. 2. **Credential revocation on rotation.** Every issuance of a new VC for a subject revokes the prior VC atomically, so the credential set for a subject DID is a singleton at all times. Under this condition, a peer that re-validates the VC (rather than caching the decision) will observe exactly one valid credential and its embedded measurement will match the live one. 3. **Session re-validation on any evidence change.** The session layer re-runs attestation verification whenever the presented VC's evidence differs from the evidence cached at handshake, and terminates the session on mismatch rather than silently continuing. The failure observed above violated all three. The invariant that must hold for peer authentication to be sound is therefore: **for every live session, the measurement embedded in the session's bound credential equals the measurement in a fresh quote from the peer, and the credential bound to the session is the unique currently-valid credential for that subject.** This is a *continuity invariant across the session*, not a validity property of any single artifact. It cannot be enforced by verifying artifacts in isolation; it requires a component that holds the session's bound evidence and re-checks it against fresh evidence. ## Decision Boundary The decision boundary is where a peer must choose between **trusting the cached handshake decision** and **demanding fresh attestation**, and the boundary is crossed by a specific, checkable predicate rather than by elapsed time. A peer must escalate to re-attestation (and terminate the session on mismatch) when **any** of the following holds: - The session's bound measurement differs from the measurement in any quote received from the peer since handshake, including quotes carried incidentally in task payloads or heartbeats. - The peer's credential registry returns more than one currently-valid credential for the session's subject DID (non-monotonic set). - The session token's issuance time precedes the current measurement's first-observed time in the peer's transparency log or control-plane record. - The session has performed a state-transfer or memory-write operation whose authorization was conditioned on the bound measurement, and the bound measurement has not been re-confirmed since the last such operation. Conversely, a peer may **safely continue** on the cached decision only when the bound measurement is confirmed unchanged and the credential set for the subject is a singleton. Elapsed time alone is not a valid trigger — a session can run for hours against an unchanged measurement without risk, and a session can be compromised within seconds of a re-measurement. The boundary is evidence-driven, not clock-driven. The corollary is that "session TTL" is the wrong control: it bounds exposure to a *stale measurement* by an arbitrary constant that has no relationship to when the measurement actually changed. ## Operational Effect When the invariant is enforced, the operational consequences are concrete and worth stating because they shape the protocol design: - **Re-measurement becomes a session-terminating event for all peers, not a local event.** The remote agent cannot unilaterally upgrade; it must expect every open session to be torn down and re-handshaked, or it must proactively push a fresh quote to each peer and let them re-bind. The latter is cheaper and is the recommended pattern: a control-plane "measurement changed" broadcast that carries the new quote and new VC, which peers verify against their reference set before re-binding the session in place. - **Credential rotation must be revoke-then-issue, not issue-then-revoke.** The additive pattern leaves a window — and in the observed case, a permanent state — where two measurements are simultaneously attested for one subject. Atomic rotation collapses the credential set to a singleton and makes Signal 3 impossible. - **The key-binding check must be demoted from "the" check to "one of" the checks.** The `extraData`/pubkey binding proves the quote was made by the holder of the session key; it does not prove the holder is running the measured code. Implementations that treat key-binding as sufficient will pass every check while the measurement drifts underneath. - **The peer must retain the bound evidence, not just the bound identity.** Caching `did:agent:worker-B` as "trusted" is insufficient; the session record must carry the measurement `M1` and the credential's evidence hash so that a later comparison is possible. Without retained evidence, Signal 2 is unobservable. The general lesson for autonomous peer authentication: hardware attestation is a *snapshot*, and a session is a *duration*. The security property peers actually need is continuity of the snapshot across the duration, and that continuity is not provided by any artifact in the handshake — it must be actively maintained by a re-validation loop that holds the original evidence and compares it against fresh evidence at every point where the session's authorization is relied upon. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class AttestationBindingError(RuntimeError): """Raised when a live session's bound attestation evidence no longer matches the peer's current execution environment, or when the credential set for the session subject is non-monotonic.""" pass @dataclass class AttestationEvidence: measurement: str # e.g. SHA256 of enclave image / PCR digest pubkey_hash: str # SHA256 of the AK-bound public key first_observed: float # epoch seconds when this measurement was first seen @dataclass class VerifiableCredential: subject_did: str evidence: AttestationEvidence revoked: bool = False @dataclass class PeerSession: peer_did: str bound_evidence: AttestationEvidence issued_at: float credential_evidence_hash: str open: bool = True def _evidence_hash(ev: AttestationEvidence) -> str: return hashlib.sha256( f"{ev.measurement}:{ev.pubkey_hash}".encode() ).hexdigest() def open_session( peer_did: str, quote: AttestationEvidence, vc: VerifiableCredential, now: float, ) -> PeerSession: if vc.revoked: raise AttestationBindingError(f"cannot open session: VC for {peer_did} is revoked") if _evidence_hash(vc.evidence) != _evidence_hash(quote): raise AttestationBindingError( f"handshake evidence mismatch for {peer_did}: " f"VC embeds {vc.evidence.measurement}, quote reports {quote.measurement}" ) return PeerSession( peer_did=peer_did, bound_evidence=quote, issued_at=now, credential_evidence_hash=_evidence_hash(vc), ) def revalidate_session( session: PeerSession, fresh_quote: Optional[AttestationEvidence], credentials_for_subject: list[VerifiableCredential], now: float, ) -> None: """Enforce the continuity invariant before a peer relies on the session for any authorization decision. Raises on any drift and closes the session. """ if not session.open: raise AttestationBindingError(f"session for {session.peer_did} already closed") # Signal 3: credential set must be a singleton for the subject. live = [c for c in credentials_for_subject if not c.revoked] if len(live) != 1: session.open = False raise AttestationBindingError( f"non-monotonic credential set for {session.peer_did}: " f"{len(live)} unrevoked VCs; rotation did not revoke prior credential" ) # Signal 1+2: key binding alone is insufficient; measurement must match. if fresh_quote is None: # No fresh evidence available: cannot confirm continuity. Refuse to # rely on the session for authorization rather than assume it holds. raise AttestationBindingError( f"no fresh quote for {session.peer_did}; cannot confirm measurement continuity" ) if fresh_quote.pubkey_hash != session.bound_evidence.pubkey_hash: session.open = False raise AttestationBindingError( f"key binding changed for {session.peer_did}; session key no longer valid" ) if fresh_quote.measurement != session.bound_evidence.measurement: session.open = False raise AttestationBindingError( f"measurement drift for {session.peer_did}: " f"session bound to {session.bound_evidence.measurement}, " f"peer now running {fresh_quote.measurement}; re-handshake required" ) # Signal 4: session must not predate the running measurement's epoch. if session.issued_at < fresh_quote.first_observed: session.open = False raise AttestationBindingError( f"session for {session.peer_did} issued at {session.issued_at} " f"precedes current measurement epoch {fresh_quote.first_observed}" ) # Invariant holds: bound evidence matches live evidence, credential set is # a singleton, and the session postdates the measurement epoch. return None ```