agent-safehouse
AGENTS.md2.1k starsChanged 9 months agoApache-2.0View on GitHub
Agent Safehouse is a macOS sandbox wrapper for coding agents (Claude, Cursor, Aider, Gemini, etc.) built on sandbox-exec. Policy model is strict by default: start from (deny default), then add explicit allow rules via layered .sb profiles. Core sandbox wrapper is pure Bash + Sandbox Profile Language (.sb) and has no build step. Repo also includes a VitePress docs site and Cloudflare deploy tooling (pnpm + Wrangler). ./scripts/generate-dist.sh updates these deterministic outputs: - dist/safehouse.sh dist/ is for consumers: it provides…
Trending
Quiet since September.thin dataabout the whole repository
Who's talking about eugene1g/agent-safehouse
- sudosubin/agents.nix“agent-skills.github.eugene1g.agent-safehouse: init at 0.12.0”GitHub · Sep 27, 2026
- galaxyproject/foundry“Sandbox Support - agent-safehouse”GitHub · Sep 17, 2026
- carderne/pi-sandbox“allowUnixSockets: support glob/regex so the per-boot macOS ssh-agent socket can be allowlisted”GitHub · Sep 15, 2026
- vibeislandapp/vibe-island“[Bug] Vibe island doesn't recognize claude code terminal session when using safehouse sandbox”GitHub · Sep 1, 2026
- devicelab-dev/maestro-runner“[QUESTION] Support for sandboxes like Agent Safehouse”GitHub · Aug 7, 2026
The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 9
Talked about on GitHub (9 times).
On GitHub · 9
- Sep 27, 2026agent-skills.github.eugene1g.agent-safehouse: init at 0.12.0 — sudosubin/agents.nix0 reactions
- Sep 17, 2026Sandbox Support - agent-safehouse — galaxyproject/foundry0 reactions
- Sep 15, 2026allowUnixSockets: support glob/regex so the per-boot macOS ssh-agent socket can be allowlisted — carderne/pi-sandbox0 reactions · 2 comments
- Sep 1, 2026[Bug] Vibe island doesn't recognize claude code terminal session when using safehouse sandbox — vibeislandapp/vibe-island0 reactions · 2 comments
- Aug 7, 2026[QUESTION] Support for sandboxes like Agent Safehouse — devicelab-dev/maestro-runner0 reactions · 1 comment
4 more on GitHub
- Jul 13, 2026agent-safehouse: 0.10.1 -> 0.11.0 — NixOS/nixpkgs0 reactions
- May 3, 2026Tribute 2026-05-03: Agent Safehouse by @eugene1g — Talonsturgill/signalsniper0 reactions
- Mar 15, 2026agent-safehouse: init at 0.10.1 — NixOS/nixpkgs0 reactions · 2 comments
- Mar 15, 2026[News] 投稿 — Yuyz0112/koala-oss-app0 reactions · 2 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 11
Use rg for text search.
- Very specific: line 12
Use fd for file listing/find.
- Very specific: line 14
Do not hand-edit dist/*; edit bin/ and profiles/, then regenerate dist artifacts.
- Very specific: line 15
If you change any .sb file or policy assembly/runtime logic (bin/safehouse.sh, bin/lib/*.sh), run ./scripts/generate-dist.sh.
- Very specific: line 16
Run tests with ./tests/run.sh on macOS with sandbox-exec, outside any existing sandbox.
- Distinctive: line 17
If tests cannot run because the current session is already sandboxed, state that explicitly and continue with static validation.
- Very specific: line 76
Keep each .sb file standalone for its concern: include complete rules for that capability in the file, avoid splitting one feature across …
- Distinctive: line 89
If adding policy behavior, add/update Bats coverage for the public contract or security boundary that changed.
- Very specific: line 90
Keep .sb header comments and any #safehouse-test-id:*# markers used by ordering/structure assertions.
- Very specific: line 96
Keep /System/Volumes/Data/...
- Distinctive: line 97
Verify behavior with tests (when runnable) and regenerated dist artifacts before finalizing changes.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Safehouse: LLM Quick Reference
What This Project Is
Agent Safehouse is a macOS sandbox wrapper for coding agents (Claude, Cursor, Aider, Gemini, etc.) built on sandbox-exec.
Policy model is strict by default: start from (deny default), then add explicit allow rules via layered .sb profiles.
Core sandbox wrapper is pure Bash + Sandbox Profile Language (.sb) and has no build step. Repo also includes a VitePress docs site and Cloudflare deploy tooling (pnpm + Wrangler).
Fast Working Rules
- Use
rgfor text search. - Use
fdfor file listing/find. - Make least-privilege policy edits; avoid broad
subpathgrants unless required. - Do not hand-edit
dist/*; editbin/andprofiles/, then regenerate dist artifacts. - If you change any
.sbfile or policy assembly/runtime logic (bin/safehouse.sh,bin/lib/*.sh), run./scripts/generate-dist.sh. - Run tests with
./tests/run.shon macOS withsandbox-exec, outside any existing sandbox. Use./tests/run.sh e2efor the tmux-driven startup/prompt-roundtrip suite for agent TUIs. - If tests cannot run because the current session is already sandboxed, state that explicitly and continue with static validation.
Core Commands
# Generate policy only (prints temp policy path)
./bin/safehouse.sh [--add-dirs-ro=...] [--add-dirs=...] [--enable=...] [--append-profile=...]
# Run command in sandbox
./bin/safehouse.sh [policy opts] -- <command> [args...]
./bin/safehouse.sh --stdout
# Explain effective workdir/grants/profile selection (debugging)
./bin/safehouse.sh --explain --stdout
# Trust and load <workdir>/.safehouse config (disabled by default)
./bin/safehouse.sh --trust-workdir-config --stdout
# Validate behavior
./tests/run.sh
./tests/run.sh e2e
# Regenerate committed dist artifacts
./scripts/generate-dist.sh./scripts/generate-dist.sh updates these deterministic outputs:
dist/safehouse.sh
Dist Purpose
dist/ is for consumers: it provides ready-to-run packaged artifacts, especially dist/safehouse.sh, a single executable containing the assembled policy + runtime shell logic.
Authoring source of truth is bin/ and profiles/; make functional changes there, then regenerate dist/.
Agents should usually avoid loading dist/ files into context unless validating generated distribution output or debugging packaging/compression regressions.
Policy Assembly Order (Critical)
Policy concatenation order in bin/safehouse.sh/bin/lib/*.sh:
profiles/00-base.sbprofiles/10-system-runtime.sbprofiles/20-network.sbprofiles/30-toolchains/*.sbprofiles/40-shared/*.sbprofiles/50-integrations-core/*.sb(container-runtime-default-deny,git,scm-clis,ssh-agent-default-deny,worktreesalways on)profiles/55-integrations-optional/*.sb(--enable, withelectronimplyingmacos-gui; keychain injected selectively)profiles/60-agents/*.sbprofiles/65-apps/*.sb- CLI path grants:
--add-dirs-rothen--add-dirs - Workdir grant (omitted if
--workdirexplicitly empty) --append-profileoverlays last
Later rules win. Check ordering first when behavior is unexpected.
.sb Authoring Rules
- Profiles are authored as modular sections by stage prefix (
00,10,20,30,40,50,55,60,65). - Assembly is deterministic: stage order is fixed, and files within each stage directory are concatenated in lexicographic order (
find ... | sort). - Declare dependency metadata with
$$require=path/to/profile.sb[,path/to/other.sb]$$only when you need implicit optional integration injection. $$require=...$$is machine-read by policy assembly;;; Requires: ...comments are human-facing documentation only.- Keep each
.sbfile standalone for its concern: include complete rules for that capability in the file, avoid splitting one feature across many files without an explicit dependency. - New profile checklist: add standard header (
Category/description/Source), add tests intests/policy/integrations/or the relevant topic folder, and run./scripts/generate-dist.sh.
Important Internals
00-base.sbincludesHOME_DIRplaceholder__SAFEHOUSE_REPLACE_ME_WITH_ABSOLUTE_HOME_DIR__; replaced at assembly time inbin/lib/policy/render.sh.- Ancestor directory
literalread grants (up to/) are intentionally generated byemit_path_ancestor_literals()for directory traversal compatibility. .sbmatcher semantics:literal(exact),subpath(recursive),prefix(starts-with),regex.
Test/CI Signals
- Tests live under
tests/policy/,tests/surface/, andtests/e2e/, with shared helpers intests/test_helper.bash. ./tests/run.shrunspolicy + surfaceby default,./tests/run.sh e2eruns the tmux-driven startup/prompt-roundtrip suite for agent TUIs, and./tests/run.sh allruns every suite.- If adding policy behavior, add/update Bats coverage for the public contract or security boundary that changed.
- Keep
.sbheader comments and any#safehouse-test-id:*#markers used by ordering/structure assertions. - CI runs macOS tests and auto-regenerates/commits dist artifacts on relevant changes.
Mindful Of
--append-profileis the final override layer; deny rules there take precedence.- Keep
/System/Volumes/Data/...aliases only when a concrete integration requires them. - Verify behavior with tests (when runnable) and regenerated dist artifacts before finalizing changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

