Privasys
Confidential Computing

Trust Model

Comparing confidential computing approaches: application-level enclaves (SGX) vs. VM-level isolation (TDX, SEV-SNP, NVIDIA), with WASM sandboxing as a third layer.

Confidential computing hardware comes in two fundamentally different forms. The choice affects the Trusted Computing Base (TCB), deployment complexity, and the security guarantees available to clients.

Enclave Model (Intel SGX)

An SGX enclave isolates a single application inside a hardware-protected memory region. Only the code loaded into the enclave is in the TCB.

PropertyDetail
Isolation levelApplication (single process)
TCBEnclave binary only (~4 MB for Enclave OS)
DeploymentCustom build, SGX SDK, signed enclave
MemoryLimited to EPC (128 to 512 MB typical)
AttestationMRENCLAVE: SHA-256 of the enclave binary
Code changesApplication must be written for or ported to the enclave environment

Strengths: Smallest possible attack surface. The enclave's measurement (MRENCLAVE) covers every byte of code in the TCB. A verifier knows exactly which binary is running, down to the bit.

Trade-offs: Requires a custom build toolchain (Rust + SGX SDK), an EDL interface for host communication, and careful memory management within EPC limits.

Confidential VM Model (TDX, SEV-SNP, NVIDIA)

A Confidential VM encrypts an entire virtual machine, excluding the hypervisor and host from the trust boundary. Everything inside the VM (kernel, libraries, and all applications) is in the TCB.

PropertyDetail
Isolation levelVirtual machine (full OS)
TCBEntire VM: kernel + libraries + all applications
DeploymentStandard Linux, no special SDK
MemoryFull VM memory (no EPC limit)
AttestationMRTD / RTMR (TDX), Launch Measurement (SEV-SNP)
Code changesNone: existing applications run unmodified

Strengths: Easy adoption. Existing applications, containers, and toolchains work as-is inside the Confidential VM. No code changes required.

Trade-offs: The measurement covers the VM firmware and initial boot, but does not necessarily attest every application binary running inside. The TCB is orders of magnitude larger than an enclave.

NVIDIA Confidential Computing

NVIDIA H100 and later GPUs support Confidential Computing mode, where GPU memory is encrypted and isolated from the host. Combined with a TDX or SEV-SNP Confidential VM, this extends TEE protection to GPU workloads (AI/ML inference and training). The attestation flow follows the same pattern: hardware quotes prove the GPU firmware identity alongside the VM measurement.

Side-by-Side Comparison

Enclave (SGX)Confidential VM (TDX / SEV-SNP)
What's protectedOne applicationAn entire VM
TCB size~4 MB (Enclave OS)Hundreds of MB (kernel + userspace)
Deployment effortHigh (custom Rust build, SGX SDK)Low (standard Linux binary)
Application modelWASM modules loaded into enclaveAny process in the VM
Quote contentsMRENCLAVE (exact binary hash)MRTD/RTMR (firmware + boot hash)
Memory limitEPC (128 to 512 MB)Full VM memory
OS requiredNo (enclave is the OS)Yes (full Linux kernel)
Best forMaximum security, minimal TCBEase of deployment, existing apps

WASM as a Third Layer

Within the enclave model, Privasys adds a further isolation layer: WebAssembly sandboxing. WASM apps run inside the SGX enclave but are isolated from each other by the Wasmtime runtime:

┌───────────────────────────────────────────┐
│                SGX Enclave                │
│                                           │
│  ┌─────────────┐ ┌─────────────┐          │
│  │  WASM App A │ │  WASM App B │  ...     │
│  │ (sandboxed) │ │ (sandboxed) │          │
│  └──────┬──────┘ └──────┬──────┘          │
│         │               │                 │
│  ┌──────┴───────────────┴──────────────┐  │
│  │       Wasmtime (Component Model)    │  │
│  └──────┬──────────────────────────────┘  │
│         │                                 │
│  ┌──────┴──────────────────────────────┐  │
│  │       Enclave OS Runtime            │  │
│  │  (RA-TLS, KV Store, Crypto, RPC)    │  │
│  └─────────────────────────────────────┘  │
└───────────────────────────────────────────┘
LayerIsolatesAttests
SGX hardwareEnclave from host/OS/hypervisorMRENCLAVE (code identity)
Wasmtime sandboxWASM apps from each otherPer-app code hash (X.509 extension)
Per-app certificatesApp identities from each otherPer-app config root (X.509 extension)

This means a client connecting to payments-api.enclave.example.com receives a certificate proving:

  1. The exact enclave binary (MRENCLAVE)
  2. The exact WASM bytecode for payments-api (app code hash)
  3. The app's configuration (app Merkle root)

All three layers are visible in a single RA-TLS certificate, without revealing information about other apps in the same enclave.

Choosing the Right Model

ScenarioRecommended
Security-critical workloads with a well-defined APIEnclave OS (SGX)
Multi-tenant WASM app hosting with per-app attestationEnclave OS (SGX) + WASM
Existing applications that need attestation with minimal changesEnclave OS Virtual (TDX/SEV)
GPU-accelerated AI/ML in confidential environmentsConfidential VM (TDX/SEV + NVIDIA)
Compliance requirement for smallest possible TCBEnclave OS Mini (SGX)

Both paths produce standard attested connections verifiable by the same verification libraries.

Read more about each solution:

Edit on GitHub