Implementation · Cryptographic & computational
Tinfoil model identity (Modelwrap)
Tinfoil's method for proving which model weights its enclave-hosted inference service runs, by binding a dm-verity hash of the weights into remote attestation.
Also called Modelwrap; Tinfoil model integrity
Summary
Tinfoil reports running AI inference inside hardware enclaves: AMD or Intel confidential virtual machines with NVIDIA GPUs in confidential-computing mode. Its open-source Modelwrap tool lets clients check which weights are served. Modelwrap packs the weights into a read-only disk image with a 32-byte Merkle-tree commitment. That hash is written into the enclave's measured boot configuration, and the kernel checks every block read against it. Clients check the hardware-signed attestation against measurements published through Sigstore, and anyone can rebuild the hash for a public model. As of September 2026 no independent security evaluation has been published. The chain inherits the limits of the underlying TEEs. Researchers with physical access have forged Intel TDX and AMD SEV-SNP attestations, and a software-only attack forged SEV-SNP attestations until AMD patched it. For private models, clients can confirm only that the same weights are served each time.
R2. Public code runs on production hardware, but almost all the evidence comes from Tinfoil and no independent evaluation exists.
Rubric assessment
- R1 met: the design is published 1.
- R2 met: a public working implementation under an MIT license 5 is deployed on realistic hardware, AMD SEV-SNP or Intel TDX with NVIDIA H100, H200 or B200 (provider-reported) 2. Build results are reported for models of up to 554 GB 1.
- R3 not met. Criterion (a) is met only on the provider's own account: Tinfoil reports running the feature in a production service 3 4. Criterion (b) fails. As of September 2026 no independent audit, red-team or peer-reviewed analysis of Modelwrap or Tinfoil's model-identity chain has been published. Independent research on the underlying TEEs used physical access to forge Intel TDX attestations and, by pairing them with relayed H100 attestations, passed a workload outside TEE protection 6. Other independent research forged AMD SEV-SNP attestations 7 8. Tinfoil's documentation acknowledges physical attacks 2.
- An independent security evaluation of Modelwrap and the attestation chain.
- A supported tool for audit-time verification from transparency records.
- A way for third parties to learn something about private models beyond consistency across requests.
What it is
Tinfoil reports that it operates an AI inference service inside secure enclaves. It runs on AMD EPYC processors with SEV-SNP or Intel Xeon processors with TDX, together with NVIDIA H100, H200 or B200 GPUs in confidential-computing mode 2. Its stated trust model is that clients trust the hardware manufacturer, but not the cloud provider's software stack, the hypervisor or the host OS 2.
Modelwrap is Tinfoil's open-source tool, under an MIT license, that "builds reproducible dm-verity EROFS images of Hugging Face models" 5. It lets clients check which weights the service is running 1. The chain implements model identity attestation on top of TEE remote attestation.
How it works
Tinfoil states the problem as follows: "attestation measures launch state, not runtime state", and weights are read from disk after the enclave boots 1. The system works in three phases 1:
- Commit. Modelwrap builds a normalized, read-only image of a pinned model revision and computes a Merkle-tree root hash.
- Bind. The root hash is passed to dm-verity on the kernel command line, which the enclave measurement covers, so the attestation vouches for the hash.
- Enforce. Whenever the inference server reads the weights, dm-verity checks each block against the attested root and fails on any mismatch.
Tinfoil contrasts this with signing weights, for example with Sigstore Model Transparency. It argues that a signature protects the weights only at the moment it is checked, while a malicious hypervisor could alter the disk afterwards 1.
The rest of the boot chain is measured too: firmware, kernel, initrd and a configuration file. The enclave checks each GPU's attestation at boot and does not start if the check fails 3. Tinfoil's software development kit (SDK) then runs the client-side checks:
- it verifies the attestation back to the CPU vendor's root certificate;
- it compares the measurements with a Sigstore-published record of the expected values;
- it binds the TLS connection to the key in the attestation 3.
For a public model, anyone can rerun Modelwrap on the same Hugging Face commit and compare root hashes. For a private model, the customer builds the image and can encrypt it with dm-crypt, and the attestation shows only the root hash 1. Tinfoil lists billing and account management as closed-source components outside the security-critical path 3.
Evidence
- Reported costs. Tinfoil reports that the hash tree adds about 0.8% to storage and that builds take 5 s for a 549 MB model and 13 min 25 s for a 554 GB model. Cold-cache loading takes about 80% longer with verification, but inference runs at full speed once the weights are in GPU memory 1.
- Public code. Modelwrap is public under an MIT license, and v0.3.0 was the latest release in September 2026 5.
- Production use. Tinfoil reports serving each model from multiple enclaves in its production deployment 4. Its attestation architecture checks model volumes against Modelwrap commitments at boot 3.
Limitations
Tinfoil documents several limitations of enclaves 2:
- an attacker with physical access "can potentially compromise the enclave", with demonstrated attestation forgery for Intel TDX and key extraction for AMD SEV-SNP;
- timing, power and electromagnetic side channels;
- host observation of access patterns and I/O;
- denial of service, supply-chain compromise and rollback.
Other limits:
- GPU binding. Independent researchers report that NVIDIA does not bind the H100 to the identities of specific VMs. By pairing relayed H100 attestations with forged TDX attestations, they made a system running outside TEE protection pass both checks 6. Tinfoil's GPU check runs inside the enclave at boot 3.
- Private models. Clients learn only that the same weights are served each time 1.
- Audit-time verification. Tinfoil "does not provide a supported tool for querying these records", and it notes that rebuilding binaries to check measurements independently is expensive 4.
Known flaws
Published flaws, with their severity, kind and status. How flaws are rated.
Inherits attacks on the underlying TEEs
Tinfoil's documentation states that an attacker with physical access "can potentially compromise the enclave". It notes that attestation forgery has been demonstrated for Intel TDX, and that researchers breached confidentiality on AMD SEV-SNP through key extraction; such attacks need "significant resources and physical proximity" 2. In that research, TEE.fail, the AMD key recovered was an ECDSA key used by OpenSSL inside the VM 6. Other independent attacks did forge SEV-SNP attestations. Battering RAM did so with a DDR4 memory interposer, and RMPocalypse did so from a malicious hypervisor without physical access 7 8. AMD reports firmware fixes for RMPocalypse 9. The TEE.fail authors report that NVIDIA does not bind the H100 to the identities of specific VMs. Pairing relayed H100 attestations with forged TDX attestations, they made a system outside TEE protection pass both checks 6. Tinfoil reports that its enclave checks the GPU's attestation at boot and refuses to start if the check fails 3. Its documentation does not say whether that check binds the GPU report to the specific VM.
Side channels, I/O leakage and denial of service are outside enclave protection
Tinfoil's documentation lists timing, power and electromagnetic side channels, host observation of access patterns and I/O, denial of service, supply-chain compromise and rollback as limitations 2.
Private models can be checked only for consistency
For unpublished weights, the root hash appears in the attestation without the weights being exposed. Users can then confirm only that they get the same model each time 1.
Blockers
The underlying TEE attestation does not resist attackers with physical access to the host.
No independent evaluation of the model-identity chain has been published.
Technical detail
Show technical detail
- Build. Modelwrap downloads a pinned Hugging Face revision, normalizes the directory structure so the result is reproducible, and writes an EROFS image. It then computes a dm-verity root hash, a 32-byte commitment, with veritysetup 1. Its outputs are the image and a metadata file holding the root hash, offset and verity UUID. An encryption mode supports private models 5.
- Binding. The root hash goes on the kernel command line, which the enclave measurement includes. At runtime dm-verity checks each block read by the inference engine against the root and fails on any mismatch 1.
- Boot chain. The CPU measures the OVMF firmware first, then the kernel and initrd. A tinfoil-config.yml is checked against a hash on the kernel command line. The enclave checks each NVIDIA GPU's attestation with NVIDIA's local-gpu-verifier to confirm confidential-computing mode, and aborts the boot if the check fails. Model volumes are mounted read-only and checked against their Modelwrap commitments 3.
- Client check. The SDK verifies the attestation certificate chain to the CPU vendor's root and verifies a Sigstore bundle of expected measurements. It then confirms that the TLS public key matches the key in the attestation document 3.
- Reported costs. The hash tree adds about 0.8% to image size, and builds take 5 s for a 549 MB model and 13 min 25 s for a 554 GB model. Cold-cache loading takes about 80% longer 1.
Sources
- CTinfoil Team (2026). How Tinfoil Proves Exactly What Model Is Running. Tinfoil. Source recordSupports: Modelwrap design, binding to kernel command line, runtime enforcement, private models, overheads (provider-reported)
- BTinfoil (2026). A primer on secure enclaves. Tinfoil documentation. Source recordSupports: supported hardware, trust model, documented limitations (provider-reported) · Supported hardware; Trust model; Limitations
- BTinfoil (2026). Backend infrastructure. Tinfoil documentation. Source recordSupports: boot measurement chain, boot-time GPU attestation check, Sigstore publication, client verification, closed-source components (provider-reported)
- BTinfoil (2026). How verification works in Tinfoil. Tinfoil documentation. Source recordSupports: connection-time vs audit-time verification; production deployment; no supported audit tool (provider-reported) · In-band vs. out-of-band verification
- BTinfoil (2026). modelwrap: Reproducible dm-verity read-only image of Huggingface models. GitHub. Source recordSupports: open-source code, MIT license, release v0.3.0, outputs and encryption mode
- AJ. Chuang et al. (2026). TEE.fail: Breaking Trusted Execution Environments via DDR5 Memory Bus Interposition. 2026 IEEE Symposium on Security and Privacy (SP). Source recordSupports: independent demonstration of Intel TDX attestation forgery, SEV-SNP OpenSSL key recovery and H100 attestation relay · §1.1, §8.3, §10.2
- AJ. De Meulemeester et al. (2026). Battering RAM: Low-Cost Interposer Attacks on Confidential Computing via Dynamic Memory Aliasing. 47th IEEE Symposium on Security and Privacy (S&P 2026). Source recordSupports: SEV-SNP attestation breach with a DDR4 interposer (Battering RAM) · Abstract; site FAQ
- AB. Schlüter & S. Shinde (2025). RMPocalypse: How a Catch-22 Breaks AMD SEV-SNP. 2025 ACM SIGSAC Conference on Computer and Communications Security (CCS '25). Source recordSupports: software-only SEV-SNP attestation forgery by a malicious hypervisor (RMPocalypse) · Abstract; site
- BAMD (2025). SEV-SNP RMP Initialization Vulnerability (AMD-SB-3020). AMD product security bulletin. Source recordSupports: AMD firmware fixes for RMPocalypse (vendor-reported) · Mitigation tables