Module 1 · Compute and execution · Lesson 2
Sandboxes for agent code
When an agent writes and runs code, that code is untrusted. The isolation spectrum from containers to gVisor to Firecracker microVMs, the sandbox products AI builders use, and how to set lifecycle, egress and credentials.
By the end of this lesson you can
- Threat-model model-written code in terms of host escape, data exfiltration and resource exhaustion
- Explain how containers, gVisor and Firecracker microVMs isolate code, and what each costs in startup time and attack surface
- Compare Vercel Sandbox, E2B, Daytona and Modal Sandboxes on isolation, lifecycle, persistence and egress control
- Run model-written Python in a sandbox with deny-by-default egress, resource limits and validated output
- Choose a sandbox lifecycle (per call, per session, per case) and cost it