The security questions that matter for VM-based sandboxing are narrow. Can a malicious job inside the VM break out? And even if it cannot, can it abuse the VM's permissions to reach other systems or otherwise cause harm?
Where the boundaries sit
Two boundaries carry most of the weight: the hypervisor and the VM's own permissions.
A hypervisor manages VMs and allows many of them to run at once on a single physical machine. It must separate the host from guest VMs and keep guests apart from one another. For many sandboxing use cases that boundary is more than sufficient and unlikely to be the weak point in a broader system. Hypervisors do, however, mediate a large number of OS and hardware operations, which leaves them with a broad and complex attack surface. Flaws can let a guest take over the host — a VM escape — or observe and interact with other guests.
In practice, that dependency is hard to avoid. Most large IaaS providers, AWS and Microsoft Azure among them, use VMs as a key primitive for tenant isolation. Unless your system is restricted to bare-metal instances, your security model leans on the hypervisor boundary to some degree regardless. Building specialized hypervisors, or needing a thorough grasp of that attack surface, is complex work, though general overviews of hypervisor design are widely available.
Controlling the blast radius
Preventing the escape is only half the problem. A compromised workload sitting inside a VM can still make network calls to exfiltrate data or invoke other services using the VM's credentials. We rarely get to modify the hypervisor itself, but the VM's capabilities are ours to configure: restrict network access, minimize what the VM is permitted to contact, and cap the lifetime of both its credentials and the VM itself.

Evaluating VMs as a sandbox
The factors from our sandboxing overview apply directly: environment, security and performance, development costs and friction, and maintenance and operational overhead.
Environment and workload fit
Because a VM can run a full-fledged operating system, most workloads need little or no modification to execute inside one. Some workloads effectively demand a full VM — converting a text document to a PDF, for instance, pulls in third-party software such as office productivity suites or web browsers.
Performance and cost
Creating and running a full VM costs more in performance than lighter primitives like containers or seccomp. Granular isolation is the reason: isolating every workload brings significant setup and teardown cost per workload, plus added latency while a VM comes up from a cold start. A warmed-up pool of available VM workers mitigates cold starts, but building and operating that orchestration adds overhead of its own, and the performance hit usually translates into higher monetary cost. It is worth asking whether every individual workload needs its own isolation, or whether some sandbox sharing across workloads — those belonging to the same user, say — is acceptable.
Development friction
Running a whole OS means many workloads need little to no modification compared with more restrictive techniques. Specialized VMs such as Firecracker, Amazon's security-focused VM technology, may need a custom runtime to support your workload.
Maintenance and operations
For engineers actively modifying workload code, VMs generally do not make debugging worse or add much development cost; established ways to reach common debugging techniques exist, and the tooling is quite usable. Managing, operating and orchestrating a VM cluster or service is another matter. Doing it well can require reliability engineering experience — deep visibility into core internals, tracking each VM's state, and tuning for unexpected sources of performance degradation. Depending on performance constraints, the orchestration layer may also handle routing decisions about which user requests map to which VMs. VMs often work out-of-the-box as a drop-in sandbox, but they tend to carry additional development and maintenance costs.
Firecracker on Lambda: Figma's VM-based workloads
Where virtualization-based sandboxing fits, Figma builds on AWS Lambda, which runs on Firecracker. AWS handles most of the VM management, but the arrangement still involves ongoing trade-offs. To keep Lambda viable for synchronous core serving paths, AWS reuses individual VMs from the same tenant across multiple requests: Firecracker's boot times are reasonably quick, but the overhead is still too high to pay repeatedly in many core workflows. The cost of that choice is that callers have minimal control over routing at this level—a reasonable security trade-off for many workloads.
Stateless work: image and link preview fetching
Figma uses Lambdas for stateless functionality such as fetching external images for the Figma canvas, and for fetching link metadata and converting or resizing associated images for link previews in FigJam. Low latency matters here: users adding content to the canvas expect to see it quickly. Much of the code involved comes from large open-source libraries, and maintaining a fork to fit them into a less generic sandboxing primitive would be expensive up front and a substantial ongoing maintenance burden.
The link metadata fetcher often has to resize images or convert them into a format the Figma frontend can render. It fetches data from the third-party link and runs an image processing library inside an AWS Lambda—and therefore a Firecracker VM. Because that execution environment runs with no special privileges in the AWS account outside the production VPC, exploiting a vulnerability in the link fetching logic or in ImageMagick gains no ability to reach Figma's internal services or anything outside the Lambda execution environment.
Less tuning, but specific gotchas
Compared with nsjail, virtualization use cases require relatively little sandbox tuning: with no syscall allowlist to manage, there is no concern about rarely evaluated code paths. Two pitfalls still need attention:
- The Lambda environment includes a
localhostHTTP listener that returns the contents of the request that triggered the Lambda to any caller, and lets any caller within the environment forge a response. Code inside the Lambda can always reach this API, so application code must be written not to make requests tolocalhost—otherwise an SSRF vulnerability would hand over that power. - Lambdas run in a cloud environment rather than as raw compute. It is easy to configure them with special privileges, whether by placing them inside your internal network or by granting IAM permissions to touch other cloud resources.
Performance and quota tuning
Performance and resource limits needed iteration as well. The first implementation of this Lambda could take up to 10 seconds per call—far slower than the feature wanted. Average latency dropped as the runtime warmed up, but direct engineering effort was still required to minimize startup and processing costs and to reduce contention on the Lambda concurrency limit, a shared quota across all Lambdas in an AWS account and region.
There is no single right approach to sandboxing; understanding the trade-offs and engineering considerations helps teams pick the best fit.



