Skip to content
1Claw Academy
Curriculum/Security Foundations2 minBeginner · Lesson 15 of 19

Trusted Execution Environments

Protect data while it is being used, not just at rest and in transit, and know what attestation does and does not prove.

Encryption at rest protects stored data. TLS protects data in transit. Both leave a gap: while a program runs, its data sits in memory in the clear, readable by anyone with sufficient privilege on that machine: including the operator.

A Trusted Execution Environment closes that gap with hardware. Memory is encrypted by the CPU, and code outside the enclave (the host OS, the hypervisor, the cloud provider's administrators) cannot read it.

  • AMD SEV-SNP and Intel TDX encrypt an entire virtual machine's memory.
  • Intel SGX isolates smaller enclaves within a process.
  • Remote attestation lets a third party verify what is running inside before trusting it with data.

Attestation is the part that makes this useful rather than merely comforting. The hardware signs a measurement of the code and configuration loaded into the enclave, and a remote party checks that signature against the expected value before releasing any secret to it.

Watch out

Attestation proves which code is running. It does not prove that code is correct. A faithfully attested enclave running a flawed program is exactly as flawed: measured, verified, and wrong.

This is what makes a TEE a good place to put an inspection proxy. Traffic can be decrypted, examined, and re-encrypted inside the enclave, so sensitive content is inspected without the operator being able to observe it. That pattern reappears in the agent threat model track, where the traffic being inspected is prompts and completions.

Tip

TEEs have a real research literature of side-channel attacks: timing, cache, speculative execution. They raise the bar substantially rather than being unconditionally impenetrable. Treat them as a strong layer, not a guarantee.

Check your understanding

3 questions
1

Which gap does a TEE close that encryption at rest and TLS do not?

2

What does remote attestation prove?

3

Why is a TEE a good location for a traffic inspection proxy?