/usr/bin/log (not shell-shadowed log) to capture and analyze these events.
Live Denial Monitoring
Start denial stream
Open a terminal and run the live denial filter:This shows all sandbox denial events in real-time as they occur.
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:| Denial Type | Example Denial | Allow Rule Pattern |
|---|---|---|
| File operations | deny(1234) file-read* /path/to/file | (allow file-read* (literal "/path/to/file")) |
| Sysctl read | deny(1234) sysctl-read kern.hostname | (allow sysctl-read (sysctl-name "kern.hostname")) |
| Mach lookup | deny(1234) mach-lookup com.apple.cfprefsd.daemon | (allow mach-lookup (global-name "com.apple.cfprefsd.daemon")) |
| Network | deny(1234) network-outbound localhost:8080 | (allow network-outbound (local ip "localhost:*")) |
Building a Profile from Scratch
If you’re authoring a new integration profile:Run with log stream active
Start the denial monitor in one terminal, then run your sandboxed workflow in another.
Map each denial to a rule
For each
deny(...) event, add the minimum necessary allow rule to your profile.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