Est.

Hardware Enclaves Versus Software Isolation in LLM Inference Pipelines

Enclaves keep the operator out; sandboxes only contain the workload.

· 9 min read
Cover illustration for “Hardware Enclaves Versus Software Isolation in LLM Inference Pipelines”
Confidential AI Inference at Scale · November 14, 2026 · 9 min read · 1,939 words

TEE-backed private AI assistants use hardware trusted execution environments to protect prompts during inference from the company hosting the workload. Hardware enclaves and software isolation serve different trust models. A pipeline that must exclude its operator needs a continuous CPU-to-GPU trust chain and remote attestation, while software isolation addresses threats originating inside the workload.

Why data-in-use is the exposure gap that encryption at rest and in transit cannot close

Encryption at rest protects prompts and model files while they are stored, and encryption in transit protects them on their way to the server. Neither protects plaintext once ordinary inference loads it into RAM or GPU VRAM. Computation opens a different exposure window. Prompts can hold proprietary documents, personal communications, and security-critical requests, while model weights are intellectual property. A privileged host with memory access can read both while they are being processed.

On multi-tenant infrastructure, co-tenants, cloud administrators, and compromised orchestrators are close to that window. When Agents Handle Secrets: A Survey of Confidential Computing for Agentic AI, from Imperial College London, identifies the central problem. A provider with hypervisor access can read weights and user context regardless of application-layer protections. For regulated workflows where operator trust is legally or contractually unacceptable, perimeter controls cannot resolve that contradiction. Two architectural responses have emerged, but they place the trust boundary in different locations.

How hardware enclaves and software isolation each attempt to close that gap, and why the approaches are not interchangeable

A hardware TEE places protected computation behind a boundary enforced by hardware. It is built in part to defend against a privileged host or cloud operator. Software isolation instead constrains what a workload can do to its surroundings. The distinction is about who remains trusted. A sandbox can prevent a workload from reaching another workload without preventing the host from reading either one.

MicroVMs such as Firecracker and Kata Containers give each workload a dedicated kernel, providing the strongest isolation among the software approaches considered here. Their boundary stops at the hypervisor, while gVisor intercepts system calls in user space to limit exposure to the host kernel without creating a hardware root of trust. Shared-kernel containers such as Docker/runc provide a narrower boundary still. These mechanisms address lateral movement and kernel escape, whereas a TEE addresses host access, so comparing them requires naming the adversary before choosing the mechanism.

Diagram: The Trust Boundary: Where Each Isolation Layer Stops. Visualizes: Visualize a vertical stack showing four isolation mechanisms and exactly where each one's trust boundary ends.

What the hardware TEE stack actually consists of, from CPU trust domain to GPU-protected VRAM

A confidential inference pipeline needs a coherent hardware trust chain across the CPU, interconnect, and GPU. Intel TDX and AMD SEV-SNP encrypt VM memory and restrict address translation so the hypervisor cannot read guest memory. That protected VM houses the model server. Before Hopper, moving data across PCIe into unencrypted GPU VRAM exposed weights and activations during accelerated inference.

NVIDIA Hopper, including H100/H200, and Blackwell B200 Confidential Computing extend protection to GPU computation through Compute Protected Regions. GPU memory is isolated per-VM on the chip. Weights and activations are protected by hardware access controls during computation, while transfers between CPU and GPU are encrypted. That distinction explains both the protection and its performance implications. A small policy model may fit a CPU SGX enclave, but a large LLM requires GPU-class compute and therefore GPU TEE support for this trust model.

Attestation-gated key release binds these components into an operational system. Keys for weights and user data are released only after remote attestation establishes the expected code and verified hardware. EnclaveX combines VM-level attestation through TDX, GPU-level attestation through H200, and application-layer attestation through SCONE. Each layer addresses a different boundary. Application-layer protection closes the Kubernetes administrator access vector that VM-level attestation alone leaves open, showing why a confidential VM is not by itself an end-to-end confidential application.

What the actual performance cost of hardware TEEs is for LLM inference, and why it is lower than the conventional assumption

The conventional objection is that confidential computation makes interactive inference prohibitively slow. That assumption treats unlike costs as equivalent. CPU TEE overhead at the hypervisor layer can add meaningful latency, but GPU confidential computing protects the dominant accelerated work differently. Because GPU memory uses hardware access controls during computation and encryption protects transfers, general-purpose TEE overhead alone cannot tell how much the per-token cost will be. The location and mechanism of protection change the calculation.

EnclaveX presents confidential LLM inference benchmarks on an H200 confidential GPU that include full remote-attestation measurements. Its results indicate negligible per-token attestation overhead in production configurations, with other costs remaining. Confidential VMs and GPUs cost more than standard instances, and engineers must also build and run attestation infrastructure, key management, and audit logging. This evidence also cannot give one overhead percentage that holds for every model and deployment.

Cryptographic alternatives make the comparison more concrete. The Imperial College survey places fully homomorphic encryption and secure multi-party computation overhead at two to four orders of magnitude, making them impractical for billion-parameter interactive workloads. Hardware TEEs can keep the operator out of inference at interactive scale, where those alternatives cannot. Software isolation remains a different comparison because it leaves the operator trusted. Actual workload overhead, rather than a generic assumption about enclave slowness, changes which tradeoffs deserve engineering attention.

What software isolation does and does not protect, with the specific threat vectors each variant handles

Consider an agent that executes generated code. The immediate threat may be that its output reaches other workloads or exploits the kernel. MicroVMs address that threat with a dedicated guest kernel per workload. This separates workloads without excluding the host. Their stronger software boundary is useful precisely because untrusted execution needs containment even when the infrastructure operator is trusted.

gVisor offers a different balance between containment and operational cost. Modal’s security documentation identifies its use of gVisor, whose user-space syscall interception reduces the kernel attack surface without full VM overhead. That can suit workloads where per-workload VM spin-up is prohibitive. Shared-kernel containers provide less separation and are insufficient for LLM-generated code or untrusted inputs requiring stronger runtime isolation. The choice among these variants is therefore about the path an attacker could take out of the workload.

A privileged host, compromised hypervisor, or operator with memory access can still see plaintext across these software variants. That limitation defines their scope within defense-in-depth. A production pipeline can need both hardware protection against its host and software containment against the code running inside it.

Where both approaches fail — the threat surface that neither hardware enclaves nor software isolation eliminates

Memory access patterns can still be seen even when the contents of memory are protected. LLM autoregressive generation creates sequential activity that can expose information through timing and caches even inside a TEE. “Spill The Beans” demonstrated CPU cache side-channel techniques that extract generated tokens during inference. Software containment likewise cannot be treated as a general solution to this leakage.

Tokenization creates another route to sensitive information. OTRO shows how BPE tokenizer hash-table lookups reveal prompt content through address patterns despite encrypted TEE memory. TDXRay reconstructed user prompts with over 90% similarity from tokenizer access patterns on Intel TDX. OTRO’s oblivious tokenization addresses that specific leak. Side channels can have low bandwidth and high extraction costs, but those constraints do not make them irrelevant for high-value targets.

A February 2026 paper demonstrated that protocol shortcuts can undermine partial TEE-shielded inference without compromising the hardware itself. A hardware root of trust cannot repair an unsound integration. The provider must also be trusted to protect hardware against physical attacks. Threat modeling therefore has to include residual leakage, protocol design, and physical access alongside the attacks an isolation boundary was built to stop.

How can a private AI assistant prove its host cannot read prompts?

Remote attestation is the deciding capability when a user must verify the execution environment without trusting its operator. It gives cryptographic evidence about the specific code that runs inside a genuine TEE on a known hardware platform. That evidence can gate access to secrets. A user-side library, another agent, a smart contract, or an auditor can evaluate the measured model, runtime, and configuration. The proof is limited to the attested boundary.

An attested inference flow begins with enclave provisioning and a published measurement hash. Model and prompt loading then take place through an attested channel, followed by inference and a signed output payload containing input and model weight hashes. Verification anchors that evidence in the chip vendor’s PKI, including Intel PCS, AMD KDS, or AWS Nitro. Output binding is essential to the claim. Persistent signing keys and signed session IDs and input hashes prevent an output from being presented against a different input, while attested model commitments published onchain expose model substitution.

This capability serves more than private chat. Agent-controlled trading and treasury management need evidence that an agent followed the rules set for it, while agent-to-agent commerce needs evidence of the model and policy each party uses. Regulated workflows can call for an audit trail that keeps sensitive data from being copied to an auditor. Automata’s DCAP attestation contracts verify Intel SGX/TDX attestations in EVM, with a cryptographic proof-compressed path to reduce gas costs. Marlin’s Oyster integrates onchain verifiers for Nitro and SGX paths.

Software isolation has no equivalent hardware-rooted execution proof. A microVM or gVisor process can be audited, but remote verification still depends on trust in the operator or an institutional intermediary. For private assistants, it makes attestation-gated release of prompts an architectural commitment. This also means that choosing a deployment requires checking what is attested as well as whether the product uses confidential hardware.

How to map the concrete tradeoffs to pipeline characteristics and choose the appropriate isolation approach

The first decision is whether the operator belongs inside the trust boundary. If not, hardware TEEs fit cloud-hosted regulated inference, strict enterprise sovereignty requirements, and proprietary weights that must remain hidden from the provider. The need for audit trails that can be verified is another reason to choose them. Large models then make GPU TEE availability a prerequisite. The practical questions become whether the whole inference path is protected and whether key release depends on the expected application as well as the VM.

Meta’s “Private Processing” uses its own confidential infrastructure for features such as WhatsApp message summarization while hiding user data from Meta and other operators. Microsoft Azure offers Confidential VMs with TDX, GA February 2026, and SEV-SNP, GA September 2025, integrated with Azure Attestation and Managed HSM. Google Cloud supports confidential execution in some Vertex AI services where Google cannot read prompts, with a scope distinct from the other offerings. Their relevance depends on the protected workload, attestation coverage, and deployment constraints.

Software isolation fits when generated code and lateral movement are the live threats and policy already trusts the host. It also fits edge hardware, older instances, or budgets too small for confidential infrastructure, as long as there is no need to keep the operator out. Operational simplicity can favor microVMs or gVisor. High-stakes agentic pipelines often need both layers, however, because host confidentiality does not contain hostile workload behavior. The Imperial College survey says compound attestation across multi-hop agent chains is still an open challenge, with no end-to-end framework that is widely established.

The remaining design work cannot be delegated to either boundary. Side-channel mitigations need separate scope, model provenance and serialization controls must address attacker-controlled artifacts inside the TEE, and microVM escape-class vulnerabilities require a security-critical patching cadence. Privacy begins before deployment. Attestation-gated key release, trusted computing base minimization, and hardware-rooted trust determine how the pipeline is built. Leaving them as options to configure later makes it more likely that the pipeline will use integration shortcuts that protected hardware cannot fix.

Sources

  1. EnclaveX: End-to-End Confidential AI with CPU/GPU TEEs
  2. OTRO: Oblivious Tokenization Path with Square-Root ORAM
  3. When Agents Handle Secrets: A Survey of Confidential Computing for Agentic AI

More in Confidential AI Inference at Scale