🤖 AI Hot

Modal VM Sandboxes: A Real Linux VM for AI Agents

A
Alex Chen

Modal has spent 2026 turning itself from a serverless GPU platform into something closer to a full AI infrastructure layer, and the latest piece of that push is a runtime change that sounds small but matters a lot for anyone running agent-generated code. The company’s VM Sandboxes run each sandbox on a real Linux kernel inside a virtual machine, instead of the gVisor user-space kernel that its default Sandboxes use. That one switch changes what an agent can do inside a sandbox, what isolation you actually get, and what you can mount into a disposable workspace. It is also, at the time of writing, still labeled Beta — a detail worth keeping in view before you build anything on it.

The reason this deserves attention is not that Modal invented the idea. Firecracker microVMs have been the default for AWS Lambda for years, and Vercel’s Sandbox runs on the same technology. What is notable is that Modal is exposing the VM-versus-gVisor choice as an explicit dial on the same platform, so a team can pick the isolation boundary that matches the workload instead of being locked into one model.

gVisor Versus a Real Kernel: What Changes

Modal’s default Sandboxes isolate code with gVisor, Google’s user-space kernel that intercepts system calls and reimplements them in a userspace process. gVisor gives you a strong sandbox with fast startup and low memory overhead, which is why it is a good default for running untrusted snippets at scale. But gVisor does not behave like a complete Linux kernel. It deliberately does not expose everything, and workloads that need certain kernel features hit a wall.

VM Sandboxes remove that wall. Each sandbox gets a full virtual machine with a real Linux kernel, so system calls go straight to the kernel instead of being filtered through a userspace reimplementation. The practical difference that Modal’s own documentation and third-party integrations call out is filesystem access: the VM runtime exposes /dev/fuse, which is what allows a userspace filesystem driver like AIStor Memory’s aimem mount to work at all. That is why the MinIO AIStor integration specifically requires experimental_options={"vm_runtime": True} — the default gVisor Sandboxes do not support a user-supplied FUSE mount, but a VM Sandbox does.

The tradeoff is that a VM is heavier than gVisor. Full VMs take longer to start and use more memory, so they are not the right default for firing off thousands of tiny, short-lived snippets. The value is for the minority of workloads that need a genuine kernel boundary or real filesystem mounts — agent workspaces that persist state to an external store, code that needs device access, or anything where gVisor’s syscall filtering breaks a library.

AI Agent Framework Comparison: Where VM Sandboxes Fit

If you are choosing an execution layer for an agent, the decision is less “which is best” and more “which isolation model matches the workload.” The field has converged on a few architectures, and it is worth laying them out side by side.

Modal sits on one end of the spectrum by offering both gVisor and VM isolation on a single serverless platform, with on-demand GPU access across H100, H200, A100, B200, B300, L40S, RTX PRO 6000, L4, A10, and T4. That GPU availability is the differentiator: most sandbox products are CPU-only, but an agent that needs to run a model or vector workload inside its sandbox wants the accelerator in the same place.

Vercel Sandbox runs each environment in a Firecracker microVM with its own filesystem, network, and process space. It is ephemeral by design, bills on Active CPU time and provisioned memory, and gives each sandbox sudo access plus package managers. Snapshots let you save state, but they expire after 30 days by default. It is a clean, developer-friendly option, though it is CPU-focused and tied to the Vercel ecosystem.

Cloudflare Sandboxes are built on Cloudflare Containers and Workers, using V8 isolates for lightweight tasks and containers for full Linux environments, all through a TypeScript-first API at the edge. The isolation is strong and the edge latency is the selling point, but the programming model is Cloudflare-specific.

AWS Lambda’s Firecracker microVMs and Azure Container Apps’ Dynamic Sessions (Hyper-V isolation) round out the picture as the big-cloud options, with Google Cloud Run offering sandboxed execution as a preview feature. None of these are wrong; they optimize for different things. The useful heuristic is simple: if your agent needs GPU compute and a real kernel, Modal VM Sandboxes are the notable newcomer; if it needs edge distribution, Cloudflare; if it lives in one cloud, that cloud’s native option.

Scale and the Numbers That Actually Matter

The numbers Modal publishes are the kind you should treat as directional rather than gospel, but they indicate where the platform is aimed. Modal reports it serves more than 10,000 teams and can scale to 50,000 or more concurrent sandboxes, with 1,000-plus GPUs provisioned in minutes. Lovable and Quora are cited as running millions of untrusted code snippets daily. Ramp uses Modal Sandboxes for a full-context background coding agent that generates code changes and writes them back into commits. Suno is a customer. Physical Intelligence reports 10 to 15 millisecond inter-container communication latency on Modal, and sync. reached 95 deployments a day on the platform. Decagon reports a 65 percent improvement in agent performance running on Modal infrastructure.

Those are the numbers that matter for agent workloads: cold-start speed, concurrency ceiling, and inter-service latency. A sandbox that takes 30 seconds to spin up is useless inside an agent loop that spawns a sub-task per step. The reason Modal’s snapshotting feature keeps showing up is that it lets a sandbox restore prepared state instead of rebuilding it, which is how you get sub-second resume in a development loop.

The snapshot feature pairs with the VM runtime in a specific way: snapshots give you the fast-start property that a raw VM would otherwise lose, while the VM gives you the kernel boundary that gVisor withholds. That combination is what makes VM Sandboxes something other than a heavier, slower gVisor.

The Security Tradeoff, and Where Modal Clusters Fit

There is a security dimension to the gVisor-versus-VM choice that does not get enough airtime. gVisor is not a trivial wrapper; it reimplements a large chunk of the Linux syscall surface in userspace, which shrinks the kernel attack surface that untrusted code can reach. A VM takes a different route: it relies on hardware virtualization to give each sandbox its own kernel, which is a stronger boundary in the sense that a kernel-level escape in one VM does not automatically compromise the host or a neighbor. Firecracker’s whole design philosophy — used by AWS Lambda and now by Modal and Vercel — is to make that microVM small and auditable enough that the hardware boundary is cheap to use per sandbox. The honest summary is that neither mode is strictly more secure; they defend against different failure modes, and having both behind one API is the point.

Modal Clusters is the other half of the runtime update. Where VM Sandboxes address code execution, Modal Clusters targets the training-and-inference side: reserved GPU capacity for workloads that need steady, high-end accelerators rather than the burst-and-scale-to-zero model of serverless functions. The strategic picture is a platform that now covers the full loop for agent and model teams — ephemeral sandboxes for running untrusted code, persistent volumes and snapshots for state, and dedicated GPU clusters for the heavy compute — under one API and one billing model. That is a credible pitch, and it is the reason VM Sandboxes should be read as part of a broader push, not as an isolated feature drop.

Who Should Use This

The clearest fit is a team running agentic code that needs filesystem mounts or kernel features gVisor blocks. If you are building an agent that writes to a FUSE-mounted persistent store, or a code interpreter that needs device access, VM Sandboxes are the reason to look at Modal rather than a CPU-only sandbox product. The GPU adjacency matters too: an agent that generates code and then runs a model to evaluate it wants both in one environment.

The second fit is anyone who has outgrown a single isolation model. Most teams start with the cheapest, fastest sandbox and only later discover that some workload needs a stronger boundary. Having gVisor and VM modes behind one API means you do not have to migrate platforms when that happens; you flip a runtime flag.

Who Should NOT Use This

Do not build production systems on VM Sandboxes while they are in Beta. The runtime is explicitly experimental — it is enabled through an experimental_options flag — and Beta semantics can change under you. If you need a stable, supported sandbox today, Modal’s gVisor Sandboxes are the mature path on the same platform.

You should also skip VMs if your workload is high-volume, short-lived snippets. A thousand three-second code executions do not need a full kernel each; they need gVisor’s fast startup and low overhead. Paying the VM cost for that workload is strictly worse, and it is the most common mistake people make when they read “real Linux VM” and assume it is the better default everywhere.

Finally, if your team is not already in the Python-and-containers world, the Modal programming model — you write Python that declares containers and runtimes — will feel unfamiliar, and the Cloudflare or Vercel alternatives may fit your existing stack more naturally. The right tool depends on where your code already runs.

Limitations and Caveats

The Beta status is the headline caveat and should be repeated, because it is easy to miss in a product announcement. experimental_options={"vm_runtime": True} is not a production API surface, and integrations built on it — the MinIO AIStor one is explicitly “validated, experimental” — are making a bet that the flag does not change. That is a reasonable bet for prototyping and a poor one for a system you cannot afford to break.

There is also a genuine performance tradeoff that the marketing glosses over. VMs start slower and consume more memory than gVisor, and the snapshotting that mitigates this adds its own complexity. The 10 to 15 millisecond inter-container latency figure is impressive, but it describes a specific configuration, not a guarantee across workloads.

The broader competitive picture is worth stating too: Modal is not the only platform pairing microVM isolation with GPU access, and the sandbox market is moving fast. Vercel, Cloudflare, AWS, and Azure are all actively iterating on their agent-execution offerings. What makes Modal’s VM Sandboxes worth watching is not that they are unique, but that they make the isolation-versus-performance tradeoff explicit and let you dial it per workload. For teams whose agents have outgrown a userspace sandbox, that is a useful new degree of freedom — as long as you remember it is still in Beta.

Disclosure: CarCare Guide is reader-supported. When you buy through links on our site, we may earn an affiliate commission at no extra cost to you. Learn more.
A
Alex Chen