# MicroVM vs container: where gVisor puts the boundary
MicroVM vs container for untrusted agent code: compare shared kernels, gVisor's application kernel and KVM guests, then choose the boundary your workload needs.
URL: /blog/microvm-vs-gvisor-vs-container
Published 2026-11-24 by Platinum team · microvm, security, agents

Run mutually untrusted agent tenants in separate sandboxes, using gVisor when its application-kernel boundary fits or microVMs when each tenant needs its own Linux kernel. For microVM vs container choices, review credentials, mounts and network access separately from compute isolation.

![Three syscall paths through a native container, gVisor Sentry and a microVM guest kernel](/blog/microvm-vs-gvisor-vs-container/boundaries.svg)

## Follow one system call

Consider a package install script opening a file. In a native container, the host kernel handles that syscall; gVisor implements it in the Sentry; a microVM handles it in the guest kernel. Virtual-device I/O is a separate interaction below that guest kernel.

[Docker Engine](https://docs.docker.com/engine/security/) uses namespaces to separate views of processes and networks, and cgroups to account for and limit resources. Capabilities and seccomp narrow what the process can do. Those controls still depend on the host kernel enforcing them correctly.

[gVisor](https://gvisor.dev/docs/) redirects application syscalls to its Sentry. The Sentry implements the Linux-like interface and uses a restricted set of host operations underneath. It does not forward the application's syscall arguments directly. This adds an independent implementation between untrusted code and the host, rather than just another filter.

[Firecracker](https://firecracker-microvm.github.io/) and [Cloud Hypervisor](https://www.cloudhypervisor.org/) are VM monitors, not container runtimes. A guest-kernel compromise must still cross the virtualization boundary to compromise the host.

## Compare the tradeoffs

| Design | Boundary around the workload | Cost to evaluate | Good fit |
|---|---|---|---|
| Native Linux container | Host-kernel namespaces, capabilities and syscall policy | Shared-kernel exposure; configuration and daemon access | Trusted builds with familiar container tooling |
| gVisor | Per-sandbox Sentry implements the application kernel | Unsupported Linux interfaces; syscall-heavy workloads can cost more | Untrusted code that fits its Linux compatibility surface |
| KVM microVM | Separate guest kernel behind virtual hardware | Guest memory, device model and VM lifecycle | Untrusted tenants needing their own Linux kernel |

The [gVisor security model](https://gvisor.dev/docs/architecture_guide/security/) warns that virtualization hardware alone does not guarantee a smaller attack surface. Device emulation, host support code, patching and configuration matter. gVisor and microVMs both reduce direct host exposure; neither removes every escape path or hardware side channel.

## Review network permissions

A VM does not stop an agent reading files you mounted into it or sending data to an API you authorized. Review [outbound networking](/docs/networking) separately. Platinum's networking docs warn that its per-sandbox egress policy is not a hard security boundary against source-IP spoofing. Do not treat an allowlist as equivalent to isolating hostile tenants.

## Choose for the workload

Do not use a shared host kernel as your sole boundary for mutually untrusted tenants. A microVM is not the only alternative: gVisor’s `runsc` works with OCI container tooling without a separate guest kernel. Test package installs, browsers and syscall-heavy tasks against its compatibility surface. Keep the Docker daemon out of untrusted workloads’ control.

Platinum and [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) offer managed KVM-based isolation: Platinum runs [one isolated microVM per sandbox](/docs/sandboxes) using [Cloud Hypervisor on KVM](/docs/compare/agent-sandboxes); Vercel uses [Firecracker, which uses KVM](https://firecracker-microvm.github.io/). Vercel documents a separate Firecracker microVM, filesystem and network per sandbox. These services avoid operating the VM fleet yourself.

Sources, checked November 2026: Docker Engine security, gVisor architecture and security model, Firecracker, Cloud Hypervisor, Vercel Sandbox, and the linked Platinum docs.
