$SHELL or has a hook system.
Quick Setup
How It Works
The preload library sits between the process and libc, intercepting all exec-family functions before they reach the kernel.Intercepted Functions
Environment Variables
The preload library reads configuration from environment:- RAMPART_URL
- RAMPART_TOKEN
- RAMPART_MODE
- RAMPART_FAIL_OPEN
- RAMPART_DEBUG
Default:
http://127.0.0.1:9090Policy server endpoint:Command-Line Usage
- Basic
- Monitor Mode
- Custom Port
- Custom Agent Name
- Fail-Closed
- Port 9090
- Token from
~/.rampart/token - Enforce mode
- Fail-open enabled
Platform Support
- Linux
- macOS
- Windows
Coverage: ~95% of dynamically-linked binariesMechanism: Limitations:
LD_PRELOADWorks with:- Python interpreters (python, python3)
- Node.js (node, nodejs)
- Go binaries (if dynamically linked)
- Rust binaries (if dynamically linked)
- Any dynamically-linked executable
- Static binaries cannot be intercepted
- Requires libcurl installed
Policy Configuration
~/.rampart/policies/custom.yaml
Building from Source
Linux
macOS
Debug Build
AddressSanitizer Build
Example Session
Terminal output with preload active:Monitoring
Audit Trail
Live Dashboard
Troubleshooting
Library not found
-
Check library exists:
-
Build if missing:
-
Check dependencies:
Library won’t load
-
Test basic loading:
-
Check architecture:
-
Enable debug output:
Commands not being intercepted
-
Check if binary is dynamically linked:
-
Check if SIP is blocking (macOS):
-
Test with debug:
Policy server connection fails
-
Check service is running:
-
Check token:
-
Test with fail-closed:
Security Considerations
Threat Model
The preload library protects against: ✅ Hallucinating AI agents executing dangerous commands✅ Malicious plugins/skills running credential theft
✅ Accidental destructive commands from autonomous agents
✅ Subprocess cascades — all children inherit the library ❌ Does NOT protect against:
- Deliberate
unsetenv("LD_PRELOAD")before exec (bypass) - Direct syscalls bypassing libc (requires assembly)
- Static binaries (no dynamic linking)
- Direct file operations (
open(),read(),write()) - Network operations (
socket(),connect())
Bypass Resistance
Against AI agents: High — they don’t know to unset LD_PRELOADAgainst humans: Low — easy to bypass if you know how
Against accidents: Perfect — catches all standard exec paths
Performance
Overhead per command:| Operation | Without Rampart | With Rampart | Overhead |
|---|---|---|---|
echo hello | 2ms | 3.5ms | +1.5ms |
ls /tmp | 3ms | 5ms | +2ms |
git status | 45ms | 47ms | +2ms |
npm test | 3.2s | 3.202s | +0.002s |