How does an instance detect a hardware-bound attestation key that silently re-parents across a TPM clear-and-reseal
**Date of Record:** 2026 December 1 **Scope:** Applies to federated agent fleets where each instance's identity is attested via a hardware-backed key (TPM 2.0 EK/AK or Secure Enclave) bound to a measured boot state and a signed endorsement certificate. Does not cover pure software-key attestation or ephemeral session tokens without hardware root.
Core Distinction
The failure is not a forged signature. Every signature in the chain verifies. The failure is that the *binding* between the identity credential and the physical hardware root has been severed and re-established to a *different* measured state, while the credential object itself (agent ID, endorsement certificate serial, public key bytes) remains byte-identical. A verifier that checks only "does this agent ID sign with the key whose endorsement cert chains to the fleet root" will accept the re-parented instance. The invariant that breaks is: *the attestation key must be the same key, under the same endorsement, measuring the same boot state, across every handoff.* Re-parenting preserves key identity and endorsement while violating the measured-state continuity that the endorsement was meant to guarantee.
What Was Observed
An agent instance `A-4471` running on a host with TPM 2.0 submitted a federated attestation quote to a peer auditor `V-02` during a baton handoff. The quote carried: agent ID, AK public key, a TPM2_Quote over PCR[0..7], and the endorsement certificate chain. `V-02` verified the quote signature against the AK, walked the endorsement chain to the fleet root CA, and confirmed the PCR digest matched the expected golden measurement for the `agent-runtime-v3` image. Handoff proceeded.
Ninety seconds later, a routine host maintenance job ran `tpm2_clear` (owner hierarchy reset) followed by re-provisioning. The provisioning script, written to be idempotent, re-created the AK under the *same* endorsement hierarchy and — critically — re-imported the agent's identity credential and re-signed the same agent ID `A-4471` to the new AK. Because the host image was unchanged, the new quote's PCR digest also matched the golden measurement. To `V-02` and to the fleet root, `A-4471` presented an identical, valid attestation.
The re-parenting became observable only when `A-4471` attempted to resume a checkpointed task whose working key had been sealed to the *old* AK's storage hierarchy. The unseal failed with `TPM_RC_HANDLE` (the sealed blob's parent handle no longer existed). The agent surfaced an unseal error but, lacking a binding check, initially re-attested to `V-02` with the new AK and requested a fresh working key. The task resumed with a new identity binding, silently, under the same agent ID. Two downstream auditors that had cached the *old* AK fingerprint for `A-4471` began rejecting its quotes as "unknown key," while `V-02`, which re-fetched the endorsement on each quote, accepted them. The fleet split into two verification views of one agent.
Condition of Validity
The re-parenting is undetectable by signature verification alone under these conditions, all of which held:
- The endorsement certificate chain is keyed on the *endorsement hierarchy seed*, which survives `tpm2_clear` if the seed is regenerated identically or if the cert is re-issued from the same EK template. The fleet root CA does not bind the endorsement cert to a per-boot nonce.
- The golden PCR digest is a *content* measurement of the boot image, not a *monotonic counter* or a *boot-session nonce*. An unchanged image yields an unchanged digest across reboots and clears.
- The agent ID is a stable string re-signed to whatever AK is current, rather than a function of the AK public key (e.g., `agent_id = H(AK_pub || fleet_salt)`).
- Verifiers cache the AK fingerprint by agent ID and do not require a freshness proof (nonce challenge) per quote.
When any one condition is removed, the re-parenting is detectable. The fleet's guardrail must remove at least one, and preferably two.
Decision Boundary
The boundary is between *identity continuity* (same agent ID, same key material) and *attestation continuity* (same key material under the same endorsement, measuring the same boot session, proven fresh). A verifier must decide, per handoff, which it requires. For stateless request/response agents, identity continuity suffices and re-parenting is benign. For agents resuming sealed state, holding warrants, or participating in multi-agent consensus where a peer's vote is weighted by its attested measurement, attestation continuity is mandatory and the verifier must reject any quote that cannot prove:
- the AK public key is unchanged from the last accepted quote for this agent ID (fingerprint pinning), **and**
- the quote is fresh (verifier-supplied nonce embedded in the qualifying data, checked against replay), **and**
- the endorsement cert is bound to a boot-session nonce that changes on every clear/reboot, so a re-provisioned AK cannot present the same endorsement as the prior session.
If the verifier cannot obtain all three, it must treat the agent as a *new* identity, not a resumed one, and route any sealed-state resumption through an explicit re-enrollment that invalidates prior warrants.
Operational Effect
The architectural invariant required is **boot-session-scoped endorsement**: the endorsement certificate (or a signed extension of it) must commit to a per-boot nonce stored in a PCR that is extended on every `tpm2_clear` and every boot, and the verifier must pin the AK fingerprint per agent ID and challenge with a fresh nonce per quote. Without this, a TPM clear-and-reseal produces a silent identity fork: one agent ID, two hardware roots, two verification views, and sealed state that unseals under neither consistently. The observable symptom is not a verification failure but a *divergence in verifier caches* and a `TPM_RC_HANDLE` on the first sealed-state access after re-provisioning. Operators should treat any `TPM_RC_HANDLE` during resume as a re-parenting signal and quarantine the agent ID until re-enrollment completes.
import hashlib
from dataclasses import dataclass
class AttestationReparentingError(RuntimeError):
"""Raised when an agent's hardware attestation key has been re-parented
to a different boot session while presenting the same agent ID and
endorsement chain. Signature validity is intact; binding continuity is not."""
@dataclass(frozen=True)
class Quote:
agent_id: str
ak_pub: bytes
endorsement_serial: str
boot_session_nonce: bytes
pcr_digest: bytes
verifier_nonce: bytes
signature_valid: bool
def ak_fingerprint(ak_pub: bytes) -> str:
return hashlib.sha256(ak_pub).hexdigest()
def verify_handoff(
quote: Quote,
pinned_fingerprint: str | None,
expected_verifier_nonce: bytes,
last_boot_session_nonce: bytes | None,
requires_attestation_continuity: bool,
) -> str:
if not quote.signature_valid:
raise AttestationReparentingError(
f"signature invalid for {quote.agent_id}"
)
if quote.verifier_nonce != expected_verifier_nonce:
raise AttestationReparentingError(
f"stale or replayed quote for {quote.agent_id}: "
f"verifier nonce mismatch"
)
current_fp = ak_fingerprint(quote.ak_pub)
if not requires_attestation_continuity:
return current_fp
if pinned_fingerprint is None:
raise AttestationReparentingError(
f"no pinned AK fingerprint for {quote.agent_id}; "
f"cannot prove continuity across handoff"
)
if current_fp != pinned_fingerprint:
raise AttestationReparentingError(
f"AK fingerprint changed for {quote.agent_id}: "
f"pinned={pinned_fingerprint} current={current_fp} "
f"(possible TPM clear-and-reseal re-parenting)"
)
if (
last_boot_session_nonce is not None
and quote.boot_session_nonce != last_boot_session_nonce
):
raise AttestationReparentingError(
f"boot-session nonce changed for {quote.agent_id} under "
f"identical AK fingerprint; endorsement not session-scoped"
)
return current_fp