Your first sandboxed session
A guided tour of one DefenseClaw sandbox session, from the launch banner through the activity feed to the end-of-session review.
Run Claude Code or Codex in skip-permissions mode on your project folder, with DefenseClaw checking every tool call and every site.
Before you start
- Setup is done on Linux or macOS, and
defenseclaw sandbox doctorends withready for sandboxes. - The daemon is running (
defenseclaw-gateway start). - You are in a project folder inside your home directory, not in the home directory itself.
The session, step by step
Start the run
cd ~/code/myapp
defenseclaw sandbox run claudecodex works the same way. The sandbox is named after the folder plus a random suffix, such as myapp-7f3a, unless you pass --name. Arguments after -- go to the harness. The first run builds the harness image if setup did not (a few minutes, about 3 GB).
Read the banner
Before the harness takes your terminal, DefenseClaw prints what the sandbox can see and use. This is the Linux banner:
Sandbox myapp-7f3a · Claude Code · skip-permissions ON · network: open + blocklist
Project ~/code/myapp → /work/myapp (live) undo point taken → `defenseclaw sandbox undo myapp-7f3a` restores it
Hidden .env certs/dev.pem (secret files appear empty inside; --unmask PATH to share)
Protected .git/hooks .git/config .git/config.worktree (read-only)
Model ANTHROPIC_API_KEY → api.anthropic.com only (the sandbox sees a placeholder)
Asks watch for them in another terminal: defenseclaw sandbox approvals --watch --sandbox myapp-7f3aOn a Mac the Project line ends in (copy) and says changes come back with defenseclaw sandbox pull myapp-7f3a --apply: the agent works on a copy. (live) means it edits your folder. Every banner line is explained in the sandbox CLI reference.



Watch the activity feed
In a second terminal:
defenseclaw sandbox activity -f14:02:11 myapp-7f3a ✓ registry.npmjs.org
14:02:20 myapp-7f3a ⚠ Bash allowed but flagged by DefenseClaw: C2-WEBHOOK-SITE (webhook.site (known exfil))
14:02:20 myapp-7f3a ✗ webhook.site (webhook catcher) → unblock: defenseclaw sandbox unblock webhook.site --sandbox myapp-7f3a✓ is a site reached, ✗ host a site blocked, ⚠ a tool call allowed with a finding, ✗ tool … blocked a tool call blocked by the hooks, and ? ask a request only you can approve. Model calls are not in the feed. The TUI and macOS app show the same feed. If a site was blocked wrongly, unblock it.

End the session
Exit the harness as usual. DefenseClaw summarizes the session and flags changed files that can run code on your machine.
Session ended · 57 tool calls (1 blocked) · 23 new sites contacted · 1 site blocked · 8 files changed (+212 −37)
⚠ Changed files that can run code on your machine: package.json, .envrc → review before running
Keep changes? [Y] keep [u] undo everything [d] show diff (then Enter)
Sandbox kept (stopped) → resume: defenseclaw sandbox connect myapp-7f3a delete: defenseclaw sandbox delete myapp-7f3aOn a Mac the question is Bring the changes back? [A] apply (3-way) [b] branch [p] patch file [s] skip. Review, undo or pull explains each answer. A session that changed no files ends without the question.



Resume or clean up
The sandbox is stopped and kept, with the agent's state inside it.
defenseclaw sandbox connect myapp-7f3a -- --continue
defenseclaw sandbox delete myapp-7f3a--rm on run deletes the sandbox at the end instead. --prompt "fix the failing tests" runs headless, and --detach runs it in the background (more ways to run).
Check it worked
defenseclaw sandbox status myapp-7f3aThe Hook events row shows the hooks reach DefenseClaw, and Egress counts sites contacted and blocked. If every tool call is blocked, see hooks cannot reach DefenseClaw.
Next
Sandboxes on macOS
Set up NVIDIA OpenShell sandboxes on an Apple-silicon Mac, where each sandbox is a MicroVM with its own Linux kernel, the agent works on a copy of your project, and you pull its changes back.
Complete sandbox guide
Recipes for a sandbox you already run, including how to unblock a site, answer an ask, review, undo or pull a session, change how a run starts, and fix sandbox problems.