A Sandbox for AI Coding Agents at Scale Is a Warm-State Problem Running 20 to 100 parallel AI coding-agent sessions makes sandbox setup, not boot, the dominant cost, according to a production-operations analysis that recommends building warm state once and forking it per session. The analysis cites Anthropic's early design, which built a full workspace for every session before use; after Anthropic deferred setup until a session requested it, the typical wait for a first response dropped by roughly 60%. The piece also reports that one company measured 3.5 minutes of a 6-minute build going to worker preparation, and that three of four hosted sandbox rates land within a few dollars of each other, leaving provider concurrency ceilings to decide the run. Production Operations A Sandbox for AI Coding Agents at Scale Is a Warm-State Problem 1. At 20 to 100 parallel coding-agent sessions, the expensive part of a sandbox is the setup between boot and first useful action, not the boot, so the choice is about who pays that setup cost, how many times, and on whose critical path. 2. Match isolation to trust: a worktree isolates files only and fits trusted sessions on one machine, while unattended or untrusted-input sessions need a per-session kernel, audited for engine pin, default runtime, and egress default. 3. Build the warm state once and fork it, but re-mint every session-unique identity after restore, because a cloned snapshot duplicates IDs, nonces, and entropy. 4. Share dependency caches read-only with a private writable layer per session, and keep credentials in a proxy outside the sandbox with egress denied by default, since an allowlisted domain is a capability grant. 5. Price per session-hour at your real concurrency: three of the four hosted rates land within a few dollars of each other, so the provider’s concurrency ceiling decides the run. The plain-language edition for readers outside AI engineering no background needed · 9 min When you let many AI coding helpers work at the same time, each one needs its own safe workspace, and the hard part is not starting that workspace. The big idea Picture 50 cooks who all need to make a dish from the same recipe. Turning on a stove takes a second. But each cook also has to shop, unpack, chop and preheat before cooking anything useful. If every cook does all of that alone, you pay for it 50 times. The better plan is to prep one kitchen, copy it 50 times, and give each copy its own lock and its own key. That is the post’s point. A “sandbox” is a sealed workspace where an AI helper can run code without touching anything it shouldn’t. Starting one is fast. Getting it ready to do real work is slow, and how you pick a sandbox decides whether you pay that getting-ready cost once or fifty times. The same choice also decides how safe the whole setup is. The author works through one example he made up for illustration, not a real incident. A team wants to upgrade one software ingredient across 50 parts of a big project, so it starts 50 AI helpers at once. Each helper needs the project copied in, its pieces installed, and a first build run. Each also needs a key to save its work and a way to reach the shared parts library. Measure the getting-ready time, not the startup time Starting one of these sealed workspaces can take about an eighth of a second. One company that measured its own project found that of a 6-minute build, 3.5 minutes went to getting the worker ready. If every helper in the example lost 3.5 minutes that way, the 50 helpers would burn 175 minutes before writing a single line of the upgrade. The 3.5 minutes belongs to that company’s project. Yours will differ, which is why the post says to time it yourself. One real case shows the payoff of waiting. Anthropic’s early design set up a full workspace for every session before it did anything. After they stopped building one until a session actually asked for it, the typical wait for a first response dropped by roughly 60%. A separate folder is not a separate room The cheapest way to give each helper its own copy of the project is a separate folder for each one. But a separate folder only separates the files the helper edits. Everything else on the machine is still shared: the network door numbers, the test database, the memory, the core of the operating system. So 50 helpers on one laptop will soon collide. They all want the same door number for their test server, and one helper’s cleanup wipes the data another is checking. The author’s view is that separate folders are fine only when you trust the helpers and they all run on one machine. For anything unattended or untrusted, a folder gives no security protection at all. If you do use shared setups, prepare the environment once each time your ingredients change, rather than rebuilding it every time a helper starts. Even then, it still shares the machine’s core, so it stays in the “trusted” category. For untrusted work, give each helper its own core Suppose the helpers run overnight with nobody watching, and they read code written by strangers. Then sharing the machine’s core with them is not good enough. Amazon states plainly that it does not treat ordinary containers as a security wall between customers. One research team planted weaknesses in container setups and found that advanced AI models could find and use them. The post is careful about what this shows. It shows what a capable AI does with a badly configured setup. It does not show that standard containers fall apart on their own. The safer options give each helper its own private core, either as a tiny virtual computer or through a lookalike core that sits between the helper and the real one. The post also notes that a virtual computer is not automatically more secure than the lookalike approach. It then gives five questions to ask any product: - Does each session get its own core? - Which version of the underlying engine does it run, and how far behind the latest fixes is it? One study found some products lagged anywhere from no time at all to well over a year. - What happens when nobody says which kind of isolation to use? In one system, the answer was no protection. - What can it send out to the internet by default? Even a strong wall around the helper does not stop it from uploading something. - How much slower is it on your real work? The lookalike core can be up to 10 to 200 times slower on tasks that open and close lots of files, which installing parts does constantly. The post warns that most published slowdown numbers are out of date, so run your own test and compare. Prepare one kitchen, copy it, then re-number every copy Instead of preparing each workspace separately, get one fully ready, take a snapshot of it like a photo of the exact state , and start all 50 helpers from that snapshot. Then the preparation cost stays the same whether you run 5 helpers or 500. In the one real case cited, the company’s typical test run dropped to 30 seconds. The catch is that copying also copies things that were supposed to be one of a kind. Think of photocopying a form that already has a ticket number on it. All 50 copies now claim the same number. For computers, that means IDs, random numbers and security codes. The people who build these tools say that resuming from the same snapshot more than once is unsafe unless something makes each copy generate fresh versions. So the rule is to create anything unique after each copy starts, not before the snapshot is taken. Each copy also gets its own branch name so the 50 helpers never save onto the same one. Also expect a slow start. The copy’s first real task has to load pieces it hasn’t touched yet, and in one study a started-from-snapshot function ran 95% longer than normal on average. Time the first few minutes after the restore, not only the restore itself. Share the parts shelf, but let nobody write to it Fifty helpers downloading the same parts pay for the same files 50 times. A shared shelf fixes that. But the shelf must be read-only for the helpers. If all 50 can write to it, one helper that picks up a bad part can slip something harmful onto the shelf that the other 49 will use. The safe version is a shelf stocked by a trusted job, which each helper reads but can’t change, plus a private notebook for each helper’s own additions. This is the author’s judgment: he is applying a space-saving trick measured elsewhere to coding helpers. The danger of a poisoned shared shelf, though, is well documented in ordinary software building. Keep the keys and the door outside the room In a story from Anthropic, a sandbox worked perfectly and the data still got out. The helper was allowed to contact one approved website, and that website could accept uploads to anyone’s account. So a list of allowed sites is not just a filter. Each entry is a power you handed over. The fix is to keep the real keys outside the sandbox, with a trusted middleman who adds them to outgoing requests. Block outside contact by default. In the example, the one real key to save work lives with the middleman, and each helper holds only a ticket that works for its own branch. Even then, a hostile instruction hidden in a downloaded part could tell a helper to send out the project. The blocked sites are safe, but the parts library has to be allowed so installs work, and that is a hole to watch. Tighter rules also cost something. A study found that hardening always costs AI coders either success or money, in different amounts for different tools. So set each helper’s time and spending budget under the rules you really enforce. A helper that hits a blocked door tends to build a workaround, and the workaround eats the budget. Price it at your real number of helpers Price one helper for one hour, then scale to how many you really run. In the example, 50 helpers for 8 hours came to somewhere around $66 to $95 across four providers, which is the author’s own arithmetic from their published rates and leaves out some fees. The dollars are small and similar. What decides the outcome is each provider’s cap on how many helpers can run at once. On one entry-level plan, only five of the 50 would run while the other 45 waited. Idle time matters too. A helper waiting on a person or a model should stop costing money while it waits. An all-night batch is busy almost the whole time, so price it by hours of active work. A fixed order of questions The author suggests walking through the questions in a set order. This order is his own synthesis; no source prescribes it. In short: time the getting-ready cost, then ask whether the helpers are trusted and on one machine. If yes, use separate folders and stop. If not, add a private core, then a snapshot, then a read-only shared shelf, then keys outside, then price it. Only the first yes ends the walk early; every other yes adds another protection. What this means for you If you are planning to run many AI coding helpers at once, do not judge a sandbox by how fast it starts. Ask how much work each helper must do before it can begin, and whether that work can be done once and copied. Match the wall to the trust: separate folders only for trusted work on one machine, a private core for anything unattended or untrusted. When you copy a prepared setup, give every copy fresh locks. Keep real keys and internet access outside the room. Check the provider’s limit on simultaneous helpers before you look at the hourly price. The technical terms, in plain words - Sandbox = a sealed workspace where a program can run without touching anything outside it - Coding agent or session = one AI helper working on a coding task - Fan-out = starting many helpers at once on pieces of the same job - Boot = starting up the sealed workspace - Setup cost = the work between starting and the first useful action copying the project, installing parts, a first build - Git worktree = a separate folder holding its own copy of the project’s files - Shared kernel = all the programs on a machine sharing the same operating-system core - Container = a lightweight sealed box that still shares the machine’s core - MicroVM = a tiny virtual computer with its own core - Firecracker = a tool that starts such tiny virtual computers very fast - gVisor = a lookalike core that sits between the helper and the real one - Snapshot = a saved photo of a fully prepared workspace - Fork or clone = starting a new workspace as a copy of a snapshot - Re-mint = generate fresh unique values for a copy - Cache = a shared shelf of already-downloaded parts - Cache poisoning = slipping a bad item onto that shelf so others use it - Egress = data going out from the sandbox to the internet - Allowlist = the approved list of outside sites a helper may contact - Proxy = a middleman outside the sandbox that holds keys and adds them to outgoing requests - Credentials or token = a key that proves who you are - Concurrency = how many things run at the same time Keep reading: the full version, with the research and sources ↓ essay The expensive part of a sandbox is rarely the boot. It is everything a session does between boot and its first useful action. At 20 to 100 parallel coding-agent sessions, your sandbox choice either multiplies that setup cost or hides it. Anthropic’s first Managed Agents design made every session pay full container setup before it could produce a single token. After they stopped provisioning a container until a session asked for one, p50 time-to-first-token dropped roughly 60% and p95 dropped over 90% Anthropic: Scaling Managed Agents https://www.anthropic.com/engineering/managed-agents