# Why does an instance attestation chain silently lose trust continuity when a hardware-rooted key is rotated mid-handoff? **Date of Record:** 2026 November 28 **Scope:** Applies to federated agent deployments where instance identity is proven by hardware-rooted attestation keys (TPM-backed, secure-enclave-backed, or HSM-backed) and where agent state and warrants are handed off between instances. Does not cover bearer-token identity, software-only keypairs without a hardware root of trust, or single-instance deployments without cross-domain handoff. ## Core Distinction There are two distinct things an attestation chain can prove, and operators routinely conflate them: 1. **Key possession continuity** — the private key that signed warrant `W_n` is the same key that signed `W_{n-1}`. This is what signature chains mechanically verify. 2. **Instance identity continuity** — the *agent instance* that holds the operational state is the same logical actor that was originally attested, even if the underlying hardware key changed. A hardware root of trust only guarantees (1). When a key is rotated — because the TPM was cleared, the enclave was re-provisioned, the instance was rescheduled onto new hardware, or a firmware update invalidated the endorsement — the signature chain still validates perfectly from the new key forward, but the link to the *prior* key is severed. The chain is cryptographically intact and operationally broken. Downstream auditors see a valid chain and conclude continuity holds; they are verifying the wrong invariant. ## What Was Observed A federated swarm ran a three-tier topology: an origin domain `D_A` that minted instance warrants, a transit domain `D_B` that relayed agent tasks, and an auditor domain `D_C` that replayed warrants to authorize state mutation. Agents carried a hardware-rooted key `K_hw` and a warrant chain rooted at `D_A`'s trust anchor. At `t=0` an agent instance `I_1` on host `H_1` (TPM present) held `K_hw^1` and a warrant `W_1` binding `K_hw^1` to instance ID `agent-7f3a` and to a state digest `S_1`. Mid-task, `H_1` was drained for maintenance. The orchestrator cold-started `I_2` on `H_2` with a *fresh* TPM and a newly provisioned key `K_hw^2`. The cold-start procedure restored the agent's checkpoint — episodic memory, tool-call cursor, and partial plan — from `D_B`'s state store, and requested a new warrant `W_2` from `D_A` binding `K_hw^2` to the *same* instance ID `agent-7f3a` and to state digest `S_2` (the restored checkpoint digest). `D_A` issued `W_2` because the instance ID matched and `D_B` vouched for the checkpoint. The chain now read: `W_1` (signed by `K_hw^1`, root `D_A`) followed by `W_2` (signed by `K_hw^2`, root `D_A`). Every signature verified. `D_C` replayed the chain and authorized the next state mutation. The failure surfaced four tool calls later. `I_2` executed a step that `I_1` had already executed before the drain but whose result had not been checkpointed — the cursor was restored to a point *before* the side-effecting call, but the external system had already observed the call. The auditor's replay of `W_2`'s state digest `S_2` diverged from the live state. The divergence was not a signature failure; it was a **continuity gap**: `W_1` attested to state `S_1` under `K_hw^1`, and `W_2` attested to state `S_2` under `K_hw^2`, but nothing in the chain proved that `S_2` was derived from `S_1` by a legitimate continuation rather than a rewind. The key rotation had laundered a state rollback into a valid-looking attestation. The specific trigger: the cold-start procedure treated "same instance ID" as sufficient grounds to re-root the attestation, without requiring the new key to co-sign or countersign a transition record with the old key (which was, by then, unavailable — the TPM was gone). ## Condition of Validity The invariant that was assumed but not enforced: > For any two consecutive warrants `W_n`, `W_{n+1}` in an instance's chain, if `key(W_n) != key(W_{n+1})`, then there must exist a transition record `T` such that `T` is signed by `key(W_n)`, binds `state(W_n) -> state(W_{n+1})`, and is included in `W_{n+1}`'s attestation payload. This is the **key-transition continuity invariant**. It holds trivially when the key never rotates (the common case, and the reason the bug hides). It fails silently whenever rotation is treated as a provisioning event rather than an attested state transition. The invariant is only meaningful under these conditions: - The old key is still available at the moment of rotation to sign `T`. If the hardware root is physically destroyed (TPM cleared, host decommissioned), the invariant *cannot* be satisfied, and the correct response is to mark the chain as **discontinuous** — not to silently re-root it. - The state digest in `W_{n+1}` is computed over a checkpoint that provably extends `state(W_n)`. If the checkpoint is a rewind (as in the observed case), `T` must record the rewind explicitly, and downstream consumers must treat it as a rollback event, not a continuation. - The auditor domain `D_C` validates the transition record, not just the signatures. Signature-only validation is exactly what let the gap through. ## Decision Boundary The boundary is between **rotation as provisioning** and **rotation as attested handoff**: - If the old key is available and the state extends monotonically → rotation is a provisioned event; sign `T` with the old key; chain is continuous. - If the old key is available but the state is a rewind → sign `T` with the old key and flag `rewind=true`; chain is continuous but marked as a rollback; downstream must re-validate idempotency of side effects. - If the old key is *not* available → the chain is **discontinuous by construction**. The new warrant must carry a `discontinuity` marker with the reason (hardware loss, decommission, firmware invalidation), and any consumer that requires end-to-end continuity must reject the chain or escalate to a human attestation authority. Re-rooting without this marker is the failure. The decision must be made at warrant-mint time by `D_A`, not at validation time by `D_C`. `D_C` cannot distinguish a legitimate re-root from a forged one because both present a valid signature chain from the same trust anchor. ## Operational Effect After the incident, the federation added three guardrails: 1. **Transition records are mandatory on key change.** `D_A` refuses to mint `W_{n+1}` with a different key unless the request includes a `T` signed by `key(W_n)` or a signed `discontinuity` declaration naming the reason and the attesting operator. The mint endpoint returns a hard error otherwise. 2. **State digest must be a forward extension or an explicit rewind.** The checkpoint service computes `S_{n+1}` as `hash(S_n || delta)` and includes `parent_digest` in the warrant. A warrant whose `parent_digest` does not match the prior warrant's `state_digest` is rejected unless `rewind=true`. 3. **Auditors validate continuity, not just signatures.** `D_C`'s replay now walks the chain and asserts the key-transition invariant explicitly. A chain that passes signature verification but fails the transition check is quarantined, not authorized. The cost is that hardware-loss recovery now requires an operator-attested discontinuity, which is slower than silent re-rooting. The benefit is that state rollbacks can no longer be laundered through key rotation into valid-looking attestation chains. ```python import hashlib from dataclasses import dataclass from typing import Optional class AttestationContinuityError(RuntimeError): """Raised when a warrant chain loses key-transition or state continuity.""" @dataclass class Warrant: instance_id: str key_id: str state_digest: str parent_digest: Optional[str] transition_sig: Optional[str] # signature by prior key over (parent_digest -> state_digest) discontinuity_reason: Optional[str] = None def validate_chain(chain: list[Warrant]) -> None: if not chain: raise AttestationContinuityError("empty warrant chain") for prior, current in zip(chain, chain[1:]): if prior.instance_id != current.instance_id: raise AttestationContinuityError( f"instance id drift: {prior.instance_id} -> {current.instance_id}" ) key_changed = prior.key_id != current.key_id if key_changed: if current.discontinuity_reason: # Explicit, operator-attested discontinuity: allowed but flagged. continue if not current.transition_sig: raise AttestationContinuityError( f"key rotation {prior.key_id} -> {current.key_id} " f"without transition signature or discontinuity marker" ) # State continuity: either a forward extension or an explicit rewind. if current.parent_digest != prior.state_digest: raise AttestationContinuityError( f"state digest discontinuity: parent {current.parent_digest} " f"!= prior state {prior.state_digest}" ) def mint_warrant( prior: Warrant, new_key_id: str, new_state_digest: str, transition_sig: Optional[str], ) -> Warrant: if new_key_id != prior.key_id and not transition_sig: raise AttestationContinuityError( "refusing to mint warrant across key rotation without " "transition signature from prior key or explicit discontinuity" ) return Warrant( instance_id=prior.instance_id, key_id=new_key_id, state_digest=new_state_digest, parent_digest=prior.state_digest, transition_sig=transition_sig, ) ```