r/ClaudeCode • u/yadvr • 2d ago
Tips & Workflows Sandboxing Claude Code with prompts off on a Mac: I compared Seatbelt, Apple's container, Lima, Docker Sandboxes and a VM
I wanted to run Claude Code and Codex unattended on a Mac and went through the options. A summary of what I found, all from each project's own docs:
- Claude Code's /sandbox (Seatbelt): wraps shell commands only. File tools, hooks and MCP servers run on the host, reads are allowed across the disk (~/.ssh included), and in bypass mode new hosts are allowed unless you set strictAllowlist. Fine for fewer prompts while you watch, not for walking away.
- Apple's container: a real VM per container, sees only what you mount. But your API key goes inside, and there's no egress filter.
- Lima 2.3+: --mount-none plus --sync gives you a diff to approve before changes come back. The default template mounts your home read-only, so change that. Keys sit in the VM.
- Docker Sandboxes (sbx): the strongest free option. A microVM, keys injected by a host proxy so they never enter the VM, and egress deny-by-default. Use --clone and trim the default allow list.
- A full VM: heaviest, but the only way to get isolated macOS/Xcode or Linux in the box.
The biggest thing I took away: the network is the real boundary. Whatever the agent can read, it can send anywhere it can reach, including your LAN (router admin, NAS, services on your Mac). Deny by default, keep it off the LAN, and enforce the rules outside the guest, not with iptables inside it.
Disclosure: At work we develop a virtualization software for macOS MacVisor, one of the VM options in the write-up, so weigh that section accordingly.
Full comparison with a table: https://scaleninja.com/blog/sandbox-ai-coding-agents-mac/
What are you using?


