Skip to main content
This guide helps you diagnose and fix common Agent Safehouse issues.

Common Issues

Symptoms: Agent reports permission errors or can’t see project files.Solution: Verify workdir detection:
If workdir is incorrect:
If you need additional directories:
Symptoms: forbidden-sandbox-reinit or sandbox initialization failed: Operation not permitted.Cause: Electron apps have their own sandbox that conflicts with sandbox-exec.Solution: Launch with --no-sandbox flag:
Symptoms: git commands fail with permission errors.Solution: Git support is enabled by default. Check if you need SSH access:
SSH metadata (~/.ssh/config, ~/.ssh/known_hosts) is readable by default. Private keys require --enable=ssh.
Symptoms: Agent can’t find API keys or environment configuration.Solution: Safehouse uses a sanitized environment by default.Pass specific variables:
Or inherit full environment:
Or load from file:
Symptoms: docker commands return permission errors.Solution: Docker socket access is opt-in:
Symptoms: Agent can’t read from or write to clipboard.Solution: Clipboard access is opt-in:

Debugging Sandbox Denials

Use /usr/bin/log (full path) for denial analysis, not shell-aliased log commands.

Live Stream Denials

Watch sandbox denials in real-time:

Filter by Agent or Process

Filter denials for a specific process:

Kernel-Level Denials

Capture additional low-level events:

Recent History

View recent sandbox events:

Filter Common Noise

Suppress frequent harmless denials:
Suppress dtrace noise:

Correlate with Filesystem Activity

Track filesystem operations:

Converting Denials to Allow Rules

Denial log format: deny(<pid>) <operation> <path-or-name>

File Operations

Denial: deny(1234) file-read* /path/to/fileAllow rule:

Sysctl Read

Denial: deny(1234) sysctl-read kern.versionAllow rule:

Mach Lookup

Denial: deny(1234) mach-lookup com.apple.serviceAllow rule:

Network

Denial: deny(1234) network-outbound 127.0.0.1:8080Allow rule:

Building a Profile from Scratch

If you need to create a custom profile:
1

Start with base policy

Create a minimal deny-all profile:
2

Run with log stream active

In one terminal, start the log stream:
In another, run your command:
3

Map denials to allow rules

For each deny(...) event, add the minimum required allow rule to your profile.
4

Test full workflows

Exercise complete toolchain workflows (git, npm, cargo, etc.) since child processes inherit the sandbox policy.
See the Prior Art page for profile examples and language reference.

Policy Inspection

Verify effective policy and grants:

Test Validation

Run Agent Safehouse’s test suite (macOS only, outside existing sandbox):
Tests must run outside any existing sandboxed session. If you’re already sandboxed, tests will fail.

Getting Help

FAQ

Check frequently asked questions.

GitHub Issues

Report bugs or ask questions.