English
Get started

Agent Sandboxes A microVM per sandbox

A Firecracker microVM for every sandbox

A Pethost sandbox is a Linux VM, not a container: a Firecracker microVM with its own kernel, root inside and a network of its own. It starts in about 0.15 s, because it is restored from a snapshot rather than booted.

What a sandbox is

Every sandbox runs in a Firecracker microVM of its own (Firecracker 1.18, in its jailer), and its guest runs its own Linux kernel, 6.18. It starts from our template, base: Ubuntu 24.04 with build tools, git, Python 3, Node.js 22, Docker, Claude Code, Codex and OpenCode, and a desktop with Chrome. You are root inside: a command runs as user, who has passwordless sudo, or as root when you ask.

An agent can install packages, start services, change the system’s files or run containers inside its VM, and what it changes stays in that sandbox: on its own disk, under its own kernel.

How a Firecracker microVM keeps a sandbox apart

Each VM runs in Firecracker’s jailer: a chroot of its own, an unprivileged user for each network slot, a cgroup, a seccomp filter, and a network namespace of its own with rules against forged addresses. The guest reaches the network only through its server’s proxy and resolver: TCP and DNS leave, UDP and ping do not, and the egress allow-list says where TCP may go.

A VM has one size for its whole life, its size’s vCPUs and memory, held by the server and never by the guest’s word: its cgroup’s quota is its vCPUs’ worth of time, written before its first thread runs.

The servers keep VMs apart below the guest too. Nested virtualization is off, so no guest runs a hypervisor of its own. On processors that leak between a core’s two threads, SMT is off. io_uring is off on the server, and what a VM holds is never swapped to a disk. API tokens stay in the panel and secrets never enter a VM: a server sees connection tokens, each for one sandbox on that server, expiring and revocable.

Why it starts in 0.15 s

A sandbox is never booted. Each server keeps a snapshot of our base at each size, and every new sandbox is a restore of it: its disk attached, its vCPUs let run, and its guest told who it is. The server mixes 64 random bytes into the kernel’s pool and Firecracker’s VMGenID reseeds it, so each sandbox has randomness of its own, its own machine-id and its id as its hostname.

The root filesystem is our base, read-only and mapped straight from the server’s page cache (DAX): software installed in the base and never run costs a sandbox no memory, and the desktop and Docker start only when something asks for them.

Measured through a test panel 16 ms from the server, a create took 123 ms at the median for SMALL and 158 ms for XLARGE, and the first command answered 29 to 48 ms after it.

from pethost.sandboxes import Sandboxes, SandboxSettings, Size

sandboxes = Sandboxes()  # reads PETHOST_TOKEN
sandbox = sandboxes.create_sandbox("base", settings=SandboxSettings(size=Size.SMALL))

# Its own kernel, its id as its hostname, its size's vCPUs, and root through sudo.
command = sandboxes.run_command(sandbox.sandbox_id, command="uname -r; hostname; nproc; sudo whoami")
print(command.stdout)
id=$(pethost sandbox new --size small)
pethost sandbox run "$id" -- 'uname -r; hostname; nproc; sudo whoami'

Sizes and prices

Four sizes, each with 2 GiB of memory and 5 GiB of disk per vCPU, billed by the second while running:

SizevCPUsMemoryDiskRunning, an hour
SMALL24 GiB10 GiB$0.018
DEFAULT48 GiB20 GiB$0.036
LARGE816 GiB40 GiB$0.072
XLARGE1632 GiB80 GiB$0.144

The disk is what the sandbox may write; the base’s own files do not count. The $20 plan makes sandboxes up to LARGE, the larger plans up to XLARGE, and the trial up to DEFAULT.

Limits

There are no GPUs. No VM runs inside a sandbox, since nested virtualization is off; containers do, with Docker. A sandbox keeps the base it was made from for as long as it lives, its Chrome included: we build a new base monthly, and at once for a security fix of Chrome, the kernel or a package, and sandboxes made after that start from it. Every limit is in the docs.

How it compares

On 21 November 2026, E2B and Vercel Sandbox said they run Firecracker too, and boat.dev a VM per sandbox. Daytona runs containers by default, with a Linux VM class, and Modal runs its sandboxes in gVisor, with a VM runtime as an option. A VM per sandbox is common ground; where vendors differ is what a sandbox keeps when it pauses and what an hour costs, which the comparison sets side by side.

Read the docs

Questions

Is each sandbox a Firecracker microVM or a container?

A Firecracker microVM, one per sandbox, with its own Linux kernel. Containers run inside it, with Docker.

Can I run Docker inside a sandbox?

Yes. Docker’s daemon starts at the first connection to its socket, so it costs nothing until then. Its images and containers are on the sandbox’s disk: a stop keeps them, and a template carries them. Pulls from Docker Hub try mirror.gcr.io first.

Can I run a VM inside a sandbox?

No: nested virtualization is off on every server.

Am I root?

Yes. A command runs as user, who has passwordless sudo, or as root when the call asks for it.

What is in the base template?

Ubuntu 24.04 with build-essential, git, curl, ripgrep and jq, Python 3 with pip and venv, Node.js 22, Docker with Compose and Buildx, Claude Code, Codex and OpenCode with their SDKs, and a desktop: Google Chrome on a 1280×800 screen, which starts at its first use.

Related

Give your agent a computer in 0.15 s

Start the free trial