The economics concept of an efficient frontier describes optimal points between cost and capability. AI teams borrowed this term to discuss model-level tradeoffs—specifically the highest intelligence achievable at a given cost or size. Separately, inference engineers have their own frontiers, most often mapped by the latency-throughput relationship that determines serving cost. Beyond that core axis, quality can be exchanged for throughput through techniques like quantization, distillation, and pruning. Intelligence can be traded for speed through reasoning-level adjustments.
Seven sandbox architectures that balance realism safety and startup speed
A sandbox is a practice copy of your application. Think flight simulator: close enough to the real thing that practice counts, fake enough that a crash hurts nobody. Every sandbox trades off realistic (it behaves like production), safe (mistakes stay inside) and fast and cheap (you can start lots of them in seconds). Nobody gets all three.
Island design runs one service on its own with every dependency faked: mocks, emulators like LocalStack, recorded HTTP responses. It is the fastest and cheapest check you have, and nothing can escape it. It is also only as true as your fakes, and it misses everything that happens between services, which is exactly where the agent in the intro got caught. Use it as a first check.
Local Dev is the sandbox most people already have: the stack running on a developer's laptop, with native processes or Docker Compose, maybe behind a CLI. Feedback is instant and it costs nothing. It also runs one agent at a time and drifts from machine to machine. The agent runs with the developer's credentials, so the blast radius is the laptop plus anything those credentials can reach.
Devbox moves local dev to the cloud. A persistent machine built from a prebuilt image, either one per engineer or a few set aside for agents. It is bigger than a laptop, identical for everyone, and keeps running when you close the lid. You pay for it while it sits idle, it drifts unless you rebuild it, and agents sharing a box share its mess.
Ephemeral gives a fresh VM or container for every task, started from a pre-warmed snapshot and thrown away afterwards. Production and the open internet are out of reach. Stripe's Minions run on pre-warmed devboxes that start in about 10 seconds. Ramp runs each session in a Modal sandbox booted from a snapshot rebuilt every 30 minutes. GitHub Copilot's coding agent works on an Actions runner behind a firewall allowlist. Snapshots need rebuilding, every task costs something, and you get a dev stack rather than production's real infrastructure.
Pets versus cattle: a pet has a name, and when it gets sick you nurse it back. Cattle get numbers and get replaced. Devboxes are pets. Ephemeral sandboxes are cattle. An agent shouldn't burn an hour debugging its own environment. If a sandbox gets into a weird state, throw it out and start a fresh one.
Preview Environment is a production twin. You deploy production's own config with sandbox settings, one isolated copy per environment, and agents reach in from outside. It is the most realistic option, and there's no second stack definition to keep in sync. It is also slow to start, expensive and complicated, and some third-party services can't be copied at all. Lyft ran full per-engineer environments until they stopped scaling, then moved to request routing. A small warm pool for integration and infrastructure work is usually enough.
Hybrid runs only the services you're changing and borrows the rest from a shared environment. Tagged requests reach your version; everything else hits the shared copies. Uber's SLATE and Lyft's staging overrides both work this way. It starts in seconds, and the dependencies are real. The catch is that data and queues are shared, so there is always a risk your "sandbox" may break everyone else's. This is trading cost for safety.
Shadow runs the new version beside production on a copy of real traffic. Its responses are compared with production's and then thrown away, so users never see them. Twitter open-sourced this as Diffy. You get real inputs and catch regressions nobody wrote a test for. You also get customer data flowing through it, which clashes with the test-accounts rule, and every write and side effect has to be blocked or sent to test storage. This can act like a validation check.
Why sandbox infrastructure struggles to scale
The idea is simple. Building it is where teams get stuck. When the stack won't fit on one machine, you can start trimming. Smaller data seeds helps. So do lighter stand-ins for the heaviest services. Bonus points if you have well defined service boundaries. If you don't, you may have to start big.
It is rarely just one service needed. A service will depend on other services, which depend on other databases, and on and on. Even a minimal viable sandbox may be hard to achieve.
Many companies have codebases that span across multiple repos. If you have a single monorepo, cloning may be large but more manageable. But often a company's codebase spans across multiple repos. You have some options: clone them all. One sandbox checks out every repo on the task's branch, so the agent can change any of them. It is the most flexible and the slowest to start. GitHub Codespaces both support it. Build one, pull the rest. Build the repo you are changing from source and run the others from the images they last published from main. Fast and cheap, but only one repo changes at a time. Link sandboxes by branch. Each repo's PR gets its own sandbox, a shared branch name groups them, and one routing key sends requests through all of them. Optionally consider the PR number from a common repo.
Cost: a full copy of the stack for every open PR, idle most of the day, adds up to a second production bill. Agents make it worse. They open more PRs and leave them open longer. So turn sandboxes off when nobody is using them: sleep after a quiet period, wake on the next push, tear down when the PR closes. Pack services together too. You don't need a database server per service when one server can hold all the databases.
How current does it need to be? Your own change is always current. What matters is how far behind main everything else is.
The data that makes sandbox tests meaningful
Without data, your app isn't testable. Real bugs show up in specific states, like a huge account or an expired trial or one missing field, so each change needs its own scenario. I'd combine two sources. A nightly copy from a test account. Most companies already have QA, demo and internal orgs used for testing or development. Dump those from a read replica, following foreign keys so related rows come along. Then publish a dated snapshot that each sandbox restores copy-on-write. Customer data should never make it into the snapshot.
Seeded scenarios: describe the required data in plain English, turn it into a reusable template, and create the data through the product's own APIs so it's valid. Seeding from a prompt: prompt, plan, API calls. Data processing: sometimes rows aren't enough. If your product runs on events, streams or batch jobs, the sandbox needs a small version of that pipeline to process that data as well. That may mean running a data pipeline on your seeded data to produce the write output values.
Access patterns that keep agents moving
An agent stuck at the login screen can't check anything. Give sandboxes a dev-only login that skips SSO and captchas, and let the agent sign in as any seeded role: admin, viewer, a new user. Passwords shouldn't matter much in a sandbox - it's a playground. Mock out your calls to password services.
Receipts that prove work happened
Every PR should come with receipts - evidence the changes work. Screenshots or a recording of the pages the agent visited, the API calls and their responses, server logs, the rows it read and wrote. A reviewer can skim that in a minute, or click through to a preview environment - which beats pulling the branch and running it. Read the sessions themselves. Each place an agent couldn't run something, or hacked around it, goes on a checklist ranked by how often it comes up. The platform team works down from the top, and every fix helps every session after it.
Where to start building agent sandboxes
Humans likely already have ways to test and validate most changes - you just need to find a way to allow agents to run similar processes and view the results. You don't have to build all of it at once. Pick the design that fits your stack; if it fits on one machine, that's probably Ephemeral. Wall it off from real data and production services. Load it with test-account data and give the agent a way to log in. Have the harness record what the agent actually did. Then read the sessions. The first few will show you exactly where agents get stuck, and the most common blocker is your next piece of work.