Agent Safehouse is a macOS sandbox wrapper for LLM coding agents built on sandbox-exec. It uses a deny-first security model with composable policy profiles to give agents access only to the files and integrations they need.It’s designed as a practical hardening layer for daily agent workflows, not a perfect security boundary against determined attackers.
Which agents does it support?
Agent Safehouse supports major coding agents including:
Claude Code
Cursor (agent mode)
Aider
Codex
Amp
Gemini CLI
Goose
Kilo
Pi
And more
The sandbox automatically detects agents and applies appropriate profiles. You can also use --enable=all-agents to load all agent profiles at once.
Does it work on Linux or Windows?
No, Agent Safehouse is macOS-only. It uses sandbox-exec, which is specific to macOS.For cross-platform sandboxing, see Anthropic’s sandbox-runtime.
Is it safe to use with sensitive projects?
Agent Safehouse reduces risk by limiting agent access, but it’s not a perfect security boundary. Consider it a hardening layer.It helps with:
Accidental file access outside project scope
Limiting agent access to credentials and sensitive paths
Reducing network exposure
It doesn’t protect against:
Determined attackers with sandbox escape exploits
Malicious agents actively trying to bypass restrictions
Vulnerabilities in the agent software itself
For sensitive work, combine sandboxing with other security practices: code review, separate environments, and minimal credential access.
What's the performance impact?
Minimal. sandbox-exec is lightweight and built into macOS. The overhead is primarily from policy evaluation on file access, which is negligible for typical agent workflows.
These integrations are opt-in. Enable them with --enable:
# Docker socket accesssafehouse --enable=docker -- claude --dangerously-skip-permissions# Kubernetes config/cachesafehouse --enable=kubectl -- claude --dangerously-skip-permissions# Cloud credentials (AWS, GCP, Azure)safehouse --enable=cloud-credentials -- claude --dangerously-skip-permissions# Multiple integrationssafehouse --enable=docker,kubectl,cloud-credentials -- claude --dangerously-skip-permissions
How do I grant access to additional directories?
Use --add-dirs-ro (read-only) or --add-dirs (read/write):
# Read-only access to reference repossafehouse --add-dirs-ro=/repos/shared-lib:/repos/docs -- claude --dangerously-skip-permissions# Writable access to scratch spacesafehouse --add-dirs=/tmp/scratch -- claude --dangerously-skip-permissions# Single file accesssafehouse --add-dirs-ro=~/.gitignore -- claude --dangerously-skip-permissions
Multiple paths are colon-separated (:).
Can I use a config file?
Yes, create a .safehouse file in your project directory:
safehouse --trust-workdir-config -- claude --dangerously-skip-permissions
Only use --trust-workdir-config in projects you control. Config files can escalate privileges.
How do I pass environment variables?
Safehouse uses a sanitized environment by default. Pass variables explicitly:
# Specific variablessafehouse --env-pass=OPENAI_API_KEY,ANTHROPIC_API_KEY -- claude --dangerously-skip-permissions# All environmentsafehouse --env -- claude --dangerously-skip-permissions# From filesafehouse --env=./agent.env -- claude --dangerously-skip-permissions
For Electron apps, use --enable=electron and launch with --no-sandbox:
# Claude Desktopsafehouse --enable=electron -- /Applications/Claude.app/Contents/MacOS/Claude --no-sandbox# VS Codesafehouse --enable=electron -- "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" --no-sandbox
For VS Code with multiple agent extensions:
safehouse --workdir=~/projects --enable=electron,all-agents,wide-read -- "/Applications/Visual Studio Code.app/Contents/MacOS/Electron" --no-sandbox
Why do I need --no-sandbox?
Electron apps have their own built-in Chromium sandbox. When you run sandbox-exec around Electron, you create nested sandboxes, which causes errors.The --no-sandbox flag disables Electron’s internal sandbox, allowing sandbox-exec to be the only sandbox layer.
This keeps machine-specific settings out of shared project configs.
How do I debug what's in the policy?
Inspect the assembled policy:
# Print full policysafehouse --stdout# Explain workdir and grantssafehouse --explain --stdout# Save policy for inspectionsafehouse --stdout > policy.sb
Can I use this with CI/CD?
Yes, but consider whether sandboxing adds value in CI environments:Useful for: