Created
July 10, 2026 00:10
-
-
Save eas4ai/b4459b1811f332625ded0f4e4f890c3b to your computer and use it in GitHub Desktop.
Sandbox Mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sandbox() { | |
| local name="${1:?Usage: sandbox <name>}" | |
| local workspace="$HOME/workspace/$name" | |
| mkdir -p "$workspace" | |
| # Note - sandbox-exec is deprecated on Macs | |
| sandbox-exec -p " | |
| (version 1) | |
| (deny default) | |
| (allow process-exec) | |
| (allow process-fork) | |
| (allow sysctl-read) | |
| (allow mach-lookup) | |
| (allow signal) | |
| (allow file-read*) | |
| (allow file-write* (subpath \"$workspace\")) | |
| (allow file-write* (subpath \"/private/tmp\")) | |
| (allow file-write* (subpath \"/dev/tty\")) | |
| (allow file-write* (subpath \"/dev/null\")) | |
| " bash --rcfile "$HOME/.bashrc" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment