P02 — Weight-to-Chip Binding: PCR-Policy-Sealed Model Weights
Status
red· Claim PC3+PC4 · Corpus anchor L4 §1.3, §1.4, §3 row “model-weight-to-chip binding … needs maturity” · Effort M · Execution host VM (swTPM)
What it proves
PC3 + PC4 — the two primitives the corpus says weight-to-chip binding is built on:
- Key sealing (PC3): a secret (here: the key wrapping a model-weights file) is only unlockable when the TPM’s PCR registers match an expected boot-state measurement. Quote from L4 §1.4 / OpenTitan: “Only a boot chain signed with the expected set of keys shall be able to unlock stored keys/secrets.”
- Remote attestation (PC4): a verifier can check a signed quote over those PCRs before handing over the weights — “prove it to me before I hand you anything sensitive.”
The maneuver is the exact building block the corpus files under M15 (“weight-to-chip binding at datacenter scale = build-on-primitives, not a shipped product”). We build and demonstrate the primitive ourselves; we do not claim the product exists. “Proven” here means you have sealed a weights key under a PCR policy, watched it decrypt in the valid state, and watched the unseal fail after the state drifts.
Why it matters
The corpus anchors this at L4 §1.3 and §1.4, and at the §3 maturity row “model-weight-to-chip binding … needs maturity”: the book’s load-bearing argument is that protecting weights on a chip is buildable from primitives, not a product you can buy. The demonstration that matters is the negative result — after the PCR drifts, the weights must NOT decrypt. If sealing or attestation were not real user-available primitives, the whole weight-to-chip story of the thesis would be vaporware.
Why this, not that
| We do (Y) | We don’t (X) | Because |
|---|---|---|
| Seal an AES wrapper for a real weight-file with a PCR policy | Encrypt the weights with a plain passphrase/age | Encryption at rest alone (corpus E3) does nothing for who/what may decrypt it; the TPM binding answers “which machine, in which boot state” — that’s the RoT claim, not just cryptography. |
| swTPM + tpm2-tools on a stock Linux box | A physical TPM or a Cloud TEE | Proves the maneuver is available to a normal user on hardware they own; transfers to a real chip via a TCTI change. |
| Demonstrate both success and tamper-deny | Just show the happy path | The load-bearing moment is the negative result: weights unreadable after state drift — that’s what “binding” buys. |
| Wrap a real (small) model file | A random blob | The user is here to protect model weights; use an actual .safetensors/GGUF so the demo speaks in their domain. |
What you need
- P01 completed (swtpm running, TCTI exported), or just run
02-start-swtpm.shhere too. - A small model file, e.g.
curl -L -o weights.safetensors <any HF model>, or a generated stand-in. On the Linux server,huggingface-cli downloadalso works.
How to run it
cd poc/P02-weight-binding— enter this PoC’s directory.bash scripts/01-seal-weights.sh weights.safetensors— wraps the weights under a PCR-policy-sealed key.bash scripts/02-unseal-and-decrypt.sh— valid state: quote verified, weights decrypted.bash scripts/03-tamper-deny.sh— extends the PCR to a “wrong” state; the unseal must FAIL.
If you have no model file handy, 00-seed-weights.sh can generate a 4 KB stand-in
(--standin) — the mechanism is identical.
What “done” looks like
bash scripts/02-unseal-and-decrypt.sh; echo $? # MUST print POC-P02-UNSEAL-OK and exit 0
bash scripts/03-tamper-deny.sh; echo $? # MUST print POC-P02-TAMPER-DENIED and exit NONZERO02 alone is not proof — the corpus point is negative-condition behavior: after the
PCR drifts, the weights must NOT decrypt.
Where the evidence goes
Copy into evidence/:
weights.enc+sealed.keycontexts (public part is fine to keep, private is derivable only under correct PCR) — record SHAs.quote.msg,quote.sig,pcr.datfrom step 02.- Step 03’s failure transcript showing the unseal failed.
What this does not prove
- The PCR used here (16) is arbitrary practice — real measured boot uses PCRs 0–7 (0–3 specified by TCG PC Client, 4–7 bootloader/OS). We use an extended PCR to simulate “boot state.” Explain this in the report so we don’t overclaim measured boot.
- The swTPM restarts with an empty PCR set (startup-clear) each time — that’s fine, the policy binds to a value we extend in, not to a physical boot.
- Do NOT copy the acceptance message string — the script prints exactly
POC-P02-UNSEAL-OK/POC-P02-TAMPER-DENIED; paste the actual output.