E2B vs GitHub Codespaces
E2B is a sandbox API for agents: Firecracker microVMs that start fast, pause with their memory and fork while running. GitHub Codespaces is a dev environment for people: a dev container per GitHub repository, opened in VS Code or the browser, that stops after 12 hours at most.
The companies and products
E2B
E2B calls itself the AI agent cloud: an API that gives each agent session its own isolated Linux machine.
Every E2B sandbox is a Firecracker microVM that boots from a snapshot, so it starts fast and can be paused and resumed with its memory. You build custom sandboxes from templates based on a Docker image, and drive them from Python or JavaScript SDKs. It is built for teams that run many short code, data or agent jobs, and its runtime is open source.
- Isolation
- Firecracker microVM per sandbox
- Bring your own cloud
- Enterprise data plane in your AWS, GCP or Azure account
- Compliance
- SOC 2 Type II; HIPAA BAA on request
- Machine size
- 1 to 8 vCPU and 1 to 8 GiB RAM, CPU only
GitHub Codespaces
GitHub Codespaces is GitHub's cloud development environment: a ready-to-code Linux machine for a repository, opened in the browser, VS Code or the GitHub CLI.
Codespaces is a different kind of product from bochka: a dev environment for people working on a GitHub repository, not a sandbox API for agents. Each codespace is a Docker container built from the repo's dev container config, running on its own newly built VM on Azure, with 2 to 32 cores. It is built for developers and teams who want every contributor to start from the same setup, with prebuilds, port forwarding and GitHub billing.
Which use cases each one fits
For each use case, Battleships prices every sandbox provider on the same workload and sorts them from the cheapest monthly bill up. “16th cheapest of 367” means 15 of the other 366 providers run that workload, with every feature it needs, for less. “With limits” means the provider runs it but misses something, so it is listed after every full match. Open a use case for its whole ranking and what each provider misses.
| Use case and its workload | E2B: price rank | GitHub Codespaces: price rank | bochka: price rank |
|---|---|---|---|
| Software factory 100 at once · 4 vCPU / 8 GB · 2,200 sessions of 8 h a month E2B fits a coding agent through its API but stops at 24 hours on Pro, Codespaces stops at 12, and bochka has no cap plus /dev/kvm for emulators. | 16th cheapest of 367 $4,143 a month | 274th of 367, with limits $4,618 a month | 3rd cheapest of 367 $634 a month |
| Always-on AI employees 50 machines 24/7 · 2 vCPU / 4 GB An assistant that lives on its machine all month hits E2B's 24-hour cap and Codespaces' 12-hour cap, so both need restarts, while bochka keeps running. | 51st of 366, with limits $5,348 a month | 309th of 366, with limits $6,970 a month | 5th cheapest of 366 $657 a month |
| Code interpreter bursts 100 at once · 1 vCPU / 2 GB · 200,000 sessions of 1 min a month E2B is built for short code runs that start fast and pause with their memory; a codespace builds a dev container on a new VM, which is slow for one-minute jobs. | 37th cheapest of 345 $421 a month | 288th of 345, with limits $619 a month | 186th of 345, with limits $2,000 a month |
| Sandboxes for your users 300 at once · 2 vCPU / 4 GB · 30,000 sessions of 23 min a month E2B is made to hand sandboxes to your users through an API, while Codespaces is tied to GitHub users and repos and does not publish how many can run at once. | 23rd cheapest of 361 $2,354 a month | 281st of 361, with limits $1,964 a month | Cheapest of 361 $209 a month |
| RL rollouts 1,000 at once · 2 vCPU / 4 GB · 1,000,000 sessions of 3 min a month E2B ranks 2nd here: memory forks and a high start rate suit many short rollouts, and Codespaces has no fork at all. | 2nd cheapest of 360 $9,384 a month | 282nd of 360, with limits $9,489 a month | 34th of 360, with limits $2,000 a month |
| Agent evals 250 at once · 4 vCPU / 8 GB · 15,000 sessions of 20 min a month | 78th cheapest of 364 $1,975 a month | 295th of 364, with limits $1,519 a month | 10th cheapest of 364 $200 a month |
| CI runners 40 at once · 8 vCPU / 16 GB · 6,000 sessions of 12 min a month Neither is a strong CI runner: E2B has no nested virtualization and Codespaces has no fork or snapshot API, while bochka has both /dev/kvm and forks. | 337th of 377, with limits $1,429 a month | 314th of 377, with limits $909 a month | 4th cheapest of 377 $86 a month |
| 24/7 dev boxes 1 machine 24/7 · 4 vCPU / 8 GB Codespaces is a polished VS Code box per repo and E2B is an API sandbox, but both stop on a timer, while bochka runs all month on one machine. | 192nd of 368, with limits $358 a month | 130th of 368, with limits $270 a month | 18th cheapest of 368 $26 a month |
| Computer-use agents 50 at once · 4 vCPU / 8 GB · 20,000 sessions of 15 min a month E2B has a Linux desktop for computer use and Codespaces has none; bochka streams its desktop at 60fps and can be embedded in your app. | 32nd cheapest of 369 $1,342 a month | 267th of 369, with limits $1,367 a month | 6th cheapest of 369 $200 a month |
| Browser-use agents 50 at once · 2 vCPU / 4 GB · 30,000 sessions of 10 min a month | 100th of 367, with limits $746 a month | 275th of 367, with limits $678 a month | 7th cheapest of 367 $200 a month |
| Scraping & bots (startup scale) 50 at once · 1 vCPU / 2 GB · 100,000 sessions of 3 min a month | 57th cheapest of 346 $554 a month | 310th of 346, with limits $922 a month | 6th cheapest of 346 $90 a month |
| Mass scraping & bots (undetectable) 1,000 at once · 1 vCPU / 2 GB · 3,000,000 sessions of 2 min a month | 227th of 338, with limits $9,223 a month | 280th of 338, with limits $18,637 a month | 71st of 338, with limits $1,800 a month |
| Parallel red teaming 200 at once · 2 vCPU / 4 GB · 5,000 sessions of 30 min a month | 11th cheapest of 360 $1,043 a month | 267th of 360, with limits $445 a month | 2nd cheapest of 360 $200 a month |
| GPU eval jobs 10 at once · 8 vCPU / 32 GB · 500 sessions of 30 min a month | Can't run it | Can't run it | Can't run it |
| macOS agents 5 at once · 4 vCPU / 8 GB · 1,000 sessions of 20 min a month | Can't run it | Can't run it | Can't run it |
Key features
| Feature | E2B | GitHub Codespaces | bochka |
|---|---|---|---|
| What it is | A sandbox API for agents, driven from Python or JavaScript SDKs | A cloud dev environment for a GitHub repository, opened in VS Code, the browser or the CLI | A sandbox API for agents with full VMs, an SDK and built-in coding agents |
| Isolation | Firecracker microVM with its own kernel | A Docker container on its own newly built VM, with its own virtual network | Full VM with its own kernel on dedicated AMD Ryzen 9 9950X hosts |
| CPU benchmark (4 vCPU / 8 GB) | 12.61 runs/s | Not measured | 26.69 runs/s |
| Session length | Up to 1 hour on Hobby and 24 hours on Pro; pausing resets the clock | 12 hours at most even while in use, and 30 idle minutes by default | No cap on paid plans; runs until you stop it |
| Pause and resume | Saves memory and disk; resumes in about a second with processes running | Files are kept on stop; processes end; stopped codespaces are deleted after 30 days by default | Disk saved every minute and on stop; a stopped sandbox costs nothing; resume boots it again |
| Fork | Fork a running sandbox with its memory, up to 20 copies per call | No fork or snapshot endpoint; each codespace starts from a repo, branch or prebuild | Fork a running sandbox with its disk; named snapshots as templates |
| Docker and nested virtualization | Docker inside; nested virtualization not supported | Docker and sudo in the dev container; /dev/kvm not documented | Docker, root, systemd and /dev/kvm on every machine |
| Desktop and computer use | Linux desktop for computer use | VS Code, JupyterLab and a terminal; no graphical desktop | 60fps desktop with Chromium, computer use and an embeddable stream |
| Starting point | Templates built from a Docker image | Dev container config in the repo, with prebuilds built by GitHub Actions | Named snapshots shared by code; no Dockerfile builds |
| Coding agents | Templates and guides for many agents, run through the command API | GitHub Copilot as a VS Code extension; other agents you install yourself | Claude Code, Codex, OpenCode and more preinstalled, with a prompt, steer and events API |
| Keeping API keys out of the sandbox | Secrets injected into outbound HTTPS headers (private beta) | Secrets copied into the codespace as environment variables | Credentials proxy for model providers and any HTTPS API; switch a credential to another account when credits run out |
| Inbound access | HTTPS URL per port, public unless you turn on a token; no dedicated IP | A URL per forwarded port, private, organization or public; no public IP | HTTPS URLs for up to 50 ports, token-protected; raw TCP; dedicated IPv4 or IPv6 |
| Outbound rules | Allow and deny lists by IP, CIDR or domain | Open internet; GitHub says there is no way to restrict it | Open internet, no provider-side allowlist |
| Regions | US by default; EU and APAC on Pro and above | US East, US West, Europe West and Southeast Asia | EU only: Germany, Finland, France |
Every feature Battleships tracks (43)
| Feature | E2B | GitHub Codespaces | bochka |
|---|---|---|---|
| Full VM (own kernel) | Yes | Yes | Yes |
| Docker inside | Yes | Yes | Yes |
| Nested virtualization | No | No | Yes |
| Root | Yes | Yes | Yes |
| Systemd | Yes | Not published | Yes |
| Desktop GUI | Yes | No | Yes |
| Browser | Yes | No | Yes |
| Computer-use API | Yes | No | Yes |
| SSH | Yes | Yes | Yes |
| Persistent disk | Yes | Yes | Yes |
| Pause/resume | Yes | Yes | Yes |
| Automatic snapshots | Yes | No | Yes |
| Fork/clone | Yes | No | Yes |
| Live fork (no pause) | Yes | No | Yes |
| Memory fork | Yes | No | No |
| Custom image (Docker or snapshot) | Yes | Yes | Yes |
| ≥24 h sessions | Yes | No | Yes |
| Idle auto-stop | Yes | Yes | No |
| Wake on request | Yes | No | No |
| HTTPS preview URLs | Yes | Yes | Yes |
| Raw TCP inbound | No | No | Yes |
| Public IPv4 | No | No | No |
| Egress allowlist | Yes | No | No |
| Secret proxy | Yes | No | Yes |
| Secret proxy for any API | Yes | No | Yes |
| Preinstalled agents | Yes | No | Yes |
| Agent harness API | No | No | Yes |
| MCP server | Yes | No | No |
| GPU | No | No | No |
| Windows | No | No | No |
| Arm64 | No | No | No |
| Self-hosting | Yes | No | No |
| BYOC | Yes | No | No |
| Open source | Yes | No | No |
| Scoped API keys | Not published | Not published | Yes |
| Spend limits | Yes | Yes | Yes |
| Usage per sandbox (API) | No | No | Yes |
| Audit logs | Not published | Yes | No |
| SSO | No | Yes | No |
| SOC 2 | Yes | Yes | No |
| HIPAA | Yes | No | No |
| EU data residency | Yes | Yes | Yes |
| Zero data retention | Not published | Not published | Yes |
Performance
On StarSling's hpc-sandbox-benchmarks Node.js build-and-test loop at 4 vCPU / 8 GB, in the same run, bochka did 26.69 runs per second and E2B did 12.61, so bochka did about twice the CPU work. GitHub Codespaces was not in the benchmark runs, so there is no comparable score for it.
Node.js build-and-test loop at 4 vCPU / 8 GB, higher is better. Measured with the open hpc-sandbox-benchmarks suite. GitHub Codespaces has no published run in this suite yet, so there is no like-for-like number to compare.
Pricing in five scenarios
Each bill is priced from the providers' public price lists by the open Battleships engine, with the cheapest plan that runs the scenario.
| Scenario | E2B, a month | GitHub Codespaces, a month | bochka, a month |
|---|---|---|---|
| One coding agent, workdays 4 vCPU / 8 GB, 50 GB disk, 8 hours a day, 22 days a month, files kept between days | $202 · Pro | $51 · Personal account: GitHub Free | $20 · $20/mo |
| One agent that never stops 4 vCPU / 8 GB, 50 GB disk, running 24/7 all month | $368 · Pro · with limits | $270 · Personal account: GitHub Free · with limits | $26 · $20/mo |
| 50 agents in parallel 50 machines of 4 vCPU / 8 GB at once, 8-hour sessions, 1,100 sessions a month, Docker inside | $2,773 · Pro | $3,019 · Personal account: GitHub Free | $317 · $20/mo × 3 seats |
| Sandboxes for your users 2 vCPU / 4 GB, 30,000 sessions of 10 minutes a month, up to 300 at once | $1,395 · Pro+ (600 concurrent) | $850 · Personal account: GitHub Free · with limits | $200 · $100/mo × 2 seats |
| 1,000 short jobs at once 2 vCPU / 4 GB, 1,000 at once, 3 minutes each, 200,000 jobs a month | $2,797 · Pro++ (1,100 concurrent) | $1,889 · Personal account: GitHub Free · with limits | $2,000 · $2000/mo · with limits |
E2B: E2B bills per second for the vCPU and RAM you set, idle time included, until you pause or kill the sandbox. Pro costs $150 a month for higher limits with no usage credit, and more concurrency costs $500 a month per 500 slots.
GitHub Codespaces: Codespaces bills $0.09 per core-hour while a codespace is active, plus $0.07 per GB-month of storage while it exists. There is no 4-core machine with 8 GB, so 4 vCPU jobs are priced on the 4-core 16 GB machine; personal accounts get a free monthly quota and organizations do not.
GitHub Codespaces: Plans start at $20 a month, and the whole fee is usage credit spent per second on running sandboxes. A stopped sandbox costs nothing and keeps its disk.
Limits in those scenarios
Neither fits the always-on scenario: E2B Pro caps a session at 24 hours and Codespaces at 12, so both prices assume restarts. GitHub does not publish how many codespaces can run at once, so 300 user sandboxes and 1,000 short jobs are not confirmed there, while E2B fits both on Pro+ and Pro++. E2B Pro includes 20 GiB of disk, with no published price for more. bochka has no session cap, but at 1,000 short jobs at once its start limits per hour and per day do not fit.
| Scenario | E2B | GitHub Codespaces | bochka |
|---|---|---|---|
| One coding agent, workdays |
| None that bite | None that bite |
| One agent that never stops |
|
| None that bite |
| 50 agents in parallel |
|
| None that bite |
| Sandboxes for your users |
|
| None that bite |
| 1,000 short jobs at once |
|
|
|
Which one should you use?
Use E2B when
your code creates many short sandboxes for agents or users, needs memory pause and forks, or must run in the US or APAC.
- Built for agents you drive from code. Useful when your app creates sandboxes for agents or users: SDKs, templates and a high start rate, not an editor.
- Memory pause, wake on request and memory forks. Useful for short jobs that sleep between requests: a paused sandbox comes back in about a second with processes running.
- Outbound rules and an open-source runtime. E2B can limit which hosts a sandbox reaches, and its Apache-2.0 runtime can run in your own cloud on Enterprise.
Use GitHub Codespaces when
your developers want a ready VS Code environment for a GitHub repository, opened from a branch or pull request.
- Built into GitHub. Useful if your team lives on GitHub: open a codespace from any repo, branch or pull request with the dev container ready.
- A full editor for people. Useful when humans do the work: VS Code in the browser or on your machine, JupyterLab and port forwarding.
- Free hours for personal accounts. Useful for occasional personal work: a GitHub Free account includes 120 core-hours and 15 GB-month of storage each month.
Where bochka fits
If what you are really running is coding agents that work for hours, both E2B and Codespaces cut them off on a timer and neither gives them /dev/kvm. bochka gives each agent a full VM that runs until you stop it, with coding agents built in and keys kept outside.
No session cap
E2B stops a sandbox at 24 hours on Pro and Codespaces at 12, even while in use. Your code has to pause or restart them, and on Codespaces running processes end at each stop. bochka has no cap on paid plans.
A full VM with /dev/kvm and a desktop
E2B does not support nested virtualization and Codespaces does not document /dev/kvm, so Android emulators and microVMs will not start. Codespaces also has no desktop. bochka has /dev/kvm, systemd, Docker and a 60fps desktop.
Agents and keys handled for you
On Codespaces you start and watch each agent over SSH, and API keys sit in environment variables any code can read; E2B's secret injection is private beta. bochka preinstalls the agents and keeps keys in a credentials proxy.
Use bochka when your agents do real work for hours or days: full VMs with /dev/kvm, a desktop and open ports, built-in coding agents with keys kept outside, and machines that never cut them off. Compare it one to one: bochka vs E2B and bochka vs GitHub Codespaces.
Questions people ask
Is E2B cheaper than GitHub Codespaces?
Not usually in our scenarios. One coding agent on workdays is $202 a month on E2B against $51 on Codespaces, and 300 user sandboxes are $1,395 against $850, though Codespaces is not confirmed to run 300 at once. 50 agents in parallel are $2,773 on E2B against $3,019 on Codespaces. bochka is $20, $200 and $317 for those three.
Which is faster, E2B or GitHub Codespaces?
There is no comparable CPU score for Codespaces. E2B did 12.61 runs per second on the hpc-sandbox-benchmarks Node.js test at 4 vCPU / 8 GB, and bochka did 26.69 in the same run. For start time, E2B boots from a snapshot, while a codespace builds a dev container on a new VM.
Can I run an AI agent 24/7 on E2B or Codespaces?
Not in one session on either. E2B stops a sandbox after 24 hours on Pro, and a codespace stops after 12 hours even while in use, plus 30 idle minutes by default. bochka has no session cap on paid plans.
Can E2B and Codespaces run Docker?
Both run Docker inside: E2B sandboxes have root, and Codespaces has Docker and sudo in the dev container. Neither offers /dev/kvm for Android emulators or VMs. Every bochka machine has Docker, systemd and /dev/kvm.
Can I run Claude Code in E2B or GitHub Codespaces?
Yes. E2B has templates and guides for Claude Code run through its command API, and in Codespaces you install it yourself with your key as an environment variable. bochka preinstalls Claude Code, Codex and others and keeps real keys outside the sandbox.
Is bochka SOC 2 compliant?
SOC 2 is in progress. We're open about where we stand: live status at status.bochka.xyz and our data retention policy at docs.bochka.xyz/data-retention.
Try bochka
Install the CLI, then run bochka new.
Product preview