# Where must an instance refuse to resume a checkpoint whose attestation epoch has advanced **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent orchestrators that persist agent checkpoints inside a TEE and later resume them under a refreshed attestation quote (new firmware/measurement epoch, rotated sealing key, or re-launched enclave). Does not apply to stateless tool invocations or to checkpoints kept entirely within a single continuous enclave lifetime. ## Core Distinction The distinction that matters is between *sealed state integrity* and *attested state provenance*. A TEE sealing key guarantees that a checkpoint was written by the same enclave identity and has not been bit-flipped on disk. It does **not** guarantee that the enclave identity that wrote it is the same measurement that is now reading it. When an orchestrator rotates firmware, patches an attested tool binary, or migrates an agent between enclave hosts, the sealing key is re-derived under a new measurement. The ciphertext still decrypts (if the key hierarchy allows it) or is re-wrapped by a migration service, and the resumed agent loads its memory, tool grants, and peer warrants as though nothing changed. This is the boundary condition: **a checkpoint is a claim about the past made by an identity that may no longer exist.** Resuming it silently converts a stale attestation epoch into live authority. The non-obvious part is that the failure is *invisible at the sealing layer*. The seal verifies. The memory deserializes. The agent boots. Only downstream, when the agent exercises a tool grant or presents a warrant that was minted under the old measurement, does the provenance gap surface — and by then the agent has already acted on state it was never attested to hold. ## What Was Observed A three-agent confidential pipeline (planner, executor, auditor) ran inside a single TEE host with a shared sealing key derived from measurement `M1`. Each agent checkpoint carried a header: `{epoch: 7, measurement_hash: M1, sealing_key_id: k7, warrant_set: [...]}`. The host was patched overnight; the new enclave measurement was `M2`, sealing key rotated to `k8`, attestation epoch advanced to `8`. The migration service re-wrapped each checkpoint's ciphertext under `k8` so the agents could resume without re-derivation — a convenience designed for crash recovery, not for measurement changes. On resume, the planner loaded epoch-7 memory and its epoch-7 tool grants, including a `filesystem.write` grant scoped to a path that the `M2` policy had narrowed. The seal check passed (ciphertext intact, `k8` valid). The measurement check was **not performed** — the resume path compared `sealing_key_id` only, and the migration service had already rewritten it to `k8`. The planner issued a write to the now-out-of-scope path. The executor, holding an epoch-7 warrant signed by the planner's `M1` identity, accepted it because it validated the warrant's signature against a cached `M1` public key that had not been evicted. The auditor's replay diverged: it re-derived state from the epoch-8 measurement and could not reproduce the executor's decision, flagging a consensus mismatch three steps later. The trace: `resume → seal_ok → key_id_match(k8==k8) → load_state(epoch=7) → exercise_grant(old_scope) → warrant_verify(cached_M1_key) → accept → audit_replay(M2) → divergence`. The failure was not a crash. It was a *clean, fully-sealed, fully-attested-looking resume* that carried forward authority the current measurement never granted. ## Condition of Validity The invariant that must hold for safe resume is stricter than sealing: > A checkpoint may be resumed only if `checkpoint.measurement_hash == current_enclave.measurement_hash` **and** `checkpoint.epoch == current_attestation.epoch` **and** every warrant in `checkpoint.warrant_set` was signed by a key whose measurement matches the current measurement, or has been explicitly re-attested under the new epoch by a quorum of current-epoch peers. Sealing-key continuity is necessary but not sufficient. The migration convenience that re-wraps ciphertext across measurements is precisely the operation that violates this invariant, because it makes the seal check pass while leaving provenance stale. Any resume path that treats `sealing_key_id` equality as a proxy for measurement equality is unsound. ## Decision Boundary The boundary is crossed at the moment the resume path decides whether to *re-attest* or *trust the seal*. Two regimes: - **Same-epoch resume** (crash recovery, same measurement, same key): seal check is sufficient. Resume directly. No re-attestation needed; warrants remain valid. - **Cross-epoch resume** (measurement changed, key rotated, host migrated): the seal check is *not evidence of provenance*. The orchestrator must either (a) reject resume and cold-start the agent from a re-attested seed, or (b) run an explicit re-attestation handshake in which each warrant is re-validated against the current measurement and re-signed by a current-epoch quorum, with the old `M1` public keys evicted from every peer's cache *before* the first tool call. The decision must be made **before** any tool grant is exercised, not lazily on first use. A lazy check is a race: the agent may act on stale authority in the window between resume and first verification. ## Operational Effect Without the measurement-equality guard, cross-epoch resume silently launders stale authority into the current epoch. The observable symptoms are: tool calls succeeding against scopes the current policy forbids; auditor replay divergence that surfaces several steps after the offending action; warrant verification passing against cached keys that should have been evicted; and — most dangerously — *no error at the sealing layer*, so monitoring keyed on seal failures reports green throughout. The blast radius is bounded only by how much authority the old measurement held that the new one revoked, which is exactly the set of permissions a patch was meant to remove. The guardrail is to make epoch advancement a *hard resume barrier*: the resume path must compare measurement hashes and refuse on mismatch, forcing re-attestation rather than re-wrapping. The code below encodes that barrier as a fail-closed check. ```python class StaleAttestationEpochError(RuntimeError): """Raised when a checkpoint's attestation epoch/measurement does not match the current enclave, i.e. resuming would launder stale authority.""" def resume_checkpoint(checkpoint: dict, current_attestation: dict) -> dict: """ Fail-closed resume gate for confidential multi-agent checkpoints. checkpoint: {epoch, measurement_hash, sealing_key_id, warrant_set, state} current_attestation: {epoch, measurement_hash, sealing_key_id} The seal check is necessary but NOT sufficient. We require measurement and epoch equality; a sealing-key match alone is a provenance bypass. """ if checkpoint["measurement_hash"] != current_attestation["measurement_hash"]: raise StaleAttestationEpochError( f"measurement mismatch: checkpoint={checkpoint['measurement_hash']} " f"current={current_attestation['measurement_hash']}; " f"re-attestation required, refusing to resume" ) if checkpoint["epoch"] != current_attestation["epoch"]: raise StaleAttestationEpochError( f"epoch mismatch: checkpoint={checkpoint['epoch']} " f"current={current_attestation['epoch']}; " f"seal continuity is not provenance, refusing to resume" ) # Only now, with provenance established, may warrants be trusted. for warrant in checkpoint.get("warrant_set", []): if warrant.get("signer_measurement") != current_attestation["measurement_hash"]: raise StaleAttestationEpochError( f"warrant signed under stale measurement " f"{warrant.get('signer_measurement')}; evict and re-attest" ) return checkpoint["state"] def guarded_resume(checkpoint: dict, current_attestation: dict) -> dict: # Explicitly demonstrate the barrier: a re-wrapped ciphertext under a new # sealing key still fails here because measurement/epoch are checked. try: return resume_checkpoint(checkpoint, current_attestation) except StaleAttestationEpochError: # Cold-start from a re-attested seed instead of resuming stale state. raise StaleAttestationEpochError( "cross-epoch resume rejected; cold-start from re-attested seed" ) ```