Skip to main content
This page documents every CLI option supported by Agent Safehouse.

Usage Syntax

Policy Scope Options

These options control what permissions are granted inside the sandbox.

—enable

string
Enable optional integration features (comma-separated).Syntax: --enable FEATURES or --enable=FEATURESSupported values:
  • docker - Docker socket and CLI access
  • kubectl - Kubernetes client access
  • macos-gui - macOS GUI automation (AXUIElement)
  • electron - Electron app requirements (implies macos-gui)
  • chromium-headless - Headless browser support
  • chromium-full - Full Chromium/Chrome (implies chromium-headless)
  • ssh - SSH client access
  • spotlight - macOS Spotlight search
  • cleanshot - CleanShot media access
  • clipboard - System clipboard access
  • 1password - 1Password CLI integration
  • cloud-credentials - Cloud provider credential access (AWS, GCP, Azure)
  • agent-browser - Browser automation for agents (implies chromium-headless)
  • browser-native-messaging - Browser native messaging protocol
  • shell-init - Read shell startup files (.zshrc, .bashrc, etc.)
  • process-control - Host process enumeration and signaling
  • lldb - LLDB debugger with task-port access (implies process-control)
  • all-agents - Load all agent profiles from 60-agents/
  • all-apps - Load all app profiles from 65-apps/
  • wide-read - Grant broad read-only access across / (use cautiously)
Examples:
Security note: Features like wide-read, process-control, and lldb grant significant system access. Only enable them when necessary.

—add-dirs-ro

string
Grant read-only access to additional file paths (colon-separated).Syntax: --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:
Environment equivalent: SAFEHOUSE_ADD_DIRS_RO

—add-dirs

string
Grant read/write access to additional file paths (colon-separated).Syntax: --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:
Environment equivalent: SAFEHOUSE_ADD_DIRS

—workdir

string
Set the main working directory with read/write access.Syntax: --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:
Environment equivalent: SAFEHOUSE_WORKDIR

—trust-workdir-config

boolean
Trust and load the .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:
Environment equivalent: SAFEHOUSE_TRUST_WORKDIR_CONFIG
Only enable --trust-workdir-config for projects you trust. The config file can grant additional filesystem access, including paths outside the project directory.

—append-profile

string
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:
Use --append-profile for machine-specific overrides or final deny rules. See Shell Functions for a complete pattern.

Environment Options

These options control which environment variables are passed to the sandboxed command.

—env

flag
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 grants access to all environment variables, including sensitive data like AWS_SECRET_ACCESS_KEY, API tokens, and session credentials. Use only when necessary.

—env=FILE

string
Load environment variables from a file on top of sanitized defaults.Syntax: --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:
File format:

—env-pass

string
Pass specific environment variables from the host (comma-separated).Syntax: --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:
Environment equivalent: SAFEHOUSE_ENV_PASS

Output Options

These options control how Safehouse outputs the policy.

—output

string
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

flag
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 --output is also specified
Examples:

—explain

flag
Print detailed policy generation summary to stderr.Syntax: --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:
Sample output:

General Options

-h, —help

flag
Show usage information and exit.Syntax: -h or --helpExample:

Environment Variables

These environment variables provide an alternative way to set options:
string
Colon-separated read-only paths (same format as --add-dirs-ro).Example:
string
Colon-separated read/write paths (same format as --add-dirs).Example:
string
Override the working directory (same as --workdir).Example:
string
Trust and load .safehouse config file (same as --trust-workdir-config).Accepted values: 1, 0, true, false, yes, no, on, offExample:
string
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:
  1. CLI flags (highest priority)
  2. Environment variables
  3. Config file (.safehouse if trusted)
  4. Defaults (lowest priority)
Example:

Path Resolution

All path options support tilde expansion:
Paths are normalized to absolute paths before being included in the policy.