Why sandboxing matters
If an agent can execute commands without asking, the strongest protection is often to limit the environment it can affect. Filesystem and network isolation can make mistakes cheaper to recover from.
Sandbox vs permission mode
A permission mode changes how approvals are handled. A sandbox changes the technical boundary around commands. Using both gives you two different controls instead of relying on one prompt flow.
Good sandbox candidates
- Large refactors and test-generation tasks.
- Repositories with untrusted dependencies or external content.
- Long-running agent tasks that would otherwise pause frequently.
- CI jobs that need reproducible, tightly scoped access.
What to keep outside the sandbox
Avoid mounting broad home directories, SSH keys, cloud configuration folders, production database credentials or unrelated repositories unless the task genuinely needs them.