Your coding agent needs a computer it can break
Why the code an AI agent writes should run in a sandbox of its own, and what that sandbox does and doesn't solve
A year ago, most of us used AI to suggest code. We read it, pasted it, ran it. Somewhere along the way that order flipped. Now the agent writes the code, runs it, reads the error, changes the code and runs it again, often several times before a person looks at any of it.
That loop is the reason coding agents are useful. It's also the part I want to talk about, because the loop has to run somewhere, and "somewhere" is usually a machine full of things you care about.
I'm Vakeesh, a founding member of Sandscale. We build sandboxes for agent code, so I'm not neutral. I'll try to keep this post about the problem rather than the product, and I'll be clear about where a sandbox stops helping.
Code you didn't read is untrusted input
We already have good instincts about untrusted input. We don't eval a string from a web form. We don't run a stranger's binary on a production box.
Agent-generated code deserves the same instinct. That's not because the agent is malicious. It's because the code is the product of a model, a prompt and whatever text the agent read along the way. Any of those can be wrong. The model can misread a task. The prompt can be vague. A README, an issue comment or a web page the agent pulled in can contain instructions that were never meant for it. When an agent has a "run this command" tool, a bad sentence can become a bad command.
So the useful question isn't "is my agent good enough?" It's "when the agent is wrong, what can its code touch?"
What "wrong" looks like on a normal machine
None of these needs an attacker. They're ordinary mistakes with a large blast radius:
- It reads what it shouldn't. Your home directory has SSH keys, cloud credentials,
.envfiles and browser profiles. A script that walks the filesystem looking for config will find them. - It sends what it shouldn't. If the machine can reach the internet, so can the code. A helpful "upload the logs so I can debug" step is one line away.
- It changes what it shouldn't. A cleanup command with the wrong path. A migration pointed at the wrong database. A
git push --forceon the wrong branch. - It doesn't stop. An infinite loop, a fork, a test that fills the disk. On a shared build server it's everyone's afternoon.
- It leaves things behind. Background processes, installed packages and edited global config. The next run, yours or the agent's, starts from a state nobody chose.
A container helps with some of this, and it's far better than nothing. But a container shares the host's kernel with everything else running there, so the boundary is only as strong as that shared kernel and its configuration.
What a sandbox per run gives you
The idea we built Sandscale around is simple: every agent run gets its own box, and the box is something you can throw away.
In practice that means a few things.
A fresh start each time. The run begins from a known template, not from whatever the last run left behind. That helps safety, and it makes debugging reproducible too.
Its own kernel. Each Sandscale sandbox is a Firecracker microVM that boots its own kernel. It isn't a container sharing a kernel with other work. That's a stronger wall between the agent's code and everything else.
Nothing of yours inside by default. The box holds what you put in it: the repo, the test data, the files the task needs. Your home directory isn't there to be found.
Network you decide. On Sandscale, network access follows your plan and your organization's policy, and a sandbox can reach only what your egress allowlist allows. You make that decision once, at the org level, instead of hoping each script behaves.
Secrets that don't sit in the prompt. If a run needs a token, it shouldn't be pasted into the conversation where it ends up in logs and model context. Sandscale's Vault lets a run reference a secret that's injected at run time, so the value isn't placed in prompts or logs. It's on every plan, Free included.
Limits that end bad runs. A sandbox has a timeout and a size. A runaway loop hits the wall and stops, and the rest of your work never notices.
A record. When something does go wrong, you want to know what happened. Sandscale writes every action to a hash-chained audit log that every plan can read in the console.
Cheap pauses. Agents think between steps. A sandbox can pause and resume with its memory and files kept, and on Sandscale paused time is free. You aren't paying for a box to sit and wait while the model decides what to do next.
What a sandbox doesn't solve
I'd be doing you a disservice if I stopped there.
- It can't make the code correct. A sandbox limits damage. It doesn't review logic. You still need tests, and you still need a person reading the diff before it merges.
- It only protects what's outside it. If you copy production credentials into the box, or open the network to everything, the box will faithfully let the code use them. Isolation is a tool, not a policy.
- The output still lands somewhere. At some point the agent's work leaves the sandbox as a patch, a pull request or an artifact. That handoff is where review matters most.
- Some decisions should stay with people. For actions that really matter, a human approval step beats any amount of isolation. Sandscale has approvals and policies on every plan for this reason, but deciding what needs approval is your call.
Where to start
If you're running coding agents today, here's what I'd suggest, whatever tool you end up using:
- Stop running agent commands directly on your laptop for anything beyond trivial tasks.
- Give each run a fresh, disposable environment with a timeout.
- Keep secrets out of prompts and inject them only where they're needed.
- Decide your network rules on purpose.
- Keep a record you can read after the fact.
If you'd like to try that with Sandscale, the Free plan is $0 a month with 100 awake vCPU-hours, 3 boxes at once and up to 2 vCPU per box. Compute runs in the US today, and Europe is coming soon. I wrote up the actual commands, from the CLI, the TypeScript SDK and MCP, in an earlier post, and the Quickstart has the same steps.
I'd really like to hear how you're handling this now. Where does your agent's code run today, and what would you need to see before you trusted a setup like this with real work?
Best regards,
Vakeesh Moorthy, Founding Member, Sandscale
原文:https://www.a8q9.cn/en/article/your-coding-agent-needs-a-computer-it-can-break-d83def.html