wrap command protects any agent that reads the $SHELL environment variable. Works with Aider, OpenCode, Continue, Cline, and custom agents — no native integration required.
Quick Setup
How It Works
The shim intercepts all-c "command" invocations and checks the policy before executing.
What Gets Protected
Any agent that spawns shell commands via$SHELL:
Command-Line Options
- Enforce Mode
- Monitor Mode
- Custom Policy
- Custom Audit Dir
Default. Block denied commands:Denied commands return exit code 126 with branded error:
Example Session
Wrapping Aider:Policy Configuration
Create policies for wrapped agents:~/.rampart/policies/custom.yaml
Shell Shim Details
The wrapper creates a temporary shell script like:PATH Wrappers
The wrapper also creates temporary shell wrappers for/bin/bash, /bin/zsh, and /bin/sh in a temp directory and prepends it to $PATH. This catches agents that hardcode shell paths instead of reading $SHELL.
Monitoring
Summary on Exit
The wrapper prints stats when the agent exits:Audit Trail
Events are written to~/.rampart/audit/:
Supported Agents
- Aider
- OpenCode
- Continue (VS Code)
- Cline
- Custom Agents
Works: ✅ YesSetup:Coverage: All shell commands (git, pip, npm, etc.)
Troubleshooting
Agent ignoring $SHELL
Some agents hardcode/bin/bash or /bin/sh. Solutions:
- Use PATH wrappers (automatic): The wrapper creates wrappers in a temp dir and prepends to PATH.
-
Use preload instead:
- Check if agent is configurable: Some agents let you specify the shell in config files.
Shim not intercepting
-
Verify $SHELL is set:
-
Test shim directly:
-
Check curl is available:
Proxy connection errors
-
Check proxy started:
-
Test proxy health:
-
Increase verbosity:
Advanced: Custom Session Names
Tag wrapped sessions for audit filtering:Performance
Wrapper overhead per command:| Command | Without Rampart | With Rampart | Overhead |
|---|---|---|---|
echo hello | 2ms | 4ms | +2ms |
git status | 45ms | 48ms | +3ms |
npm install | 12s | 12.003s | +0.003s |