Shell functions provide a convenient way to set machine-specific defaults and create shorthand commands for running agents with Safehouse.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eugene1g/agent-safehouse/llms.txt
Use this file to discover all available pages before exploring further.
Why Use Shell Wrappers?
If you work across multiple projects with shared dependencies, caches, or team folders in machine-specific locations, you’ll want to keep those settings out of project config files. Shell wrappers let you:- Define machine-local defaults once
- Create convenient shortcuts for common workflows
- Keep machine-specific paths out of shared repositories
- Reuse configurations across multiple agents and tools
Basic Pattern
Add this to your shell configuration file (~/.zshrc, ~/.bashrc, or equivalent):
~/.zshrc
Advanced Pattern with Append Profile
For machine-local policy exceptions that can’t be expressed with--add-dirs alone, use --append-profile:
Create a local overrides profile
Create a Sandbox Profile file for machine-specific rules:
~/.config/agent-safehouse/local-overrides.sb
Use
--add-dirs-ro/--add-dirs for normal folder access. Reserve --append-profile for machine-local policy exceptions or final deny/allow overrides.Complete Example
Here’s a full-featured setup with multiple shortcuts:~/.zshrc
Agent shortcuts
Workflow wrappers
Review mode
Per-Project Wrappers
For projects with unique requirements, create project-specific scripts:~/my-project/scripts/safe-test.sh
Environment Variable Patterns
Use environment variables for settings that apply to all Safehouse invocations:~/.zshrc
safehouse directly without wrapper functions.
App Launchers
You can use shell functions to launch GUI apps through Safehouse:~/.zshrc
Debugging Your Setup
Use--explain to verify your wrapper configuration:
- All path grants (from shell function and environment)
- Loaded agent profiles
- Optional integrations
- Appended profile files
Tips and Best Practices
Keep It DRY
Define common options once in a base
safe() function. Derive agent-specific functions from it.Machine-Local Only
Put shell functions in
~/.zshrc or ~/.bashrc, not in project repositories. These are machine-specific.Use Append Profiles
For complex machine-local rules, use
--append-profile with a .sb file instead of long CLI arguments.Document Assumptions
Add comments in your shell config explaining what paths like
$SHARED_LIBS or $TEAM_RESOURCES are for.Related Resources
- CLI Options Reference - Full documentation of all flags
- Workdir Config - Per-project
.safehousefiles - Basic Usage - Common workflows and patterns