/usr/bin/log (not shell-shadowed log) to capture and analyze these events.
Live Denial Monitoring
1
Start denial stream
Open a terminal and run the live denial filter:This shows all sandbox denial events in real-time as they occur.
2
Run your sandboxed command
In a separate terminal, execute the safehouse-wrapped command:
3
Analyze denial output
Watch the log stream for denied operations. Each denial line follows this format:
Using the —explain Flag
The--explain flag shows effective workdir, grants, and profile selection without running a command:
Use
--explain to verify which directories and integrations are active before running your command.Log Stream Variants
Filter by process pattern
Kernel-level denials
Recent history
Filter common noise
Suppressing DTrace Noise
DTrace helper denials are usually harmless system noise. Suppress them with:Converting Denials to Allow Rules
When you identify a legitimate denial, map it to the appropriate allow rule:Building a Profile from Scratch
If you’re authoring a new integration profile:1
Start with base policy
Create a minimal
.sb file:2
Run with log stream active
Start the denial monitor in one terminal, then run your sandboxed workflow in another.
3
Map each denial to a rule
For each
deny(...) event, add the minimum necessary allow rule to your profile.4
Test full workflows
Exercise complete toolchain workflows (
git, npm, cargo, etc.) since child processes inherit the sandbox policy.Correlating with Filesystem Activity
For deeper filesystem behavior analysis, combine sandbox logs withfs_usage:
<pid> with the process ID from the denial log.
Common Issues
Nested sandbox failure
Symptom:
sandbox-exec cannot nest errorCause: Already running inside a sandboxFix: Run from an unsandboxed terminal sessionGit operations blocked
Symptom:
git commands fail with permission errorsCause: Missing workdir grant or git integration not enabledFix: Verify workdir with --explain, ensure git integration is activeNetwork requests denied
Symptom: HTTP requests fail silentlyCause: Network profile not includedFix: Network is enabled by default; check for custom
--append-profile overridesToolchain not found
Symptom:
node, python, cargo not executableCause: Toolchain binary not in allowed pathsFix: Verify toolchain profile includes your installation path (see profiles/30-toolchains/)Next Steps
Testing
Validate policy behavior with the test suite
Contributing
Submit new profiles or fixes to the project