Server-side sandboxing: Virtual machines
VM-based sandboxing rests on two boundaries: the hypervisor, which is usually strong but exposes a large attack surface, and the VM's own permissions, which must be restricted through network limits, minimal service access and short-lived credentials so a compromised job can't do harm without escaping. VMs run unmodified workloads, including third-party software, but cost more in cold starts, orchestration complexity and money than containers or seccomp. Figma runs image fetching and link-preview processing (including ImageMagick) in AWS Lambda on Firecracker, outside its production VPC and with no special privileges. The gotchas they hit were the Lambda localhost runtime API, which an SSRF could abuse, accidental IAM or VPC privileges, initial 10-second latencies, and the account-wide Lambda concurrency quota.
Related posts
- Server-side sandboxing: An introduction
Figma easyNovice
Server-side workloads like image processing, parsing and thumbnailing often depend on memory-unsafe C++ libraries with histories of exploitable bugs (e.g. ImageTragick), so Figma isolates them with sandboxing rather than relying solely on preventing vulnerabilities. Three primitives are compared at a high level: VMs (Firecracker via AWS Lambda), containers (nsjail using namespaces, cgroups and seccomp), and direct seccomp syscall allowlists built with libseccomp for pure-computation workloads. Seccomp offers strong security and minimal overhead but high upfront development cost, while containers are easier to ship but have more security pitfalls. A questionnaire covering environment, isolation granularity, latency, cost, development effort and operational ownership helps teams choose an approach.
- Why MicroVMs: The Architecture Behind Docker Sandboxes
Docker easyNoviceDocker Sandboxes run each AI coding agent session in a dedicated microVM with its own kernel and a private Docker daemon, giving VM-grade isolation while still allowing docker build, run and compose without socket mounting or host privileges. Full VMs are too slow for ephemeral sessions, containers force privileged Docker-in-Docker, and WASM/V8 isolates offer weaker isolation and no real OS environment. Because Firecracker is Linux/KVM-only, Docker built a new cross-platform VMM on Hypervisor.framework, Windows Hypervisor Platform and KVM to get fast cold starts on developer laptops. File, network and secret policies are set by infrastructure before the agent runs, with credentials injected from outside the VM boundary.
- What is an AI code sandbox?
Modal easyNovice
AI code sandboxes are ephemeral, isolated environments for executing LLM-generated code so hallucinated packages, crashes or prompt-injected exploits can't affect the host or other tenants. They run on VMs or containers, ideally with a hardened runtime like gVisor that intercepts syscalls through a user-space kernel instead of sharing the host kernel as runc does. Around that sit filesystem sync APIs, controlled networking, orchestration and state snapshotting. Use cases include background coding agents, code review, chatbot code interpreters, RL reward scoring and AI app builders. Buyers should weigh sub-second cold starts, isolation strength, egress control, high-concurrency scaling, dynamic runtime images and snapshotting.
- Server-side sandboxing: Containers and seccomp
Figma mediumAdept
Containers and seccomp offer lighter-weight sandboxing than VMs, but both shift much more configuration responsibility onto the user. Container escape risk depends on the runtime implementation, kernel primitives and configuration, and a sandboxed container still needs network, credential and data isolation to limit damage if compromised. Seccomp-only sandboxes suit pure-compute programs: Figma allows only writing to already-open file descriptors, exiting, memory allocation and fetching the time. Building allowlists with strace, restructuring programs so risky syscalls happen before untrusted input is processed, and maintaining brittle allowlists are the main costs, in exchange for very low overhead.
- How Figma manages sandboxes at scale
Figma mediumAdept
Nimbus is Figma's internal platform for running tens of thousands of sandboxes for AI-generated code across multiple cloud providers. Teams declare a namespace config (image, resources, health checks, warm pool bounds, allowed hosts), and a control plane picks providers, enforces egress policy and manages lifecycle through GetOrCreate, Get and Delete APIs. Security comes from read-only egress to untrusted hosts, enforced by provider controls or a proxy sidecar, plus encrypted credentials that are swapped for real ones only at the intended destination. Demand-sized warm pools with Postgres skip-locked claiming, health-weighted provider routing and Redis-scheduled health checks cut provisioning latency by 90% and raised availability from 99% to 99.95%. A control-loop simulator exposed a feedback bug where slow-but-successful providers kept receiving work.