~projectsagent-sandbox
isolate

Agent Sandbox

Think of it as: Local sandboxing for AI coding agents

Run AI coding agents in a restricted local sandbox.

Wraps an agent command in a temporary copy of your repo. Blocks secret paths, restricts commands, captures the final diff, and only applies it once you approve.

preview · macOSMITlocal-onlyno telemetry
quickstart · agent-sandbox
1# install (macOS today, Linux on the roadmap)
2npm install -g @agentopssec/agent-sandbox
3
4# run an agent in a sandboxed copy
5agent-sandbox run -- codex "fix the failing tests"
6
7# read-only review mode
8agent-sandbox run --read-only -- gemini "review this repo"
9
10# inspect and apply
11agent-sandbox diff latest
12agent-sandbox apply latest
01

Why this exists

AI coding agents run on your developer machine. By default they can read home directories, secrets, SSH keys, cloud credentials, and unrelated projects.

Agent Sandbox wraps an agent command in a temporary copy of your repo. The original working tree is untouched. Secret paths are blocked. The final diff only lands when you approve it.

macOS-native today. Linux is on the roadmap.

  • Can the agent work in a temporary copy of the repo?
  • Are secret paths (.env, ~/.ssh, ~/.aws) blocked?
  • Are destructive shell commands blocked?
  • Can I review the diff before applying it?
  • Is sandbox state cleaned up after the run?
02

Quickstart

One command. No account. No telemetry.

quickstart · agent-sandbox
1# install (macOS today, Linux on the roadmap)
2npm install -g @agentopssec/agent-sandbox
3
4# run an agent in a sandboxed copy
5agent-sandbox run -- codex "fix the failing tests"
6
7# read-only review mode
8agent-sandbox run --read-only -- gemini "review this repo"
9
10# inspect and apply
11agent-sandbox diff latest
12agent-sandbox apply latest
03

Sandbox policy

Tight defaults — only allow what your project actually needs.

agent-sandbox.policy.json
1{
2 "filesystem": {
3 "mode": "project-only",
4 "blockedPaths": [".env", ".env.local", "~/.ssh", "~/.aws", "~/.config"]
5 },
6 "network": { "enabled": false },
7 "shell": {
8 "allowedCommands": ["npm test", "npm run build", "git diff"],
9 "blockedCommands": ["rm -rf", "curl", "scp", "ssh"]
10 }
11}
04

Run summary

Output after a sandboxed agent finishes — safe to review, safe to discard.

Agent Sandbox Run
Agent: codex
Sandbox: /tmp/agent-sandbox/run_001
Result: Completed
Changes:
- 3 files modified
- 44 insertions
- 18 deletions
Blocked:
- read .env (blocked path)
- curl https://… (blocked command)
Next:
agent-sandbox diff latest
agent-sandbox apply latest
05

CLI reference

run -- <agent> <prompt>Run agent in a temp copy of the repo.
run --read-onlyAllow file reads, block all writes.
run --no-networkDisable network egress for the run.
allow-command <cmd>Add a shell command to the allowlist.
block-path <path>Block a file or directory path.
diff latestShow the latest sandbox diff.
apply latestApply the latest diff back to the project.
cleanClear old sandbox runs.