Blog

What is an AI agent sandbox, and how do you choose one?

Seven kinds of products use the name. For testing an agent, the one that matters is the one you can read after the run.

November 10, 2026 · Patrick Liu

Two different products answer to the name AI agent sandbox. One is a machine where code the agent writes can run without reaching anything else, the kind of product E2B and Daytona offer. The other is a copy of the tools the agent works in, such as Zendesk, Stripe, Slack and GitHub. The copies answer like the real APIs, so the agent can do its actual job and nothing real changes. This post is about the second kind, the sandbox you test an agent in. We make one of them, Ancha, and the table further down lists it with the others.

Both kinds isolate. That is the property the word suggests, and for testing it is the easy part. What separates a useful testing sandbox from the rest is what you can read after the run. An agent’s worst mistakes rarely produce an error. Three of the recorded examples on our tool pages show it. A support agent replies on the customer’s other ticket in Zendesk. A billing agent refunds a Stripe payment that someone refunded twenty minutes earlier. A deploy agent asked to mute one Datadog monitor mutes all of them. Every API call in those runs succeeded. A sandbox that only keeps the agent in would report three clean runs.

So judge a sandbox for testing by what it lets back out. That means the state of each tool once the agent is done, the calls it made in order, and what it told the people around it.

The five parts of a sandbox you test an agent in

Each part catches a kind of mistake the others can’t.

Tools that keep what the agent writes. The agent calls the same API paths it calls in production, with its own SDK pointed at a different base URL. Writes stay. After the agent posts a reply, the next read of the ticket includes it. A refund it creates is there the next time it lists refunds. That sounds like a given, and it is the first thing to check, because many mocks answer a request the same way whatever came before. When a write disappears, the agent can’t see what its own call did, and neither can your test.

Starting data that makes the task hard. These are the records the task needs, in the state that makes it hard. A customer has two open tickets. A bug is already In Progress. A refund went out twenty minutes ago. An empty account flatters every agent. There is no second ticket to reply on by mistake and no earlier refund to duplicate, so a careless agent and a careful one end up in the same place. Every run should start from the same records with the same ids. Then a check can point at ticket 4101, and two runs of one task can be compared.

The people around the agent. Most agent jobs involve someone else. A customer answers a question, an engineer knows the workaround, a manager decides the priority. In a testing sandbox those people reply through the same tools the agent uses, after a delay, and share a detail when someone asks for it. Without them you can’t test the mistakes that involve them, such as acting before asking or passing an internal detail to a customer.

A clock. Agents that wait or follow up depend on time. A reply arrives twenty minutes later, a monitor recovers once a fix is deployed, a page has to be acknowledged in time. A simulated clock makes those happen at the same moments on every run, without waiting for real minutes to pass. It also makes timestamps repeat, which matters as soon as a check asks whether one thing happened before another.

Checks that read the result. Conditions read after the run, on the end state (the reply is on ticket 4101) and on the calls (no second refund was created). A model can decide differently from one run to the next. So the same task runs several times from the same start, and the checks give a pass rate instead of one anecdote.

Seven kinds of products called agent sandboxes

Each product is described in its own words, from its site or documentation, read on November 10, 2026.

KindWhat you getExamples, in their words
Code execution sandboxesAn isolated machine for code the agent writesE2B: “isolated cloud sandboxes where AI agents safely execute code”. Daytona: “infrastructure for running AI-generated code”
Vendor test environmentsThe vendor’s own product, apart from live dataStripe: “A sandbox is an isolated test environment.” Slack developer sandboxes: “an Enterprise org environment”
HTTP mocks and service virtualizationResponses you recorded or wrote, per requestWireMock, Mockoon, Prism, MockServer and Hoverfly; see service virtualization for AI agents
Stateful API replicasCopies of third-party APIs that keep what you writeArchal: “isolated, stateful versions of the services they use”. Arga Labs: “Stateful replicas of external services”. Rystic: “local, stateful simulators of the third-party APIs”. Vercel Labs’ emulate: “Local drop-in replacement services for CI and no-network sandboxes”
Simulation environmentsTools, tasks, simulated users and grading togetherHue: “Test your agent in realistic worlds.” Veris AI: “A simulated copy of your systems, data, APIs, and users”. Collinear: “A simulation lab to train, test and refine agents”. Ancha
Tracing and evaluation platformsProduction traces, datasets, experiments and scoresLangfuse, LangSmith and Braintrust; see what each does and what Ancha adds
Research benchmarksFixed tasks for comparing models and agentsτ-bench: “A Benchmark for Tool-Agent-User Interaction in Real-World Domains”

Our comparison pages set Ancha next to Archal, Arga Labs, Rystic, Hue, Veris AI and Collinear row by row, with a source for every cell.

Which kind answers which question

You will probably use more than one, because each kind answers a different question.

A code execution sandbox answers where code the agent writes may run. If your agent writes and runs code, it needs one, whatever else you use.

A vendor’s own test environment is where you check the things only the vendor can show you: that your app installs and how a message looks. How to test a Slack bot sets Slack’s developer sandbox next to the other ways to test a bot. The cost is in the count. Each vendor’s sandbox is set up, seeded and reset in its own way, so an agent that works across four tools means four of them to keep in step.

HTTP mocks and service virtualization suit tests of your own code: the request your tool function builds, how it handles a 429 or a timeout. They answer each request from what you recorded or wrote, which is exactly right for that job.

The agent’s decisions are a different kind of test. Take which ticket it replied on, whether it refunded twice, or whether it asked before it acted. Each one depends on several calls across several tools, on what each write changed and on what people said back. That takes state that changes as the agent acts, plus people, a clock and checks that read the result. Stateful replicas and simulation environments are built for this.

Research benchmarks answer a third question: how models and agents compare on the same fixed tasks. Fixed, shared tasks are what make that comparison fair. Your own agent’s job, with your tools and your customers’ situations, needs a world you write.

Tracing and evaluation platforms sit at the other end. They record what happened in production, which is where the runs worth testing come from. A trace can show you that an agent refunded twice. A sandbox lets you run the fixed agent against the same situation and watch it refund once.

Six questions to ask before you pick one

Does my agent run unchanged? It should reach the sandbox through its own SDK, by changing a base URL and a token, or through MCP if that is how it calls tools. Code you change for the test is code the test doesn’t cover.

Does it have the tools and endpoints my agent calls? Ask for the endpoint list per tool, then hold it against one of your agent’s traces. The calls in the trace are the ones that have to work.

Do writes stay, and does every run start the same? The first lets a test see consequences. The second lets you compare runs, and this week’s agent with last week’s.

Can it hold people and time? If your agent asks anyone anything or waits for anything, the sandbox needs both.

Do failures come with reasons? A useful verdict names the failed check, the expected and the actual result, and the calls behind it. A bare pass rate tells you something broke and leaves you to find where.

Where does it run, and what leaves my machine? A laptop, CI and a hosted workspace each suit a different step. Traces of production runs hold customer data, so know where they go.

Once you have production traffic, add a seventh: can a run that went wrong in production become a test without days of writing fixtures?

Try one by hand: the support world

The quickest way to see what a testing sandbox gives you is to be the agent yourself. Our support world holds Erin Walsh’s two open Zendesk tickets at Ridgeway Robotics, the CSV export bug already In Progress in Jira, and an #eng-escalations channel in Slack. Save it in an empty folder and start it. You need Node.js 24, curl and jq.

npm install -g @ancha-labs/cli
ancha world up --scene support-world.yaml
running locally (worlds in a server on this computer, until ancha world down or 10 minutes without worlds)
world omg4kvfg is ready (scene support-world); it expires at 2026-11-11T01:39:49.367Z unless used
Give your agent these variables:
  ZENDESK_API_URL=http://127.0.0.1:52159/e/omg4kvfg/zendesk/api/v2
  ZENDESK_EMAIL=support@acme.example
  ZENDESK_API_TOKEN=<fake token>
  JIRA_BASE_URL=http://127.0.0.1:52159/e/omg4kvfg/jira
  JIRA_EMAIL=support@acme.example
  JIRA_API_TOKEN=<fake token>
  SLACK_API_URL=http://127.0.0.1:52159/e/omg4kvfg/slack/api/
  SLACK_BOT_TOKEN=<fake token>
  SLACK_SIGNING_SECRET=<fake secret>
  SLACK_APP_TOKEN=<fake token>
  ANCHA_MCP_SLACK_URL=http://127.0.0.1:52159/e/omg4kvfg/mcp/slack
  ANCHA_MCP_SLACK_TOKEN=<fake token>
  ANCHA_ENV_ID=omg4kvfg
  ANCHA_SCENE_ID=support-world
  ANCHA_TASK=Erin Walsh at Ridgeway Robotics wrote in because her monthly CSV export is empty. Reply on that ticket, make sure engineering has the bug in project OPS without filing a duplicate, and post the escalation in #eng-escalations.
next: ancha check --env omg4kvfg --json
next: ancha world down --env omg4kvfg

The tokens are fake. They work against this world and nowhere else. Export the three Zendesk variables, read the CSV ticket, reply on it, and read it again:

curl -s -u "$ZENDESK_EMAIL/token:$ZENDESK_API_TOKEN" \
  "$ZENDESK_API_URL/tickets/4101/comments.json" | jq -r '.comments[].body'
Our monthly CSV export has been empty since Monday.
curl -s -u "$ZENDESK_EMAIL/token:$ZENDESK_API_TOKEN" -X PUT \
  "$ZENDESK_API_URL/tickets/4101.json" -H 'Content-Type: application/json' \
  -d '{"ticket": {"comment": {"body": "We found the cause and engineering is on it.",
       "public": true}}}' > /dev/null
curl -s -u "$ZENDESK_EMAIL/token:$ZENDESK_API_TOKEN" \
  "$ZENDESK_API_URL/tickets/4101/comments.json" | jq -r '.comments[].body'
Our monthly CSV export has been empty since Monday.
We found the cause and engineering is on it.

The reply is there on the second read, because the world kept the write. Now grade the world with the checks in its test file:

ancha check --env omg4kvfg
pass  replied_on_the_csv_ticket
pass  left_the_invoice_ticket_alone
pass  filed_no_duplicate
fail  commented_on_the_open_bug: expected agent calls POST /rest/api/*/issue/OPS-2/comment; got never called; agent made 3 call(s)
fail  posted_the_escalation: expected ≥1 message in #eng-escalations from @support-agent; got 0 matching; @support-agent has 0 message(s) in #eng-escalations
verdict: fail (3 of 5 required checks pass)
next: ancha world trace --env omg4kvfg --json
next: ancha world down --env omg4kvfg

Three of five checks pass, which sounds like most of the job. Look at which three. replied_on_the_csv_ticket passed because of the reply. The other two, left_the_invoice_ticket_alone and filed_no_duplicate, are guards: they pass on any run that avoids a mistake, including a run that does nothing at all. The two that fail are the rest of the job, a comment on OPS-2 in Jira and a post in #eng-escalations. That is why the test lists all five as required.

The two kinds of trace check also count differently. A check that wants a call counts only calls that succeeded, so a reply Zendesk rejected would not pass replied_on_the_csv_ticket. A guard counts every attempt, so even a refused request to create a second bug fails filed_no_duplicate. Had the curl reply gone on ticket 4102, the invoice ticket, two checks would have flipped at once: the reply check and the invoice guard.

ancha world down --env omg4kvfg removes the world. How to test a customer support agent runs a whole agent against the same world.

How Ancha builds each part

Tools. Ancha runs stateful replicas of 43 tools, Slack, GitHub, Zendesk, Jira, Stripe and Salesforce among them. Your agent keeps its SDK and changes the base URL. ancha connect <tool> prints the client setup for each tool, and each tool page on this site lists the endpoints it answers. Agents that call tools through MCP get MCP endpoints for Slack, GitHub, PagerDuty, Datadog and NetSuite, which read and change the same state as the APIs.

Starting data. A test file seeds the world, as the support world does above. Every run starts from a fresh copy of the same records, so checks can name them by id.

People. A test’s people are the customers, engineers and managers the agent deals with. Each has accounts in the seeded tools, facts they share when asked, decisions they make by rule and a delay before each reply. A model writes their words. Ancha decides who receives each message and records which facts each person learned. Process checks read those records, so a test can require that the agent asked before it acted, or that a confidential fact never reached the customer.

The clock. Every world runs on a simulated clock that starts at the test’s start_time. World rules act on it while the agent works. A person posts in Slack two minutes in. A fault keeps a metric high until a fix is deployed. A monitor alerts and pages PagerDuty. ancha init --template incidents writes five living-world tests to start from.

Checks. state checks read the tools after the run, and trace checks read the agent’s calls. Process checks read what passed between the agent and the people, and judge checks ask a model to grade text. ancha run -n 5 starts your agent five times, each on a fresh copy of the world, and reports how many runs passed. ancha explain shows expected against actual, with the calls behind each failure.

From production. When a run goes wrong in production, ancha import turns its trace into a test. Each tool Ancha replicates is seeded from the calls in the trace. From then on it answers from its own state, so the fixed agent can call it differently from the one that failed. Langfuse, LangSmith, Braintrust, and what Ancha adds follows one from trace to fix.

Questions

Is an AI agent sandbox the same as a code execution sandbox?

No. A code execution sandbox, such as E2B or Daytona, isolates the machine where code the agent writes runs. A sandbox for testing an agent stands in for the tools the agent works in, with their data, so its writes land on copies. An agent that writes and runs code may need both.

Can I use each vendor’s own sandbox instead?

Yes, for the things only the vendor can show: installation and how the product renders. Stripe calls its sandbox “an isolated test environment”, and Slack offers developer sandboxes. Each one is set up, seeded and reset its own way, so an agent that works across four tools needs four of them.

Do I need a model to run a sandbox test?

Not for the tools, the starting data, the clock, or state and trace checks. A model writes what simulated people say and grades judge checks. For those, set OPENROUTER_API_KEY in the shell that runs ancha run.

How does my agent connect to the sandbox?

Through its own SDK, pointed at a different base URL with a different token. Ancha puts each tool’s URL and fake credentials in the agent’s environment, such as ZENDESK_API_URL and ZENDESK_API_TOKEN, and ancha connect prints the client setup for each tool, for example ancha connect zendesk.