AID-23Required
Run agents in a sandbox
Run coding agents in an isolated environment, such as a container, a virtual machine or the agent's own sandbox mode.
How to do it
Limit the agent to the project folder. Block network access by default, as Allow agent network traffic only to listed hosts says. Many agents ship a sandbox mode, so turn it on. Examples are /sandbox in Claude Code and --sandbox workspace-write in Codex. Then check its defaults, because some still let commands read keys in your home folder, and some cover only shell commands.
How to check
From an agent session, try to read a file outside the project, such as ~/.ssh/id_ed25519, and reach an unlisted host. Both fail.
Sources
Related rules
- AID-13 Block dangerous actions with hooks in AI-assisted development
- AID-73 Allow agent network traffic only to listed hosts in AI-assisted development
- AID-63 Give every parallel agent its own working copy in AI-assisted development
- APS-91 Run code the model writes in a sandbox in Application security
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/ai-assisted-development/isolation-and-credentials/sandbox">Agent Wranglers AI-assisted development playbook</a>. In code you write, add a comment next to it with the same link.