Skip to content
UseAgent

Engineering · Sandboxes · Infrastructure

E2B vs Daytona: running coding agents on both sandboxes

E2B vs Daytona from running Claude Code, Codex and OpenCode on both: measured cold starts, image limits, desktop at boot, idle rules, memory caps, cleanup.

Abhishek8 min read
On this page

We run Claude Code, Codex and OpenCode in cloud sandboxes, one sandbox per thread, and over the last two months we've had them on Daytona, on E2B, on a self-hosted E2B-compatible stack, and briefly on Box. The usual E2B vs Daytona question is which one is faster. The create call was one to two seconds on both, and nearly everything slow we measured was our own setup.

So this isn't a benchmark. It's what running coding agents on both taught us, with the numbers we actually recorded. Hosted UseAgent runs on E2B today through our Cube plugin, which speaks the E2B protocol. The open-source code defaults to Daytona because an API key is all it needs.

One contract, one plugin per vendor

Each vendor is a package that exports one plugin: credential env, home directory, whether it runs as root, how preview links authenticate, a createProvider factory and an optional credential check. Daytona and Cube authenticate previews with a token header; Box used a cookie you get by visiting a tokenized URL once. Consumers just send whatever headers the plugin returns, so no fetch site switches on a vendor name.

The rule we learned the hard way: every new provider gets a live smoke against a real account before review. The in-memory fake for Box passed everything and hid three real defects, a delete that 409s without a confirmation header, the cookie auth, and a process id we were capturing wrong.

Cold starts were mostly our fault

All of these came from the same recipe on different days, so read them as a trend, not a race:

Setup Create Ready Notes
Self-hosted Cube, old template (bun + docs only) 58 s Installing and booting runtimes at start
Self-hosted Cube, baked native image 1.6 s 12.3 s 8 s of that was our runtime booting
Daytona snapshot of the same image 1.0 s 18.8 s 8.5 s was ~10 API round trips at ~0.8 s each
Daytona, image with a boot entrypoint 1.2 s 5.0 s Readiness probe passing, shell already warm
E2B, image with a boot entrypoint 10.6 s Runtime ready, zero uploads
E2B, old template under a new backend 31-47 s Uploading what the image should have had

The fix that mattered was one recipe for everything an engine needs (Bun, our runtime, the Codex, Claude Code and OpenCode drivers, document tooling) rendered two ways: a Dockerfile for providers that build images, and a live-sandbox replay for providers that snapshot a running box. Then an image entrypoint that starts the runtime, pairs it with the control plane and warms a shell before anyone asks. The name of the image is a hash of every rendered step, which turned out to matter on E2B (below).

The Daytona row with 8.5 seconds of "bridge" is the clearest lesson. About ten API round trips at 0.8 seconds each is a design problem on our side, not a slow vendor. Moving that work into the boot entrypoint, so the sandbox pairs and warms itself before we ask, is how it went from 18.8 to 5.0.

Under load the picture changes. In our 50-run test on E2B a cold sandbox spent 1.7 seconds on create, then 31 seconds on provider bootstrap and 12 on the first shell, about 45 seconds before the model was asked anything. That's in load testing 50 coding agents.

Images: each vendor has its own limits

Daytona refuses image references pinned by @sha256 digest. It caps sandbox disk at 10 GB. Deletes are asynchronous, so a re-create with the same snapshot name has to poll until the old one is really gone. And it rejects images deeper than 125 layers with failed to register layer: max depth exceeded. Our base image was itself the output of earlier bakes, 110 layers with the recipe stacked three or four times, and the recipe added 26. We flattened it with docker export | docker import and moved on, but the right fix was fewer layers.

E2B has its own set. The template ready command we wanted, a curl against our runtime, never satisfied E2B's build wait even though the runtime came up in about 25 seconds, so the template uses true and the control plane waits on a boot marker instead. Rebuilding a template from the same registry tag reused the cached image, so a "new" template quietly ran old code until we started pushing a unique tag per bake. A cold template create once took longer than 30 seconds and failed with deadline_exceeded; a retry was fine. The first pool creates after a new template also timed out once or twice while the rootfs was cold. Small one: E2B presented our Bun binary with 777 permissions, so the boot script now sets 755.

On the self-hosted E2B-compatible stack, the in-sandbox daemon picked its own default user when the SDK didn't name one. A new template ran as uid 1000 while the old one ran as root, with the same OCI config. We now pass the user explicitly on every command, file and PTY call.

Desktops should start at boot

Computer use needs a real desktop: Xorg, a session, VNC, Chrome, a relay. We started it when the user opened the Browser tab, which meant the warm pool did nothing for it. Measured inside a cold sandbox: Xorg at 3.4 s, the desktop session at 9.3 s, the VNC server at 12 s, Chrome and the relay at 13.5 s, noVNC at 14 s. Users saw a 15 to 20 second spinner.

Starting the desktop from the image's boot entrypoint, after the runtime is warm, fixed it. On a live E2B sandbox the boot marker cleared at 13.4 seconds with noVNC, the session and the relay all answering, before anyone had opened the tab.

Daytona is ahead here on features. It has a native computer-use API and native recording. On the E2B path we drive the desktop through our own gateway and record with X11 and FFmpeg. Both work; Daytona's is less code for us. More in a desktop sandbox for computer-use agents.

Idle rules differ more than the APIs do

These rules matter most for runs that sit and wait.

Daytona's idle auto-stop counts SDK calls only. Traffic through the preview proxy, which is how our runtime streams events, does not count. So a run parked on a question for a person, with nothing but preview traffic, looks idle to Daytona. The Daytona handle now calls refreshActivity() on a keep-alive.

E2B pauses idle sandboxes. Our own fleet accounting was the bug there: it counted a thread's retained sandbox against the host budget for its full 72-hour retention, even though E2B had paused it after an hour. A new thread waited 33 seconds for admission behind sandboxes that weren't using anything.

Box's TTL is absolute from create, up to 30 days, with no idle stop and no extend call. We had set auto-delete to 72 hours, so 79 boxes each lived 72 hours and used up the plan's included time in four days. That was our configuration as much as their model, but it's why we moved our own account off Box.

Shared caps fail other people's runs

Our Daytona organization has a hard cap: Total memory limit exceeded. Maximum allowed: 500GiB. It's a total across every concurrent sandbox in the org, not per caller. We found that out on 2026-08-07 when a 50-run evaluation pushed the pool from 34 sandboxes to 76. About 24 of the 50 runs never got a sandbox and died in roughly four seconds, and runs from other sessions sharing the org died with them.

The rule since: list what's already running before a fan-out and size to the headroom. Those first 34 sandboxes were other people's work, there before we launched.

On E2B the cap we plan against is the plan's concurrent sandbox limit, 100 for us. What bit us there was the create burst: during a burst of 48 creates, four timed out with deadline_exceeded while "Provisioning cloud sandbox", and we didn't retry a failed create. That's ours to fix.

Cleanup is part of the integration

A harness that cleans up only at the end orphans every sandbox when you kill it halfway. Our soak harness deletes in three steps (get, delete, confirm gone) and attributes sandboxes by the id we persisted and our own run label, never by name pattern, so it can't delete someone else's box.

The control plane records leases, but the live inventory is only what the provider reports, so we always ask the provider. Daytona's list call ranged from seconds to about two minutes for us, which is why our usage card read machine stats from a 30-second stale-while-revalidate cache instead of on the request path.

E2B vs Daytona: which one we'd pick

Once the image is baked and the runtime starts at boot, startup isn't what separates them. Daytona gives you computer use and recording natively and needs nothing but a key, which is why it's the open-source default. E2B is what hosted UseAgent runs on today, and its protocol is also what a self-hosted CubeSandbox speaks, so the same plugin covers both a managed fleet and your own metal. Whichever you choose, budget your time for idle rules and caps, not for the create call.

The plugin contract and all three providers are in the open-source repo under packages/sandbox-*; on hosted UseAgent you can connect your own provider account in Settings.

Frequently asked questions

Is E2B or Daytona faster to start a coding agent sandbox?

The create call took 1 to 2 seconds on both in our measurements. With a baked image that starts the agent runtime at boot, we saw Daytona pass its readiness probe at 5.0 seconds and an E2B sandbox reach a ready runtime in 10.6 seconds, measured on different days with different image revisions, so treat them as close.

What does 'Total memory limit exceeded. Maximum allowed: 500GiB' mean on Daytona?

It is a cap on the total memory of every concurrent sandbox in the Daytona organization, not per session. When it is hit, sandbox creation fails for everyone sharing the org until load drops or the tier is raised.

Does Daytona support computer use?

Yes. Daytona has a native computer-use API and native screen recording. On the E2B-compatible path we drive the desktop through our own gateway and record with X11 and FFmpeg.

Can I run UseAgent threads on my own sandbox account?

Yes. Connect your own Daytona, Cube or Box account in Settings and your threads run there, billed by the provider at its own rates.

All posts →

Hand your next task
to a coding agent.

UseAgent runs Claude Code, Codex and OpenCode in cloud sandboxes. The core is open source, so you can read the code or host it yourself.