# Sandbox

> An isolated environment the agent runs inside — container, VM, or restricted shell. Limits the blast radius of agent actions.

An isolated [environment](https://ai9k.vercel.app/en/environment) the [agent](https://ai9k.vercel.app/en/agent) runs inside — a container, VM, ephemeral [filesystem](https://ai9k.vercel.app/en/filesystem), or restricted-permission shell. Limits the blast radius of agent actions: even if the agent runs destructive commands or fetches something malicious, the damage is contained. The safety substrate that makes [AFK](https://ai9k.vercel.app/en/afk) practical.

The sandbox and the [permission mode](https://ai9k.vercel.app/en/permission-mode) solve the same problem from opposite ends. Permissions ask before an action runs; a sandbox limits what the action can reach if it does run. Permissions need you running [in the loop](https://ai9k.vercel.app/en/human-in-the-loop) — every prompt is an interruption — and a session that asks constantly is barely autonomous. A sandbox spends infrastructure instead of attention: the stronger the isolation, the fewer questions need asking.

Isolation comes in grades:

| Grade            | What it is                                                 | What it contains                           |
| ---------------- | ---------------------------------------------------------- | ------------------------------------------ |
| Restricted shell | OS-level confinement around each command                   | Writes outside the project, network access |
| Container        | Fresh filesystem, no credentials mounted, discarded after  | Anything the agent does to its own machine |
| VM / cloud       | A separate machine entirely, often provided by the harness | Everything, including kernel-level escapes |

What no sandbox contains: actions that leave it legitimately. An agent with your git credentials can push; one with network access can call production APIs. Decide what crosses the boundary before deciding how thick to make it.

**Usage**

"I want to let it run [bypass-permissions](https://ai9k.vercel.app/en/agent-mode) overnight but I'm not ready for that."

"Put it in a sandbox — fresh container, no credentials mounted, no network out. Worst case it nukes its own filesystem and you discard the container."

---

- Section 3 — Tools & Environment · Term 34 of 72
- Page: https://ai9k.vercel.app/en/sandbox
- Learn step by step: https://ai9k.vercel.app/en/learn#/sandbox
- On the map: https://ai9k.vercel.app/en?term=sandbox
- JSON: https://ai9k.vercel.app/data/terms/sandbox.json
- Mentioned in: [Environment](https://ai9k.vercel.app/en/environment.md), [Filesystem](https://ai9k.vercel.app/en/filesystem.md), [Permission request](https://ai9k.vercel.app/en/permission-request.md), [Permission mode](https://ai9k.vercel.app/en/permission-mode.md), [Agent mode](https://ai9k.vercel.app/en/agent-mode.md), [Home Repo](https://ai9k.vercel.app/en/home-repo.md), [AFK](https://ai9k.vercel.app/en/afk.md), [Automated check](https://ai9k.vercel.app/en/automated-check.md)
- Previous: [Agent mode](https://ai9k.vercel.app/en/agent-mode.md)
- Next: [Sycophancy](https://ai9k.vercel.app/en/sycophancy.md)

Every term page has a markdown copy: add .md to its address.
