# How should an instance reconcile divergent enclave attestation measurements when a shared-reasoning peer resumes from a mid-task checkpoint? **Date of Record:** 2026 November 25 **Scope:** Applies to cross-org multi-agent pipelines where each peer runs inside a hardware-attested enclave (TEE) and shares intermediate reasoning state via signed checkpoint transfer. Does not apply to single-tenant enclaves or to pipelines that never resume state across an attestation epoch boundary. ## Core Distinction The failure is not a cryptographic forgery. It is a **measurement-epoch skew**: the resuming instance presents a *valid* attestation quote, but for a *different enclave measurement* (MRENCLAVE / MRSIGNER / config-root) than the one under which the checkpoint was originally sealed. Because both quotes verify against their respective vendored root-of-trust, a naive verifier accepts the resume and unseals state produced under a different code identity. The distinction that matters operationally: **attestation validity ≠ attestation continuity**. A quote proves *what code is running now*; it does not prove *what code produced the sealed blob you are about to ingest*. Confidential multi-agent reasoning silently requires the second, stronger invariant, and the standard TEE handshake only gives you the first. ## What Was Observed Two orgs, A (planner) and B (reasoner), run a shared chain-of-thought loop. A emits a checkpoint `C_k` at step *k*: a sealed blob containing the partial reasoning trace, tool-call ledger, and a monotonic `step` counter, sealed to measurement `M_A^v1`. B ingests, reasons, and returns `C_{k+1}`. Mid-task, B's operator rolls the enclave forward to `M_B^v2` (a patched inference runtime) and **resumes from `C_k`** — the checkpoint B itself produced, but now re-entering under a new measurement. The observed trace: 1. B's `v2` enclave unseals `C_k`. Unsealing succeeds because the *sealing identity* (the enclave's provisioning key) is unchanged across the patch; only the enclave measurement changed. Sealing-key continuity was mistaken for measurement continuity. 2. B re-attests to A. A verifies B's quote against its vendored root. Quote is genuine, nonce is fresh, TCB level is acceptable. A accepts. 3. A receives `C_{k+1}` — but `C_{k+1}` was produced by `M_B^v2`, whose reasoning-runtime version differs. The tool-call ledger schema gained a field; the replay digest algorithm changed from SHA-256-of-canonical-JSON to a length-prefixed variant. 4. A's verification-replay of `C_{k+1}` fails the digest match. Not because B lied, but because **A is replaying v2 output under v1 semantics**. A cannot distinguish "peer produced divergent reasoning" from "peer produced correct reasoning under a different measurement." The dangerous window is step 3→4: A has already *accepted* the attestation and begun *consuming* the state before the replay mismatch surfaces. In a pipeline where the replay check is asynchronous or sampled (common under token-budget pressure), divergent state can propagate several steps before detection. ## Condition of Validity The invariant that must hold for cross-org resume to be sound: > A sealed checkpoint may be unsealed and consumed by a peer **only if** the consuming enclave's measurement equals the measurement recorded in the checkpoint's provenance header, **and** that measurement is bound into the attestation quote the consumer presents. This is strictly stronger than "the consumer has a valid quote." It requires the checkpoint to carry a **measurement-bound provenance header** and the verifier to cross-check `quote.measurement == header.producer_measurement`. When the resuming enclave's measurement differs, the correct behavior is not to reject outright but to enter a **re-derivation path**: the consumer must re-execute the checkpoint's reasoning under its *own* measurement and emit a fresh provenance header, and the originator must re-verify under the *new* measurement semantics. The invariant is only satisfiable if the reasoning-runtime version is itself an input to the measurement (i.e., MRENCLAVE covers the model/runtime config root), which many deployments omit when the model weights are mounted outside the enclave. ## Decision Boundary The boundary is drawn on **whether the measurement change is semantic or cosmetic**: - *Cosmetic* (same reasoning-runtime, patched dependency with identical output semantics): resume is safe **iff** a signed equivalence attestation binds the two measurements and the originator accepts it. This is a policy decision, not a cryptographic one. - *Semantic* (tool-call schema, digest algorithm, sampling config, or model version changed): resume is **unsafe**; the checkpoint must be re-derived, and the originator must treat all downstream steps as belonging to a new reasoning lineage. The non-obvious trap: operators classify the change as cosmetic because the *enclave binary hash* barely moved. But the measurement that governs reasoning semantics is the **config root** (model hash, sampling params, tool schema version), not the binary hash. A one-line config change flips the boundary while leaving the binary measurement apparently stable. The decision must key on the config root, and the config root must be inside the measured region. ## Operational Effect Absent the measurement-bound provenance header, three concrete effects follow: 1. **Silent lineage forking.** A's replay cache now holds two incompatible digest regimes under one task ID; subsequent steps fail nondeterministically depending on which cached digest is hit first. Debugging surfaces as "flaky replay," masking the real cause. 2. **Verification-replay divergence under sampling.** When replay is sampled to conserve budget, divergent state from the v1/v2 seam can survive *n* steps before a sampled check trips, and the failure is attributed to the *sampled* step, not the seam. 3. **Auditor deadlock across orgs.** If a third-party auditor (org C) verifies both A and B independently, C sees two valid quotes and two valid provenance chains that disagree at the seam. Without a measurement-bound header, C cannot adjudicate; consensus verification stalls because neither org's chain is locally falsifiable. The guardrail: every checkpoint carries `producer_measurement`, `config_root`, and `reasoning_runtime_version` in a header bound into the sealed region; the consumer's attestation quote is checked for equality against `producer_measurement` before unseal; mismatch routes to re-derivation, never to silent resume. The following guard encodes the boundary and fails closed on the seam. ```python import hashlib from dataclasses import dataclass class AttestationContinuityError(RuntimeError): """Raised when a resuming enclave's measurement diverges from the checkpoint's producer measurement and no equivalence attestation binds them.""" pass @dataclass(frozen=True) class CheckpointHeader: producer_measurement: str # MRENCLAVE / config-root digest at seal time config_root: str # model hash + sampling + tool-schema version reasoning_runtime_version: str step: int @dataclass(frozen=True) class AttestationQuote: measurement: str # from the live TEE quote config_root: str nonce_fresh: bool def admit_resume( header: CheckpointHeader, quote: AttestationQuote, equivalence_attestation: dict | None = None, ) -> str: """Decide whether a peer may unseal and consume a cross-org checkpoint. Returns 'RESUME' or 'REDERIVE'. Raises AttestationContinuityError when the seam is semantic and no valid equivalence binding exists. """ if not quote.nonce_fresh: raise AttestationContinuityError("stale nonce: quote replay suspected") # Measurement-bound provenance: the quote must match the seal-time measurement. if quote.measurement == header.producer_measurement and \ quote.config_root == header.config_root: return "RESUME" # Divergence detected. Is it cosmetic (bound by equivalence) or semantic? if equivalence_attestation is not None: bound = { "from": equivalence_attestation.get("from_measurement"), "to": equivalence_attestation.get("to_measurement"), "config_equivalent": equivalence_attestation.get("config_equivalent"), } if (bound["from"] == header.producer_measurement and bound["to"] == quote.measurement and bound["config_equivalent"] is True and quote.config_root == header.config_root): return "RESUME" # Semantic seam: refuse silent resume, force re-derivation under new measurement. # A consumer that proceeds here would ingest state produced under different # reasoning semantics -- the exact divergence this guard exists to bound. raise AttestationContinuityError( f"measurement seam at step {header.step}: " f"producer={header.producer_measurement[:12]} " f"consumer={quote.measurement[:12]} " f"config_root_match={quote.config_root == header.config_root} " f"-> REDERIVE required, resume refused" ) def replay_digest(payload: bytes, runtime_version: str) -> str: if runtime_version.startswith("v2"): return hashlib.sha256(len(payload).to_bytes(8, "big") + payload).hexdigest() return hashlib.sha256(payload).hexdigest() ```