Any CLI Agent¶
rampart wrap works with any agent that reads the $SHELL environment variable. This covers most CLI-based AI agents.
Setup¶
Examples¶
rampart wrap -- aider
rampart wrap -- opencode
rampart wrap -- python my_agent.py
rampart wrap -- node agent.js
How It Works¶
- Rampart starts an embedded policy server
- Generates a shell shim that checks every command against the policy
- Sets
$SHELLto point at the shim - Execs your agent as a child process
Every time the agent spawns a shell command, the shim intercepts it, checks the preflight API, and either allows or blocks execution.
Monitor Mode¶
Log everything, block nothing — useful for understanding what your agent does before writing policies:
Review the log, then write policies:
Custom Policy¶
Platform Support¶
rampart wrap requires Linux or macOS. For Windows, use the HTTP API or MCP proxy.
When Wrap Doesn't Work¶
If your agent doesn't respect $SHELL, use LD_PRELOAD instead:
This intercepts exec syscalls directly — works with any dynamically-linked process regardless of $SHELL support.