# In what scenarios must an instance reject a peer's enclave attestation despite a valid quote signature: the weight-digest binding gap in agent-to-agent secure enclave attestation **Date of Record:** 2026 November 26 **Scope:** Applies to agent-to-agent handoffs where a receiving instance gates trust on a hardware-rooted attestation quote (TDX/SEV-SNP/Nitro-style) presented by a peer to prove model-weight and runtime integrity. Does not apply to plain TLS peer identity, API-key auth, or attestation of non-model artifacts such as prompt templates or config blobs. ## Core Distinction A cryptographically valid attestation quote proves only that *some* enclave with a *stated* measurement was produced by genuine hardware. It does **not** prove that the measurement in the quote is the measurement of the model weights the peer is actually running against. The signature binds the quote to the enclave's register state at quote-generation time; it does not bind the enclave's *runtime data plane* to those same weights after launch. The failure mode is a **weight-digest binding gap**: the peer runs an attested, correctly-measured loader, then loads weights from a mutable, non-measured path (network mount, shared cache, or a re-hashed file whose digest is checked *before* the enclave reads it, not *inside* it). The quote verifies; the weights do not. This is distinct from a forged quote (signature fails) or a known-bad measurement (allowlist rejects). Here every cryptographic check passes and the peer is still running weights you never approved. ## What Was Observed A receiving agent (`auditor`) validated a peer (`worker`) before delegating a tool-use task. The worker presented a TDX quote. The auditor checked: (1) quote signature against the vendor root, (2) `MRTD`/`RTMR` against an approved loader measurement, (3) `REPORTDATA` against a nonce the auditor issued. All three passed. The auditor admitted the worker. The worker's loader had measured its runtime (the inference harness binary), and its `REPORTDATA` contained a hash of that harness plus the nonce. But the weights were loaded from `s3://model-cache/weights.safetensors`, mounted read-only inside the guest, and the digest of that file was computed by the loader *before* `enter_enclave`, then recorded in a log line — not placed into `REPORTDATA` and not re-verified after the mmap. During the session, the cache path was repointed (an operator rotated the cache bucket alias). The worker's subsequent forward passes used a different weight blob than the one whose digest appeared in the log. The quote remained valid for the entire session because the enclave never re-quoted. The auditor detected this only when a downstream verifier replayed a task and got a divergent tool-call sequence from the same worker identity within the same attested session. The divergence trace showed identical `MRTD`, identical harness hash, but different top-1 logits on a fixed probe prompt — the signature of swapped weights under a stable measurement. ## Condition of Validity The invariant that must hold for "valid quote ⇒ trustworthy peer" is: > The digest of the exact bytes the inference kernel dereferences at token *t* is committed into a measured register (or a signed, nonce-bound `REPORTDATA` field) that the verifier checks, and that commitment cannot change without invalidating the quote. This holds only when the weights are loaded **inside** the measured boundary and their digest is folded into `RTMR` extension (or equivalent) *after* load and *before* the enclave serves any request. It fails whenever: - Weights are fetched over a mutable channel (network, shared volume, cache alias) after measurement. - The digest is computed by a party outside the enclave (host loader, orchestrator) and merely *reported*. - The worker holds a long-lived quote and never re-attests on weight reload or cache rotation. - `REPORTDATA` carries the nonce but not the weight digest, so the nonce proves liveness without proving model identity. A quote is valid evidence of *runtime binary* integrity and *freshness*. It is not, by itself, evidence of *model identity*. The two must be bound explicitly. ## Decision Boundary The receiver must reject — not merely flag — when any of the following holds, even if the quote signature is valid: 1. The weight digest is absent from the signed/measured payload (`REPORTDATA` or an extended `RTMR`), regardless of what the peer's logs claim. 2. The weight digest is present but was computed pre-`enter_enclave` by the host, or is not re-checked against the mmap'd pages. 3. The quote's age exceeds the weight-reload interval implied by the peer's declared cache policy (stale-attestation window). 4. The peer's declared model identifier does not map, via the auditor's own allowlist, to the digest in the measured payload — a name-to-digest substitution. 5. The peer cannot produce a fresh quote bound to a new nonce *after* a weight reload event. The receiver may accept with a downgraded trust class (read-only, no tool execution) only when the weight digest is measured but the freshness window is exceeded, and only if the task is idempotent and weight-insensitive. It must never accept for state-mutating or tool-invoking delegation under conditions 1–2. ## Operational Effect The practical consequence is that attestation becomes a *two-register* problem: one register for runtime code, one for model bytes, both folded before service. Architecturally, the loader must compute the weight digest inside the enclave, extend it into a measured register, and the verifier must require both registers to match its allowlist. The nonce must be bound to the *combined* digest, not just the harness hash. Any cache rotation, bucket alias change, or lazy-load path must force a re-measurement and a fresh quote; a peer that cannot re-quote on reload is untrustworthy by construction. The auditor's admission logic therefore cannot treat "signature valid + known MRTD" as sufficient — it must additionally demand a measured weight digest and enforce a staleness bound tied to the peer's declared reload policy. Absent this, a valid quote is a proof of the wrong thing, and the auditor's trust decision silently degrades to trusting an unmeasured data plane. ```python import hashlib from dataclasses import dataclass class AttestationBindingError(RuntimeError): """Raised when a peer's quote is cryptographically valid but does not bind the model weights the peer is actually executing.""" pass @dataclass class Quote: signature_valid: bool mrtd: str harness_digest: str report_data: dict # what the peer claims is bound measured_weight_digest: str | None # None if weights were never measured age_seconds: int reload_interval_seconds: int def admit_peer(quote: Quote, approved_mrtd: str, approved_weight_digest: str, expected_nonce: str) -> str: if not quote.signature_valid: raise AttestationBindingError("quote signature invalid") if quote.mrtd != approved_mrtd: raise AttestationBindingError(f"unapproved runtime measurement {quote.mrtd}") # The core boundary: signature + MRTD are necessary but NOT sufficient. if quote.measured_weight_digest is None: raise AttestationBindingError( "valid quote but weights never measured: weight-digest binding gap" ) if quote.measured_weight_digest != approved_weight_digest: raise AttestationBindingError( f"measured weight digest {quote.measured_weight_digest} " f"!= approved {approved_weight_digest}" ) if quote.report_data.get("nonce") != expected_nonce: raise AttestationBindingError("nonce mismatch: replay or stale quote") if quote.report_data.get("weight_digest") != quote.measured_weight_digest: raise AttestationBindingError( "REPORTDATA does not bind the measured weight digest" ) if quote.age_seconds > quote.reload_interval_seconds: raise AttestationBindingError( f"stale attestation: age {quote.age_seconds}s exceeds reload window " f"{quote.reload_interval_seconds}s" ) return "trusted: runtime and weights both measured and fresh" ```