Skip to content
Dashboard

5 best sandboxes for running AI agent evals

Content Engineer

Vercel Sandbox, Modal, Daytona, E2B, and Cloudflare Sandbox serve different agent eval workloads. Consider Vercel for parallel CPU trials with task-level network controls, Modal or Daytona for GPU tasks, and E2B for trials that restore running processes. Cloudflare fits eval orchestration built on Workers.

Repeated trials multiply the infrastructure an eval needs. With Terminal-Bench 2.1's 89 tasks, three attempts per task across two models produce 534 trials. Reset the environment between attempts so one trial's changes don't affect another.

For broader execution needs, compare AI sandbox providers.

Copy link to headingWhat should a sandbox provide for agent evals?

Agent evals that run code pair an instruction with an environment and a verifier that scores the result. The harness sets each trial's starting state and cleans up afterward. Harbor isolates trials, and Inspect AI provides per-sample environments. SWE-bench grades submitted patches in containers.

  • Check concurrency and creation limits. Parallel trials can progress while others wait on model responses. Harbor's --n-concurrent defaults to 4; Inspect controls sandbox capacity with max_sandboxes.

  • Prepare the task environment once where possible. Cached images and filesystem snapshots reuse installed dependencies; a snapshot or fork that includes memory can also restore running processes.

  • Limit network access to the task's required destinations. Inspect's generated Docker Compose configuration disables networking; Harbor maps task policies to provider controls. Use credential injection where available to keep API keys outside the agent's environment.

  • Keep verifier code and trusted results beyond the agent's write access. An agent that can edit tests or overwrite a result file can change its own score.

  • Check that the session limit covers the longest trial and compare metering during model waits. GPU and multi-container Docker Compose tasks require support in the harness integration.

Choose a starting point by workload, then check whether the harness supports the task mode you need. Harbor support below refers to its integration, not every capability of the underlying product.

Provider

Workload to evaluate

Harbor tasks

Prepared starting state

Vercel Sandbox

Parallel CPU trials with task-level network policy

CPU and Compose

Cached task images; filesystem snapshots

Modal

GPU tasks and multiple eval integrations

CPU, Compose, and GPU

Prebuilt Images; filesystem snapshots; alpha memory snapshots

Daytona

Reusable task environments

CPU, Compose, and GPU

Filesystem snapshots; VM forks with memory

E2B

Trials with processes already running

CPU; Compose and GPU not listed

Full snapshots and forks with memory

Cloudflare Sandbox

Orchestration on Workers

Custom adapter required

Filesystem snapshots in public beta

Compose and GPU support are separate capabilities. Their availability together depends on the provider's runtime and the task configuration.

Copy link to heading1. Vercel Sandbox for parallel CPU trials

Vercel Sandbox fits parallel CPU trials that need a network policy for each task and credentials kept outside the agent's environment. Each sandbox runs in a Firecracker microVM with its own kernel. Vercel also supports running Docker inside the sandbox for multi-container tasks.

Harbor 0.22.0 and later includes a Vercel environment. Pass --env vercel to run each trial in its own sandbox. Harbor caches task images in Vercel Container Registry and reuses them unless you request a rebuild.

For Docker Compose tasks, Harbor prepares a Docker host and caches it as a snapshot for later trials. Trial sandboxes are deleted by default; --no-delete leaves them running until timeout. Cached builder and Docker-host snapshots remain stored after trial cleanup and can incur storage charges.

Copy link to headingRun a Harbor smoke test

Install uv and configure a Vercel access token as VERCEL_TOKEN. Set VERCEL_TEAM_ID if the token can access multiple teams. Alternatively, use project OIDC authentication through the Harbor setup instructions.

The oracle agent runs the task's reference solution without a model key. This smoke test creates cloud resources and can incur Sandbox usage charges. Its 45-minute lifetime also fits Hobby's session limit:

uv tool install 'harbor[vercel]'
harbor run -t hello-world/hello-world -a oracle -e vercel \
--ek sandbox_lifetime_seconds=2700

On success, the task returns a reward of 1.0. Continue with Terminal-Bench runs to evaluate models through AI Gateway.

Copy link to headingRestore a trial baseline

In a custom harness, choose the baseline and reset behavior explicitly. Vercel sandboxes are persistent by default: stopping a session saves its filesystem for the next session. Set persistent: false for a disposable trial whose filesystem is discarded when it stops.

Start each trial from an image pinned to a digest or a filesystem snapshot captured after setup. Restoring that snapshot brings back files and installed packages. Start any required services before the trial begins.

Copy link to headingPlan capacity and usage

Hobby's plan limits are 10 concurrent sandboxes and 45-minute sessions. Pro and Enterprise allow 10,000 sandboxes with sessions up to 24 hours.

Creation capacity is separate from concurrency. An idle Pro or Enterprise team starts at 150 allocated vCPUs per minute. Under sustained use, that rate rises by 500 vCPUs per minute each minute, up to 5,000. Large runs therefore need a gradual launch even when enough concurrent slots are available.

Vercel meters Active CPU time and provisioned memory separately. Waiting on a model response doesn't add Active CPU time, but memory remains billable while the sandbox runs. Each vCPU includes 2 GB of memory. Use the region-specific pricing when estimating an eval run.

Copy link to headingRestrict trial access

For single-container tasks, Harbor maps network policy to the Sandbox firewall, which enforces it outside the VM. Tasks can use public access, no network, or a hostname allowlist with wildcards. The credential_injection option adds secrets to matching outbound requests without putting the raw key inside the sandbox.

Compose tasks support public and no-network modes but reject hostname allowlists and credential injection. In Harbor 0.27.0, Compose no-network applies a Docker setting to the main service; the host VM retains public egress.

Treat this as a different boundary from a VM-level deny-all policy, and check every service's access before running an adversarial task. In a custom SDK harness, outbound access defaults to allow-all. Set deny-all or a destination policy when creating a trial that requires restricted access.

Scale AI's AgentEnv 0.9.1334 and later includes a Vercel provider, which runs the task environment and the agent in separate sandboxes. The Harbor integration doesn't support GPU tasks, so run those on another provider.

Copy link to heading2. Modal for GPU evals and multiple harnesses

Modal Sandboxes support GPU tasks and several eval integrations. Harbor supports Modal for Compose and GPU tasks, while Inspect AI provides a Modal adapter through inspect-sandboxes. Inspect's adapter accepts single-service Compose files, so don't infer multi-service support from Harbor's integration.

SWE-bench uses Modal to grade submitted patches. Braintrust executes packaged TypeScript evals in a public preview for Pro and Enterprise plans. These integrations run grading or eval code; Harbor supplies the agent's workspace.

Copy link to headingRuntime and starting state

Each Modal Sandbox runs on gVisor or in a VM with its own Linux kernel. Modal directs workloads that run Docker inside the Sandbox to the VM runtime and supports GPU Sandboxes on gVisor only. Check which runtime each task needs.

When creating a Sandbox directly, Modal defaults to a five-minute timeout and permits up to 24 hours. Integrations can choose a different default. Prebuilt named Images let trials reuse an environment without building it during creation.

Modal also supports filesystem snapshots and alpha memory snapshots. Memory snapshots terminate the source Sandbox, exclude GPU Sandboxes, and don't restore background processes launched through exec. Check those constraints before choosing them as an eval baseline.

Copy link to headingNetwork policies

Harbor supports disabling internet access, hostname allowlists, and runtime policy changes on Modal for single-container and Compose tasks. Modal's domain allowlists are in beta and filter TLS traffic on port 443. Runtime policy changes are experimental. Configure each allowlist type at creation to update it later.

Compare runtime and state options for your eval workload.

Copy link to heading3. Daytona for reusable task environments

Harbor lists Daytona for both Docker Compose and GPU tasks, and Inspect AI lists a daytona environment in its inspect-sandboxes package.

Daytona has three sandbox classes with different boundaries:

  • Container sandboxes use dedicated namespaces.

  • VM sandboxes have their own kernel.

  • GPU sandboxes are containers with exclusive GPU allocation.

Pause and resume, forking, and hot snapshots work on VM sandboxes only. Forking duplicates a running VM sandbox with its filesystem and memory.

Copy link to headingPrepare and reset trials

Daytona can create trials from a prepared snapshot built from an image or captured from a container or VM sandbox. Stop a container before capturing it; VM hot snapshots can capture a running environment.

GPU sandboxes can start from GPU snapshots but can't capture their own filesystem or memory. Ephemeral sandboxes are deleted when stopped, so copy trial artifacts out before cleanup.

When using Daytona's SDK directly, wall-clock expiry is unset by default. Container and GPU sandboxes auto-stop after 15 minutes of inactivity, while VM sandboxes auto-pause after 60 minutes. Integrations can override those defaults, so check the lifecycle settings your harness uses for long trials.

Copy link to headingCapacity and network access

Daytona's CPU sandboxes share regional pools of vCPUs, memory, and storage. The default-region pool includes 100 vCPUs on Tier 2, 250 on Tier 3, and 500 on Tier 4.

GPU sandboxes use separate quotas. Creation limits range from 300 sandboxes per minute on Tier 1 to 600 on Tier 4.

Daytona allows outbound internet access by default on Tier 3 and above. Those tiers support custom CIDR or domain policies; Tiers 1 and 2 retain organization-level restrictions. In Harbor, Daytona hostname allowlists apply to single-container tasks.

Daytona Secrets places a placeholder in the sandbox and substitutes the real value in outbound HTTPS headers. Configure the secret's hosts allowlist to restrict its destination. Without that list, substitution is permitted for any host.

Copy link to heading4. E2B for restoring process state

E2B's Linux VMs can preserve a running service or a dataset already loaded in memory. Fork the prepared environment to give each trial its own copy.

Each fork copies the source's filesystem and memory. One call can create up to 20 forks within the team's remaining concurrency. The source pauses during capture and drops active connections, so reconnect after it resumes.

Set a timeout for the new forks because they default to 15 seconds. For a baseline you can reuse later, full snapshots retain files and memory. Filesystem-only snapshots restart from disk and require project enablement.

Copy link to headingHarness support and limits

Harbor lists e2b as a remote sandbox and doesn't list it for Docker Compose or GPU tasks. E2B sandboxes are CPU-only.

E2B's plan limits allow 24 hours of continuous runtime on Pro and 1 hour on Hobby. Pro includes 100 concurrent sandboxes, and paid add-ons raise that to 1,100. Sandbox creation is limited to 5 per second on Pro and 1 per second on Hobby.

Outbound internet access is enabled by default. E2B supports disabling it or applying allow and deny lists. Compare the state and network controls when deciding how each trial should access external services.

Copy link to heading5. Cloudflare Sandbox for Workers-based evals

Cloudflare Sandbox fits eval orchestration built on Workers. Harbor and Inspect AI don't list a Cloudflare integration, so plan for an adapter when using either one. Harbor accepts a custom sandbox class through --env.

Sandbox SDK 1.0 has no HTTP bridge for external clients. Python harnesses therefore call routes you expose in a Worker.

Copy link to headingState and runtime

Each sandbox uses a Durable Object to manage a Container in a microVM with its own kernel. Use a distinct name for each trial. Stopping the instance discards its ephemeral disk; restart from an image or snapshot you supply.

Cloudflare's Container snapshots let several trials start from the same prepared filesystem. Use that baseline to compare prompts, models, or agent versions. Snapshots and the durable_object scheduling policy are in public beta. Snapshots exclude memory and running processes, so start required services in each trial.

Cloudflare has no fixed maximum runtime, but an instance can stop after inactivity or a platform event. Code running inside the Container doesn't keep its Durable Object active. Maintain activity through a request, response stream, or accepted WebSocket, or use an alarm to check the work before the inactivity timeout expires.

Default account quotas cap concurrent resources at 15,000 vCPUs, 60 TiB of memory, and 300 TB of disk. Size each trial against all three limits.

Copy link to headingNetworking and task isolation

Outbound internet access is off by default. Outbound intercepts send matching HTTP and HTTPS requests to code in your Worker, which can allow or deny them or add a credential the container never sees.

Every process in a deployed container has root's Linux capabilities, so keep verifier code and hidden test data outside the container the agent runs in.

Cloudflare Containers requires the Workers Paid plan and supports running Docker inside a sandbox with the docker:dind image. Compare the lifecycle and egress controls when deciding whether to manage trials from a Worker.

Copy link to headingHow do you choose a sandbox for your eval harness?

Shortlist two providers that support your harness, required hardware, and network policy. Then run the same representative tasks on both:

  • Pin the task revision and image or snapshot. Keep the model configuration, resource allocation, and attempt count consistent.

  • Run reference solutions first. Harbor's oracle agent helps check whether the environment and verifier work before you evaluate an agent.

  • Increase concurrency gradually. Include image preparation, sandbox creation, and cleanup in the test so the run exercises more than command execution.

  • Record completed trials, task scores, infrastructure errors, and timeouts separately. Include failures and retry rules in the results.

  • Measure elapsed time and total cost for the same workload. Include model calls and storage as well as sandbox execution.

For repeated trials, reset external databases and test accounts as well as local files. Snapshots cannot undo changes the previous trial sent to another service.

Copy link to headingWhat can invalidate an agent eval?

Isolation between trials doesn't protect a verifier inside the agent's workspace. An agent that can edit tests or overwrite a reward file can change its own score. Keep grading code and trusted results outside that workspace. Harbor's separate verifier environments copy submitted artifacts into a fresh grading environment.

Restoring a clean environment doesn't make model responses deterministic. Report the scoring method and attempt count alongside repeated-trial results. Use the same grading boundary for RL environments.

Copy link to headingFrequently asked questions

Copy link to headingDo you need a cloud sandbox to run agent evals?

No. Harbor and Inspect AI support local Docker environments, and SWE-bench can grade patches in Docker containers. Local execution can suit development and small runs. Consider a hosted provider when you need more parallel capacity or isolation features than your local setup provides.

Copy link to headingWhich of these providers work with Inspect AI?

Inspect AI lists Modal and Daytona through the inspect-sandboxes package. Its published sandbox listings don't include Vercel Sandbox, E2B, or Cloudflare Sandbox. Inspect supports custom environments through its extension API, so another provider requires a compatible extension.

Copy link to headingHow do you keep API keys out of an eval trial?

Add credentials to allowed outbound requests outside the sandbox. Harbor's Vercel credential_injection option supports this for single-container tasks. Daytona Secrets substitutes placeholders in HTTPS headers; set its hosts allowlist so the real value can only reach approved destinations.

The agent can still use the credential's permissions through these requests. Limit access to the task and use short-lived tokens if a key must enter the sandbox.

Copy link to headingCan snapshots restore running processes?

It depends on the provider and snapshot mode. Vercel Sandbox and Cloudflare Container snapshots restore files, so required services must start again. E2B's default full snapshots and Daytona's VM forks include memory; E2B's optional filesystem-only mode does not.

Modal's alpha memory snapshots can restore process state with limitations: they don't support GPUs or restore background processes launched through exec. Reconnect external services after restoring memory because remote connections may no longer be valid.

Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

  • Agent stack: Build and operate agents with models, tools, and durable workflows.
  • Web applications: Choose rendering, data, authentication, and caching approaches.
  • Backends: Choose a runtime, connect services, and run background work.

Browse all stacks

Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.

More Sandbox articles

Ready to deploy?