Agent Wranglers

Safety and permissions Required

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, and allow only the hosts it needs, such as the package registry. 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.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers ai development playbook: https://agentwranglers.se/playbook/ai-assisted-development/safety-and-permissions/sandbox.