Best sandboxes for running coding agents (Claude Code, Codex, Gemini CLI) in 2026, ranked
Updated October 24, 2026 .md
Short answer: For coding agents we rank Sandboxer first: a full Ubuntu VM with Claude Code and Codex preinstalled, Docker, and stop-and-resume that keeps the agent's session in memory. Freestyle and Amp Orbs also keep memory across pauses. Pick E2B for prebuilt agent templates on open source, Docker Sandboxes for free local runs, and Codespaces if you live in GitHub.
Published by Sandboxer, and we're on this list. We ranked by the criteria below and say where others are the better choice. Every fact about another platform comes from its own docs or pricing page, checked on the date shown; follow each name for the full comparison and sources.
What a coding agent needs from a sandbox#
Claude Code, Codex, Gemini CLI and similar agents work like a developer: they clone a repository, install dependencies, run builds and tests, start dev servers and sometimes Docker. Running them unattended, especially with permission prompts off, is only safe on a machine that holds nothing else. See Run Claude Code without permission prompts, safely.
How to compare them#
- A whole machine. Root, systemd and Docker, so the agent can install anything and run services.
- Isolation. Its own VM and kernel, not a container sharing a host.
- The session survives a pause. Whether a paused machine comes back with the agent's process and the dev server still running.
- Long runs. No short platform cap on a session.
- Driving the agent. Agents preinstalled, or an API to prompt and follow them, so you're not just renting a shell.
- Cost while idle. What you pay while the agent waits for you.
- Self-serve. You can sign up and start today without a sales process.
Comparison table#
| # | Platform | Isolation | Resume keeps running processes | Docker / full Linux | Nested KVM | 4 vCPU / 8 GB, per hour | Checked |
|---|---|---|---|---|---|---|---|
| 1 | Sandboxer | microVM (Cloud Hypervisor, its own kernel) | Yes | Yes | Yes | $0.036 | 2026-10-24 |
| 2 | Freestyle | full Linux VM (hypervisor not named) | Yes | Yes | Not documented | $0.26 | 2026-10-24 |
| 3 | E2B | microVM | Yes | Partly | No | $0.33 | 2026-10-15 |
| 4 | Docker Sandboxes | microVM (hypervisor) | Not documented | Yes | Not documented | — | 2026-10-24 |
| 5 | exe.dev | VM (own VMM process per VM) | Not documented | Yes | Not documented | $0.21 | 2026-10-24 |
| 6 | Amp Orbs | Not documented | Yes | Partly | Not documented | $0.33 | 2026-10-24 |
| 7 | Daytona | container or VM | Partly | Partly | Partly | $0.33 | 2026-10-15 |
| 8 | Fly.io Sprites | microVM (hardware-isolated) | Partly | Yes | Not documented | $0.33 | 2026-10-24 |
| 9 | Claude Managed Agents (Anthropic) | Linux container on Anthropic-managed infrastructure | Not documented | Partly | Not documented | — | 2026-10-24 |
| 10 | GitHub Codespaces | container on a VM | Not documented | Not documented | Not documented | — | 2026-10-24 |
| 11 | Ona | VM per environment | Not documented | Partly | Not documented | — | 2026-10-24 |
"Not documented" means the platform's public docs don't say. Prices are list prices for one 4 vCPU, 8 GB machine-hour; a dash means the platform doesn't sell that size by the hour or doesn't publish a price for it.
The sandboxes, ranked#
1. Sandboxer#
At a glance (source: our docs and pricing): isolation: microVM (Cloud Hypervisor, its own kernel) · resume keeps processes: Yes · longest session: No limit on paid plans · price: $0.036/hour.
Best for: running Claude Code, Codex or other agents unattended for hours, several at once. Every sandbox is a Cloud Hypervisor microVM with Ubuntu 24.04, root, systemd and Docker. Claude Code, Codex, OpenCode, Pi, Kimi Code and Mistral Vibe are preinstalled and can be prompted, followed and steered over the CLI or API (sbx prompt, sbx events, sbx steer). Stopping saves memory, so the agent's session, tmux and the dev server are still running after resume; a stopped sandbox costs nothing. Gemini CLI isn't preinstalled; install it in the VM with npm install -g @google/gemini-cli.
Where others win: no GPUs, no self-hosting, and the integrated agents need your own API keys (subscription sign-in for them is coming).
2. Freestyle#
At a glance (source: Freestyle docs, checked 2026-10-24): isolation: full Linux VM (hypervisor not named) · resume keeps processes: Yes · longest session: no maximum stated · price: $0.26/hour · full comparison and sources.
Best for: live forking of a running agent's VM. Freestyle provides full Linux VMs with pause and resume that preserves memory, live forking, SSH and HTTPS domains per port, and its base snapshots include Claude Code, Codex and OpenCode.
Where it's weaker for this use: the hypervisor isn't named in its docs.
3. E2B#
At a glance (source: E2B docs, checked 2026-10-15): isolation: microVM · resume keeps processes: Yes · longest session: see comparison · price: $0.33/hour · full comparison and sources.
Best for: an open-source sandbox with prebuilt agent templates. E2B offers Claude Code and Codex templates that you run as commands, Firecracker microVMs whose pause keeps memory and processes, and Terraform to run it in your own cloud.
Where it's weaker for this use: sessions are capped per plan, and Docker comes from a template rather than being preinstalled.
4. Docker Sandboxes#
At a glance (source: Docker Sandboxes docs, checked 2026-10-24): isolation: microVM (hypervisor) · resume keeps processes: Not documented · longest session: cloud: 1 hour by default · price: No 4 vCPU / 8 GB list price · full comparison and sources.
Best for: running agents on your own laptop for free. Docker's sbx CLI runs coding agents in microVM sandboxes with a private Docker daemon each, working in your local project directory, with a host-side proxy that keeps credentials out of the VM. A cloud option runs on Docker-managed infrastructure.
Where it's weaker for this use: cloud sandboxes expire after one hour by default.
5. exe.dev#
At a glance (source: exe.dev docs, checked 2026-10-24): isolation: VM (own VMM process per VM) · resume keeps processes: Not documented · longest session: Not documented · price: $0.21/hour · full comparison and sources.
Best for: many persistent VMs on one flat monthly pool, or regions outside the US. exe.dev VMs are reachable over SSH as root and have HTTPS URLs by default, with nine regions.
Where it's weaker for this use: whether a paused VM keeps its memory isn't documented.
6. Amp Orbs#
At a glance (source: Amp Orbs docs, checked 2026-10-24): isolation: Not documented · resume keeps processes: Yes · longest session: no run limit stated; pauses when idle · price: $0.33/hour · full comparison and sources.
Best for: teams already using the Amp coding agent. Orbs are remote Debian machines where Amp works on a thread; pausing saves memory and disk, so terminals and dev servers are still running when it wakes, and Portals give shareable URLs for dev servers with review comments sent back to the agent.
Where it's weaker for this use: it's built around Amp rather than any agent you choose, and the isolation type isn't documented.
7. Daytona#
At a glance (source: Daytona docs, checked 2026-10-15): isolation: container or VM · resume keeps processes: Partly · longest session: see comparison · price: $0.33/hour · full comparison and sources.
Best for: teams that need Windows or GPU environments alongside Linux, or SDKs in Ruby, Go or Java. Daytona's VM sandboxes can pause with memory preserved.
Where it's weaker for this use: memory-saving stop and VM isolation depend on which sandbox class you pick.
8. Fly.io Sprites#
At a glance (source: Fly.io Sprites docs, checked 2026-10-24): isolation: microVM (hardware-isolated) · resume keeps processes: Partly · longest session: no maximum stated · price: $0.33/hour · full comparison and sources.
Best for: agents that work in bursts. Sprites are persistent microVMs with checkpoints, an always-on HTTPS URL, and no compute charge while idle.
Where it's weaker for this use: after a longer idle period the in-memory state is dropped, so a running agent process doesn't always survive.
9. Claude Managed Agents#
At a glance (source: Claude Managed Agents (Anthropic) docs, checked 2026-10-24): isolation: Linux container on Anthropic-managed infrastructure · resume keeps processes: Not documented · longest session: Not documented · price: No 4 vCPU / 8 GB list price · full comparison and sources.
Best for: letting Anthropic run the Claude agent loop for you. The runtime (in beta) runs Claude in per-session Linux containers with many languages, Chromium and Playwright preinstalled, built-in tools and event streaming.
Where it's weaker for this use: it's Claude only, runs in containers rather than VMs, and you don't get a machine you keep.
10. GitHub Codespaces#
At a glance (source: GitHub Codespaces docs, checked 2026-10-24): isolation: container on a VM · resume keeps processes: Not documented · longest session: 12 h maximum lifetime; idle timeout 30 min default, up to 240 min · price: No 4 vCPU / 8 GB list price · full comparison and sources.
Best for: work that lives in GitHub and uses devcontainer.json, with free monthly hours on personal accounts.
Where it's weaker for this use: a codespace has a 12-hour maximum lifetime and runs as a container on a VM.
11. Ona#
At a glance (source: Ona docs, checked 2026-10-24): isolation: VM per environment · resume keeps processes: Not documented · longest session: Not documented · price: No 4 vCPU / 8 GB list price · full comparison and sources.
Best for: enterprises that need environments inside their own AWS or GCP VPC, defined as Dev Containers with org-wide guardrails.
Where it's weaker for this use: its docs say new customer sign-up is closed, and its site describes Ona as part of OpenAI.
What it costs to run an agent#
Two costs add up: the machine and the model. The machine is the table's hourly price while the agent works; the model (Anthropic, OpenAI, Google) bills your own key for tokens. What differs most between platforms is the cost while the agent waits:
- Free while stopped or idle: a stopped Sandboxer sandbox costs nothing; Fly.io Sprites charge no compute while idle.
- Billed while running: most platforms bill per second or minute while the machine is up, so stop or pause what you aren't using.
On Sandboxer, three agents on the default size (4 vCPU, 8 GB, $0.036/hour) for two hours cost about 22 cents of machine time.
How we tested#
- Other platforms: we read each platform's own docs and pricing pages and recorded what they state, with a date; a second reviewer checked each claim against its source. We didn't run other platforms.
- Sandboxer, measured by us on 2026-10-24 (10 runs, wall-clock from a client with a 27 ms round trip (conditions and results), CLI round trips included): new sandbox ready in 3.19–3.20 s; resume with memory in 1.34–1.37 s; a running process kept the same PID across stop and resume in 10 of 10 runs. We also checked that Claude Code (2.1.301), Codex (codex-cli 0.163.0) and OpenCode were installed, and that
claude --dangerously-skip-permissionsstarts as the non-root user. Script: create-resume.sh.
Which should you choose?#
- Unattended Claude Code or Codex in the cloud, several in parallel, keeping sessions across pauses: Sandboxer.
- Your team uses Amp: Amp Orbs.
- Open source, or your own cloud: E2B.
- Free, on your laptop: Docker Sandboxes.
- Windows or GPUs: Daytona.
- Anthropic should run the loop: Claude Managed Agents.
- Your code and reviews live in GitHub: Codespaces.
Step-by-step: Run Claude Code in a cloud VM, Run Codex CLI on a remote machine and Run coding agents in parallel.
FAQ#
Does Claude Code work in a sandbox?#
Yes. Claude Code runs on Linux, and for permission prompts off Anthropic's docs recommend isolated containers or VMs without internet access. A VM with nothing valuable on it, where Claude Code runs as a non-root user, fits that guidance.
Can I run Codex and Claude Code side by side?#
Yes. On Sandboxer both are preinstalled in every sandbox; give each its own sandbox, or run separate conversations in one with sbx prompt --provider codex and --provider claude.
How do I run Gemini CLI in a cloud VM?#
Install it in any Linux VM with npm install -g @google/gemini-cli and sign in. It isn't one of Sandboxer's preinstalled agents, but every sandbox has Node.js and root, so the install works as on any machine.
Which sandbox keeps the agent running when my laptop is closed?#
Any cloud sandbox does while it's running. The difference is what happens on pause: Sandboxer, Amp Orbs, Freestyle and E2B document resuming with memory, so the agent's process continues instead of restarting.
What's the cheapest way to run a coding agent in the cloud?#
Stop or pause the machine whenever the agent isn't working. Per-second billing plus a free stopped state (Sandboxer) or no compute charge while idle (Fly.io Sprites) keeps the machine cost small next to model tokens.
Is it safe to give a coding agent my API keys in a sandbox?#
Give it only the keys the task needs, preferably dedicated ones with spend limits, and nothing else from your machine. On Sandboxer, start with --no-env and pass keys with -e.
Related#
More guides
For running AI-written code we rank Sandboxer, Freestyle and E2B first: each gives code its own VM with an API or SDK and can pause with memory. Pick Daytona for Windows or GPUs, Modal or Northflank for GPUs at scale, E2B or Northflank to run in your own cloud, and Vercel Sandbox if your app lives on Vercel.
The best Daytona alternatives depend on why you're switching. For a full Linux microVM on every sandbox with memory-saving stop and Docker, we rank Sandboxer first. E2B suits open source and self-hosting, Modal massive short-job fleets, Northflank bring-your-own-cloud with GPUs, and Vercel Sandbox apps on Vercel.
If you're leaving E2B for longer sessions or a fuller machine, we rank Sandboxer first, then Freestyle: both give each sandbox a full Linux VM that keeps memory across pauses, with Docker and no short session cap. Pick Daytona for Windows or GPUs, Northflank for bring-your-own-cloud, and stay on E2B if you need open source.
For sandbox use rather than GPU work, we rank Sandboxer first, then Freestyle and E2B: each gives a sandbox its own VM kernel instead of Modal's default gVisor, and keeps memory across pauses. Pick Northflank for GPUs in your own cloud, Vercel Sandbox for apps on Vercel, and stay on Modal for GPUs or very large numbers of short jobs.