Usage Syntax
Policy Scope Options
These options control what permissions are granted inside the sandbox.—enable
Enable optional integration features (comma-separated).Syntax:
--enable FEATURES or --enable=FEATURESSupported values:docker- Docker socket and CLI accesskubectl- Kubernetes client accessmacos-gui- macOS GUI automation (AXUIElement)electron- Electron app requirements (impliesmacos-gui)chromium-headless- Headless browser supportchromium-full- Full Chromium/Chrome (implieschromium-headless)ssh- SSH client accessspotlight- macOS Spotlight searchcleanshot- CleanShot media accessclipboard- System clipboard access1password- 1Password CLI integrationcloud-credentials- Cloud provider credential access (AWS, GCP, Azure)agent-browser- Browser automation for agents (implieschromium-headless)browser-native-messaging- Browser native messaging protocolshell-init- Read shell startup files (.zshrc, .bashrc, etc.)process-control- Host process enumeration and signalinglldb- LLDB debugger with task-port access (impliesprocess-control)all-agents- Load all agent profiles from60-agents/all-apps- Load all app profiles from65-apps/wide-read- Grant broad read-only access across/(use cautiously)
—add-dirs-ro
Grant read-only access to additional file paths (colon-separated).Syntax: Environment equivalent:
--add-dirs-ro PATHS or --add-dirs-ro=PATHSDefault: NonePaths can be files or directories. For directories, access is granted recursively. Multiple paths are separated by colons (:).Examples:SAFEHOUSE_ADD_DIRS_RO—add-dirs
Grant read/write access to additional file paths (colon-separated).Syntax: Environment equivalent:
--add-dirs PATHS or --add-dirs=PATHSDefault: NonePaths can be files or directories. For directories, access is granted recursively. Multiple paths are separated by colons (:).Examples:SAFEHOUSE_ADD_DIRS—workdir
Set the main working directory with read/write access.Syntax: Environment equivalent:
--workdir DIR or --workdir=DIRDefault: Current working directory (pwd)The workdir receives automatic read/write grants and is where the .safehouse config file is searched for (if trusted).Special value: Empty string (--workdir="") disables automatic workdir grants entirely.Examples:SAFEHOUSE_WORKDIR—trust-workdir-config
Trust and load the Environment equivalent:
.safehouse config file from the workdir.Syntax: --trust-workdir-config or --trust-workdir-config=BOOLDefault: false (disabled)Accepted values: 1, 0, true, false, yes, no, on, offWhen enabled, Safehouse reads <workdir>/.safehouse and loads additional path grants specified in that file.Examples:SAFEHOUSE_TRUST_WORKDIR_CONFIG—append-profile
Append an additional sandbox profile file after generated rules.Syntax:
--append-profile PATH or --append-profile=PATHDefault: NoneThis option is repeatable. Files are appended in the order specified. Profiles appended here have final say and can override earlier rules.Paths starting with ~ are expanded to your home directory.Examples:Environment Options
These options control which environment variables are passed to the sandboxed command.—env
Execute the wrapped command with full inherited environment variables.Syntax:
--env (flag only, no value)Default: Sanitized environment with safe defaultsWhen specified, all environment variables from the host are passed through to the sandboxed command. This includes secrets, tokens, and credentials.Incompatible with: --env=FILE, --env-passExample:—env=FILE
Load environment variables from a file on top of sanitized defaults.Syntax: File format:
--env=FILEDefault: Sanitized environment onlyThe file is sourced by /bin/bash (not parsed as dotenv). Use shell syntax with export statements. File variables override sanitized defaults.Paths starting with ~ are expanded to your home directory.Incompatible with: --env (full pass-through)Compatible with: --env-passExample:—env-pass
Pass specific environment variables from the host (comma-separated).Syntax: Environment equivalent:
--env-pass NAMES or --env-pass=NAMESDefault: None (only sanitized defaults)This option is repeatable. Variable names are deduplicated. Specified variables are added on top of sanitized defaults.Incompatible with: --env (full pass-through)Compatible with: --env=FILE (default mode)Examples:SAFEHOUSE_ENV_PASSOutput Options
These options control how Safehouse outputs the policy.—output
Write the policy to a specific file path.Syntax:
--output PATH or --output=PATHDefault: Temporary file (auto-deleted after execution)When specified, the policy file is preserved after the command executes instead of being automatically deleted.Examples:—stdout
Print policy text to stdout instead of executing a command.Syntax:
--stdout (flag only)Default: Execute mode or print file pathWhen --stdout is specified:- The policy is generated and printed to stdout
- If a command is provided, it is not executed
- The policy file is deleted unless
--outputis also specified
—explain
Print detailed policy generation summary to stderr.Syntax: Sample output:
--explain (flag only)Default: Silent (no explanation output)Shows effective workdir, all path grants, loaded profiles, optional integrations, and config file status. Useful for debugging permission issues.Examples:General Options
-h, —help
Show usage information and exit.Syntax:
-h or --helpExample:Environment Variables
These environment variables provide an alternative way to set options:Colon-separated read-only paths (same format as
--add-dirs-ro).Example:Colon-separated read/write paths (same format as
--add-dirs).Example:Override the working directory (same as
--workdir).Example:Trust and load
.safehouse config file (same as --trust-workdir-config).Accepted values: 1, 0, true, false, yes, no, on, offExample:Comma-separated env var names to pass through (same format as
--env-pass).Example:Option Precedence
When the same setting is specified in multiple ways, the precedence order is:- CLI flags (highest priority)
- Environment variables
- Config file (
.safehouseif trusted) - Defaults (lowest priority)