E2B alternatives serve different agent workloads. Vercel Sandbox and Fly.io Sprites support persistent coding workspaces; Daytona, Modal, and Northflank offer GPU options. Upstash Box includes coding-agent integrations, while Railway Sandboxes connects execution to services in a Railway environment.
Choose according to the state your agent must preserve, the permissions its code receives, and where it needs to run. E2B already preserves files and memory on pause by default, so a replacement should solve a specific requirement without losing behavior your application uses.
Copy link to headingWhat do AI agents need from a sandbox?
Running generated code once is the simplest job an agent sandbox does. Production workloads also need state, capacity, and access controls: coding agents return to a repository for days, evals run many trials in parallel, and app builders expose previews at a URL. An agent that calls authenticated APIs needs limits on where it can send data and which credentials it can use.
E2B sandboxes run in Firecracker microVMs with dedicated kernels and JavaScript and Python SDKs. Pausing saves files and memory by default, and a paused sandbox remains until killed unless you set a retention period. Its network controls can disable internet access or apply outbound allow and deny lists.
E2B Hobby supports one-hour sessions and 10 concurrent sandboxes for new projects; Pro supports 24-hour sessions and 100 concurrent sandboxes. These plan limits give you a baseline for capacity, while E2B's CPU-only execution means GPU workloads need another provider.
Copy link to headingHow do the E2B alternatives compare?
The main persistence question is whether a paused workspace keeps only files or also keeps running processes. Deployment requirements can narrow the choice further if the sandbox must run in your own cloud.
E2B, Vercel Sandbox, Daytona's Linux sandboxes, and Fly.io Sprites use Firecracker. Their persistence and credential controls still differ.
Copy link to headingVercel Sandbox
Our managed execution service, Vercel Sandbox, runs each sandbox in a Firecracker microVM with its own kernel, filesystem, and network namespace. It supports JavaScript, Python, and a Sandbox CLI across 19 regions.
Persistent sandboxes save their files when stopped and resume on the next SDK operation that needs to run. This supports coding workspaces and CPU-based evals. Active CPU billing counts execution time rather than waits on model calls, while provisioned memory remains billable throughout the session.
Copy link to headingWhat to consider with Vercel Sandbox
Stopping a sandbox ends its processes, so applications must restart them after resuming. Sessions last up to 45 minutes on Hobby or 24 hours on the Vercel Pro and Enterprise plans, with a fresh timeout on resume. Saved snapshots expire 30 days after their last use by default.
Each vCPU includes 2 GB of memory, and the service provides CPU execution without GPUs. Sandbox runs on Vercel-managed infrastructure; Vercel BYOC covers Functions. Compare the plan allowances and regional rates alongside the credential controls and parallel capacity your application needs.
Copy link to headingDaytona
Daytona v2 runs Linux sandboxes in Firecracker microVMs, with Python, TypeScript, and Go clients. GPU sandboxes use Cloud Hypervisor, and macOS sandboxes run as virtual machines on Apple silicon. It suits teams that need Linux memory persistence alongside GPU workloads or macOS automation.
Persistent Linux sandboxes keep files across stop and start, and memory across pause and resume. Forks copy files and, by default, memory into independent Linux sandboxes. Enterprise bring your own compute runs on your infrastructure.
Daytona Secrets supplies credentials through an outbound proxy, with a required host allowlist for each secret. General egress is open by default; network policies can block traffic or allow domains and IP ranges. Preview ports are private unless you explicitly make them public.
Copy link to headingWhat to consider with Daytona
V2 sandboxes are ephemeral by default, so set persistent: true at creation to preserve a Linux workspace across stops and pauses. Sandboxes with attached volumes can't pause. Projects can override the five-minute default lifetime within their organization's limit; idle timeout is configured separately.
Plan limits allow sessions up to 24 hours on Starter and 48 hours on Team, with custom limits on Enterprise. Concurrent sandbox caps are 100 on Starter and 5,000 on Team, and both have per-sandbox ceilings of 64 cores and 128 GiB of memory. Review Daytona's current terms for the plan you intend to use.
Copy link to headingModal
Modal runs Sandboxes on gVisor or a VM runtime with its own Linux kernel. Python teams already using Modal can keep sandbox execution and GPU jobs in one account, with JavaScript and Go SDKs also available in beta. GPU Sandboxes require gVisor; compare its isolation boundary with microVMs.
The default lifetime is five minutes, and the timeout parameter extends it to 24 hours. Network settings can block all outbound access or restrict it to IP ranges and domains, with domain allowlisting in beta. Small resource reservations can burst, so set resource limits for the workload you intend to run.
Copy link to headingWhat to consider with Modal
Modal restores snapshots into new Sandboxes, with filesystem snapshots expiring after 30 days by default. Beta exit snapshots capture files automatically when a Sandbox exits. Memory snapshots are in alpha, expire after seven days, and can't be used with GPUs; the Modal comparison covers both persistence models.
Secret injection is in beta and can't be combined with memory snapshots, network allowlists, or block_network. Evaluate these compatibility limits alongside Modal's current plan terms.
Copy link to headingNorthflank
Northflank runs sandboxes beside services, databases, and jobs, with JavaScript and Python SDKs. On Northflank Cloud, CPU sandboxes use Cloud Hypervisor microVMs with their own guest kernels, while GPU sandboxes use gVisor. This fits teams that want sandbox execution close to their other services.
Through BYOC, Northflank provisions and manages clusters in your AWS, Google Cloud, Azure, or Oracle account. For an existing Kubernetes cluster, including bare metal, BYOK manages workloads while you operate the cluster.
Sandboxes have no fixed session limit and run until deleted. Network policies restrict outbound traffic by domain and IP range, and secrets can be added at egress without entering the sandbox. Review Northflank's deployment terms.
Copy link to headingWhat to consider with Northflank
In your own cloud, installing sandbox runtimes does not isolate a workload by itself. Select the Kata microVM or gVisor runtime through a cluster default or workload tag before running untrusted code.
Pausing ends processes and discards ephemeral files, so data that must survive belongs on an attached volume. Changing a sandbox's resource plan also restarts it and clears ephemeral storage.
Copy link to headingFly.io Sprites
Fly.io Sprites provide persistent Linux workspaces for coding agents returning to a repository. Each Sprite is a Firecracker microVM with eight vCPUs, a 100 GB volume, and platform-managed memory. SDKs support JavaScript, Go, Python, and Elixir.
Files survive pauses, and the filesystem checkpoints itself during work, when idle, and on graceful shutdown. Each Sprite has an HTTPS URL that can wake it on a request; these URLs are private until you make them public. Connectors call APIs without their credentials entering the Sprite, while outbound access remains open until you apply a network policy.
Copy link to headingWhat to consider with Fly.io Sprites
Sprites pause after about 30 idle seconds. Only warm pauses preserve running processes; after a cold pause, configured Services start again and your application must restart other processes. You can't choose the pause type, and open TCP connections drop in both cases.
Background work can hold a Sprite active with a renewable task lasting up to one hour. The vCPU count and storage ceiling are fixed, and Sprites has no publicly documented BYOC option. The Sprites comparison covers these lifecycle differences alongside Vercel Sandbox's stop-and-resume behavior.
Copy link to headingUpstash Box
Upstash Box runs each box as a Docker container with its own filesystem, shell, and network stack. TypeScript and Python SDKs support Claude Code, Codex, OpenCode, and Cursor integrations using your own model provider key. Teams can use the built-in agent tooling alongside a managed Chromium browser.
Standard boxes pause after an idle period and wake on new work or a public-URL request. The default is one idle hour on the free plan and six on paid plans. Attach Headers injects secrets from a host proxy; network policies support allow-all, deny-all, or custom allowlists, with private IP ranges blocked.
Copy link to headingWhat to consider with Upstash Box
Upstash provides container isolation without specifying a dedicated guest kernel for each box. Files and environment settings survive pause, but running processes stop. Its comparison with Vercel Sandbox explains the isolation and persistence differences; a Box migration must also account for the built-in agent integrations.
Boxes run in AWS us-east-1 and come in three fixed sizes, from two cores and 4 GB of memory to eight cores and 16 GB. You can't supply a custom Docker image. The pay-as-you-go quota defaults to 1,000 concurrent boxes.
Copy link to headingRailway Sandboxes
Railway Sandboxes are isolated Linux VMs scoped to a Railway environment. For apps already on Railway, PRIVATE mode joins the environment's network and reaches its services by hostname. The standard image includes coding-agent CLIs such as Claude Code, Codex, and OpenCode.
Forks, templates, and named checkpoints copy a prepared disk into new sandboxes. Checkpoints remain until deleted, with up to 10,000 per environment on Pro. Pro also allows 100 concurrent sandboxes per environment and sizes up to 24 vCPUs and 24 GB of memory; sandbox deployment spans four regions.
Copy link to headingWhat to consider with Railway Sandboxes
Railway destroys a sandbox when its idle timeout expires, which defaults to 30 minutes on Hobby and Pro unless disabled. Save required files in a checkpoint before that happens. The Railway Sandbox comparison explains how this differs from Vercel's persistent workspaces.
The Sandbox API exposes secrets as environment variables that commands can read, without a documented egress allowlist or external credential-brokering control. Railway does not specify the hypervisor or sandbox disk size. Its TypeScript SDK is in beta; review Railway's plan requirements alongside the API's limits.
Copy link to headingHow do you choose the right E2B alternative?
Start with requirements that would prevent a migration, then test the remaining options with the same agent task. Differences in saved state or credential access can require application changes even when both products execute the same code.
Copy link to headingDecide what must survive between tasks
Files, memory, and running processes have different lifetimes. Coding agents may only need their repositories and installed dependencies; an interpreter with live variables may need memory preservation. Verify the behavior after an idle pause, a timeout, and an explicit stop, and check which processes need restarting.
Copy link to headingCheck access and deployment requirements
Separate the sandbox's isolation boundary from its network permissions. Having a dedicated kernel does not stop an agent from using credentials it can read or sending data to an allowed destination. Check how each product brokers credentials, controls outbound requests, and protects preview URLs before giving generated code access to private services.
If execution must stay in your cloud account, shortlist providers offering BYOC or self-hosted deployment. GPU and desktop requirements can narrow the choice further. Compare microVMs and containers against your isolation requirements.
Copy link to headingTest capacity with a representative workload
Check both the maximum number of running sandboxes and the rate at which your team can create them. The concurrency allowance does not guarantee that a large batch starts at once. For agent evals, run the same trials from a prepared environment and measure completion, state recovery, and failed runs.
For browser or desktop tasks, test the controls your agent will use. Check code interpreter support for notebook-style results and persistent language variables.
Copy link to headingWhen should you stay on E2B?
Stay on E2B when your agent depends on memory surviving a pause, deployment in your own cloud, or E2B's desktop sandboxes. Its default pause preserves files and running processes, and a fork copies a running sandbox and its memory into up to 20 sandboxes at once.
Enterprise BYOC runs on AWS, Google Cloud, or Azure with the same SDK, CLI, and API. For computer use, E2B provides an Ubuntu desktop with mouse, keyboard, and screenshot APIs. E2B Secrets injects stored values into matching outbound HTTPS requests outside the sandbox.
Auto-pause on timeout is opt-in because lifecycle.onTimeout defaults to "kill". Where E2B's pause-refusal handling has rolled out, a node finishing the sandbox's previous snapshot can refuse a memory auto-pause. E2B keeps the sandbox running and retries for up to about two minutes after its timeout; if the refusal continues, it saves only the filesystem. Test this behavior before relying on memory preservation, because the next resume reboots without the saved memory.
Copy link to headingWhen should you choose Vercel Sandbox over E2B?
Vercel Sandbox fits when your agent needs files that persist by default, request-level control over credentials, or thousands of sandboxes in parallel, and it doesn't need memory to survive a stop. Compare Vercel Sandbox and E2B for the detailed lifecycle and access-control differences.
Copy link to headingIsolation tested in public
Each sandbox has a dedicated guest kernel inside its Firecracker microVM. In August 2026, Vercel ran a $1M public challenge to escape it. Researchers filed 1,285 reports in two weeks, 57 were valid, and Vercel paid $242,000 in bounties. The most severe finding was a Linux kernel zero day, and no report showed anyone reading a customer's files, secrets, or application data. Trail of Bits also reviewed the architecture and concluded that the virtualization boundary is sound.
Copy link to headingEgress control and credentials brokering
MicroVM isolation alone doesn't stop code from sending data out or using a key it can read, which is why a sandbox needs a network boundary too. The Sandbox firewall has three modes: allow-all by default, deny-all, and user-defined. You can change the policy on a running session. On Vercel, denied address ranges take precedence over allowed domains and address ranges. In E2B's egress rules, an address on both lists is allowed.
Credentials brokering adds secrets to matching outbound HTTP requests outside the sandbox, so generated code can use an API without reading its key. This does not apply to Postgres connections; keep database credentials in a trusted service that checks the operations the agent may perform.
Notion Workers uses this pattern with credentials injected at the firewall for each Worker's microVM. v0's Snowflake proxy keeps the user's reusable OAuth token outside generated code and injects it into the appropriate authentication fields.
For access to private resources, Enterprise teams can purchase Secure Compute and attach sandboxes to its network. Public traffic uses its static egress IPs, and VPC peering connects sandboxes to resources in your VPC.
Copy link to headingPersistence, forks, and Drives
Persistent sandboxes save the filesystem on stop, and each resume starts a new session with a fresh timeout. Sandbox.fork() creates a new sandbox from another sandbox's last saved snapshot. Snapshots expire 30 days after their last use by default and cost $0.08 per GB-month. Session length and saved state are separate controls, as the guide to duration and persistence explains.
Vercel's November snapshot measurements showed median creation time falling from 4.4 seconds to under 0.4 seconds and p50 restore time from 500 ms to 250 ms. The new format applies to newly created snapshots; existing snapshots keep the previous format. Earlier parallelization and caching work had reduced p75 restore time from over 40 seconds to under one second.
Vercel Drives add storage that outlives any one sandbox, and they've been generally available on all plans since October 2026. You can mount up to four drives in a sandbox, and each persists until you delete it. For the agents this suits, see agents that need a persistent workspace.
Copy link to headingActive CPU billing and concurrency
Active CPU counts the time code uses the CPU, so an agent's waits on model responses add nothing to it. Provisioned memory bills for the whole session.
Pro and Enterprise allow 10,000 concurrent sandboxes, and Hobby allows 10. The vCPU allocation rate for an idle Pro team starts at 150 vCPUs per minute and rises by 500 each minute to 5,000. In one month, Zapier created 3.3 million sandboxes to isolate the code execution behind its AI workloads.
Copy link to headingTools for coding and desktop agents
The default image includes Claude Code, Codex, and OpenCode for coding tasks. You can run several agents in one sandbox, each as its own Linux user with a private home directory. For computer-use tasks, Sandbox CLI 4.12.0 or newer can stream a desktop to a browser with screen-relay, an open-source Vercel Labs tool, and let an agent control it.
On the Vercel Pro and Enterprise plans, lifecycle webhooks notify your backend when a session starts, nears its timeout, or stops. Python applications can manage these workloads with the Python SDK, which reached 1.0 in November 2026.
Tailscale built Aperture on Vercel Sandbox after switching from a working implementation on another provider. Okara's SEO agent runs site analysis in a sandbox before a coding agent opens a pull request.
Copy link to headingWhat won't a move from E2B to Vercel Sandbox carry over?
Memory state doesn't carry over. Stopping a Vercel sandbox saves its files, so your application must restart its processes after each resume, for example in an onResume hook. If your agent needs a process to continue mid-task after a pause, keep that workload on E2B or use a persistent Daytona v2 Linux sandbox.
Read the limitations in the E2B migration guide first if your application relies on E2B's Code Interpreter or Desktop SDKs, or on private sandbox URLs. On Vercel Sandbox, anyone with the URL can reach a server on an exposed port. GPU jobs need another provider, such as Daytona, Modal, or Northflank. For deployment in your own cloud, consider E2B Enterprise, Daytona Enterprise, or Northflank.
Before you migrate, run a long task that stops and resumes, and confirm it keeps the state it needs. Measure CPU activity to estimate Active CPU, and test whether generated code can read credentials under your production egress policy.
Copy link to headingBuild with Vercel Sandbox
You can call Vercel Sandbox from an application on Vercel or another host. For these TypeScript scripts, use Node.js 22.19.0 or later and the Vercel CLI. Configure "type": "module" in your project's package.json, then install the SDK:
pnpm add @vercel/sandboxThe SDK authenticates with a Vercel OIDC token. For local development, link a Vercel project and pull a development token:
vercel linkvercel env pullThe second command saves a 12-hour VERCEL_OIDC_TOKEN in .env.local. Load that file with Node's --env-file option and pull a new token after it expires. Production deployments on Vercel authenticate automatically; use the authentication reference to configure credentials for another host.
Copy link to headingRun generated code in a one-shot sandbox
For a code execution tool, create a sandbox, write the model's code to a file, run it, and return the output. In run-code.ts, setting persistent: false discards the filesystem when the session stops without storing a snapshot:
import { Sandbox } from '@vercel/sandbox';
const sandbox = await Sandbox.create({ timeout: 60_000, persistent: false,});
try { await sandbox.writeFiles([ { path: 'hello.js', content: Buffer.from("console.log('Hello from Vercel Sandbox!')\n"), }, ]);
const result = await sandbox.runCommand('node', ['hello.js']);
if (result.exitCode !== 0) { throw new Error(await result.stderr()); }
console.log(await result.stdout());} finally { await sandbox.stop();}Run the command from the project directory; for Yarn Plug'n'Play, use yarn node. It prints Hello from Vercel Sandbox!:
node --env-file=.env.local run-code.tsThe sample writes a fixed script; an agent application would pass the model's code as the file content and return the output as its tool result. Set networkPolicy: 'deny-all' when generated code shouldn't access the internet; outbound traffic is otherwise allowed.
For a working agent integration, use the packaged code execution tool with the AI SDK or build a durable code agent that retries when its tests fail.
Copy link to headingKeep a persistent workspace for a coding agent
In workspace.ts, the SDK retrieves a sandbox by name or creates it. Use a public repository with an npm dev script; onCreate clones it and installs dependencies once, while onResume restarts the dev server after a resumed session begins:
import { Sandbox } from '@vercel/sandbox';
const repoUrl = 'https://github.com/your-org/your-repo.git';
async function runChecked(sbx: Sandbox, cmd: string, args: string[]) { const result = await sbx.runCommand(cmd, args); if (result.exitCode !== 0) { throw new Error((await result.stderr()) || `${cmd} failed`); }}
async function startServer(sbx: Sandbox) { await sbx.runCommand({ cmd: 'npm', args: ['run', 'dev'], detached: true });}
const sandbox = await Sandbox.getOrCreate({ name: 'my-sandbox', onCreate: async (sbx) => { try { await runChecked(sbx, 'git', ['clone', repoUrl, '.']); await runChecked(sbx, 'npm', ['install']); await startServer(sbx); } catch (error) { try { await sbx.delete(); } catch (cleanupError) { throw new AggregateError( [error, cleanupError], 'Workspace setup and cleanup failed.', { cause: error }, ); } throw error; } }, onResume: startServer,});Setup commands must complete successfully before the server starts. If cloning or installation fails, the initialization handler attempts to delete the incomplete workspace so a later attempt can start over. The detached server command starts a process without waiting for it to become ready to serve requests.
For an existing sandbox, getOrCreate returns without resuming the session. The next SDK operation that needs a running session triggers the resume and its callback. If the saved snapshot has expired, that operation returns snapshot_not_found; set resume: true to let retrieval recreate the workspace and rerun initialization in that case.
Fork a prepared workspace for parallel research trials or evals with the same baseline. For generated apps, configure an exposed port and use sandbox.domain() to get its public URL. Follow the app-builder setup to bind and expose the server.
Copy link to headingBroker an API key so it never enters the sandbox
Code can read an API key passed into its environment. In brokered.ts, a rule on an allowed domain adds the authorization header as requests leave the sandbox. Set AI_GATEWAY_TOKEN to your AI Gateway API key in the host application's environment so the firewall can inject it:
import { Sandbox } from '@vercel/sandbox';
const token = process.env.AI_GATEWAY_TOKEN;if (!token) { throw new Error('Set AI_GATEWAY_TOKEN before creating the sandbox.');}
const sandbox = await Sandbox.create({ networkPolicy: { allow: { 'ai-gateway.vercel.sh': [ { transform: [ { headers: { Authorization: `Bearer ${token}` } }, ], }, ], }, },});The key stays outside the sandbox, and this policy blocks destinations other than the listed domain. Generated code can still use the key's permissions there, so scope it to the task. If you add request matchers, unmatched requests can reach the domain without the header; finish the rule list with a direct-response rule when those requests should be rejected.
Copy link to headingFrequently asked questions
Copy link to headingWhat is the best free E2B alternative?
Check whether an offer provides a recurring allowance or a trial credit, then compare its runtime and concurrency limits with your workload. Vercel Sandbox includes recurring monthly compute quotas on Hobby and blocks new sandbox creation when a quota is exhausted. Review the current terms before relying on any free tier for an ongoing service.
Copy link to headingCan you self-host E2B or its alternatives?
E2B Embed packages E2B's Apache-2.0 runtime for one Linux machine you operate, with the same SDK and API as E2B Cloud. Enterprise BYOC provides a managed deployment across machines in your cloud account. Northflank and Daytona Enterprise also support customer-owned infrastructure.
Copy link to headingHow should you compare E2B alternative costs?
Estimate costs from a representative agent session, including CPU activity, memory allocation, and storage retained between runs. Check each provider's billing units, minimum charges, and included usage before comparing totals. Model inference and network transfer may be billed separately from compute and storage.
Copy link to headingDo E2B alternatives save memory state when paused?
Most preserve files rather than running processes. Persistent Daytona v2 Linux sandboxes can retain memory on pause, but sandboxes with attached volumes can't pause. Fly.io Sprites preserves memory through a warm pause and loses it after a cold one, while Modal offers memory snapshots in alpha with a seven-day expiry. Vercel Sandbox, Upstash Box, Northflank, and Railway Sandboxes retain files, volumes, or checkpoints, so applications must restart their processes.
Copy link to headingWhich E2B alternatives keep API keys out of the sandbox?
Six of the seven document a way to add a credential to outbound requests outside the sandbox. Those are Vercel Sandbox's credentials brokering, Daytona Secrets, Modal's secret injection in beta, Northflank's egress secrets, Fly.io Sprites Connectors, and Upstash Box's Attach Headers. Railway's docs describe secrets as environment variables that commands in the sandbox can read.