Sandbox
- Standard term
A sandbox is a walled-off place to run an agent or program, with set limits on which files, accounts, network connections, and computer resources it reaches, so its effects stay contained.
The operating system or a virtual computer enforces the walls from underneath, so the program has no switch to turn them off, barring a flaw. Whatever is passed in through them, the program can use as fully as you could.
Where you’ll meet it
Your coding agent wants to run a script it found online that sorts and renames everything in your Downloads folder. You don't know who wrote it, and the same laptop holds your saved email and bank logins.
What to do
Many coding agents have a sandbox setting, so ask yours to run the script in it, on a copy of the folder, with no internet and none of your saved logins. Look through the sorted copy before the script goes near the original.
Easy to mix up
| Sandbox | Guardrail |
|---|---|
| No, only which file or site the request reaches | Yes, it screens the words or action against a rule |
Check yourself
You run an inbox-sorting agent in a sandbox that can't see your files and can reach no website except your email service. A message in your inbox tricks it into forwarding your bank statements to a stranger. How did they get out?
Go deeperContainers, virtual machines, and system sandboxes put the walls at different depths
A container shares the host computer's operating-system core, the kernel, so a kernel flaw can let code out. A virtual machine runs its own kernel on simulated hardware, which makes escape harder and startup slower. Coding agents often use the sandboxing built into macOS and Linux, which limits each command's folders and network addresses without a separate machine.
Network rules are hard to get right. An agent that installs software needs to reach package sites, and any site it can reach is also a place it could send your files. Tighter rules mean more requests for your approval, so setups often allow a short list of sites and ask about anything else.