Latest in AI
Containers vs MicroVMs for AI Agents: How to Choose a Sandbox
The isolation boundary matters, but the credentials and network access you give an agent can undo a good infrastructure decision.
For an AI agent that executes unfamiliar code, a microVM gives each sandbox its own kernel, while a conventional Linux container shares its host's kernel. That is an important difference in containment, but neither choice decides which files, credentials or external services the agent should be allowed to use.
The practical question is what damage a failed or manipulated agent can cause before anyone notices. Choosing infrastructure by its startup-time headline leaves most of that question unanswered.
What changes between containers, gVisor and microVMs?
Docker's security documentation describes namespaces for isolation, control groups for resource accounting and limits, and capabilities for restricting privileges. Those controls matter, but a container configuration can weaken them through excessive permissions or host mounts. Control of the Docker daemon is particularly sensitive because it can grant access to the host filesystem.
gVisor takes a different approach: an application kernel in userspace handles the application's system interface rather than letting the application directly exercise the host's interface. Its runsc runtime fits existing container tooling. Compatibility and system-call overhead need checking against the actual workload.
A microVM puts a guest kernel behind a virtualization boundary. Firecracker is one implementation, using KVM and a small device model. A microVM is an architectural category, not another name for Firecracker, and using one does not remove the need to secure its management interfaces.
| Approach | Main isolation mechanism | What to check before choosing it |
|---|---|---|
| Conventional Linux container | Host-kernel namespaces and restrictions | Privileges, mounts, daemon access and shared-host risk |
| gVisor sandbox | Userspace application kernel | System-call compatibility and workload overhead |
| MicroVM | Separate guest kernel and virtualization boundary | Guest lifecycle, storage, networking and operational cost |
Treat this as a way to structure evaluation, not a universal security ranking. Configuration, patching and the surrounding control plane still determine what the workload can reach.
What Replit's sandbox rewrite actually demonstrates
In its November 4 engineering account, Replit describes replacing its older shared-kernel runtime with microVMs built on Cloud Hypervisor and KVM. Containers still separate processes inside each sandbox. The rollout had already been running in production for months, so this is an architectural explanation rather than a feature that suddenly became available this week.
Two details are more useful than the microVM label. Replit describes enforcing outbound network policy outside the guest and using a credential broker for managed connectors, so the workload does not need to hold the underlying key. These are the company's descriptions, not an independent security assessment.
The design lesson is that isolation and authorization need separate owners. A sandbox can contain execution while a service outside it decides whether a particular request is permitted. That separation makes the policy harder for compromised workload code to change.
Start with the agent's permissions, not the VM benchmark
Consider a coding agent asked to fix a failing test in a repository. It needs source files, a compiler or interpreter, dependencies and somewhere to write a patch. It does not automatically need production database credentials, permission to publish a package or a writable checkout of every repository in the organization.
Write down those distinctions before choosing a provider. Otherwise, a team can buy a stronger execution boundary and then deliberately pass enough authority through it to recreate the original risk.
For this example, I would begin with a disposable workspace containing only the target repository and synthetic test data. Dependency downloads would use an approved source or controlled mirror. The output would be a patch for review, with deployment handled separately. This is a proposed setup, not a configuration I have benchmarked or tested against a particular service.
The same agent might eventually earn broader access. That should follow a concrete requirement, such as running a staging integration test, rather than the convenience of copying a developer's complete environment into every session.
Ask five questions before connecting real systems
The first question is what happens when the agent is wrong. If it can delete a production table through an authorized API, a stronger VM boundary will not stop that request. Start with narrowly scoped, short-lived access and keep consequential operations behind a separate approval or policy check.
Next, ask where outbound restrictions are enforced. A policy file that the workload can edit is a different control from a network rule enforced outside its execution environment. Check whether redirects, package downloads and background processes are covered, rather than testing only the agent's main HTTP tool.
Third, inspect what persists. A clean-looking new session might still inherit a disk, cache or snapshot. Decide which state is intentionally reused, which account owns it and how it is removed. Never put customer secrets into a shared template just because it speeds up startup.
Fourth, separate resource limits from destination restrictions. A bandwidth cap can limit consumption without deciding which server may receive data. Similarly, a CPU quota does not establish whether one customer's files are visible to another workload.
Finally, ask what the audit trail proves. You need enough evidence to connect a tool request, the credential scope used, the resulting external action and the workspace that initiated it. A transcript of what the model said it intended to do is not a substitute for an action record.
How to compare sandbox performance fairly
Use a representative job rather than an empty environment. For the coding example, measure time until the repository is readable, dependencies are ready, tests can run and the result is collected. Record cold and warm starts separately, then repeat under the concurrency you actually expect.
Also measure teardown, failed starts and retries. A fast successful run tells you little about the operational cost of sessions that hang or leave resources behind. Keep the workload, resource allocation, network policy and persistence settings consistent across candidates so a shortcut is not mistaken for a faster architecture.
This is an evaluation plan, not a published performance comparison. There is no honest winner without measurements from the workload and configuration you intend to operate.
Which sandbox should you choose?
For trusted internal jobs with narrow permissions, a carefully configured container environment may be sufficient. For arbitrary code from different users, I would require a stronger isolation design and evidence that its network, identity and persistence controls are enforced independently of the workload. gVisor and microVM-based systems are both worth evaluating against those requirements.
The blunt version is that a sandbox vendor should be able to explain a bad day. What survives a compromised guest? Which credentials remain out of reach? Who can stop the session, and what evidence remains afterward?
Buy the boundary you can explain and verify, then give the agent the smallest useful amount of authority across it. That is a more durable decision than buying whichever demo starts fastest.
I’m Paras. I work at the intersection of AI, engineering and distribution.
I help technical teams explain infrastructure decisions and product tradeoffs in writing that developers can understand and use.