User Separation
Why User Separation Matters
If Rampart runs as the same user as your AI agent, the agent can:- Read audit logs (potentially containing credentials)
- Modify policy files to weaken its own rules
- Access the bearer token used for authentication
rampart user prevents all of these attacks.
Setting Up User Separation
How It Works
The agent communicates with Rampart over HTTP on localhost — no file access needed. This means:- Audit logs are protected from agent tampering or credential harvesting
- Policy files can’t be modified by the agent to weaken its own rules
- The agent loses zero capability — it still executes commands normally
Deployment Models
| Setup | Agent reads audit? | Agent modifies policy? | Best for |
|---|---|---|---|
| Same user (default) | ✅ Yes | ✅ Yes | Development, testing |
| Separate user | ❌ No | ❌ No | Production, unsupervised agents |
| Separate user + SIEM | ❌ No | ❌ No | Enterprise, compliance |
Run Agents as Unprivileged Users
Run your agent framework (Claude Code, Cline, OpenClaw, etc.) as a standard user, not root:sudo commands that Rampart can evaluate:
Protect Sensitive Files
Rampart’s standard policy blocks access to common credential locations:- SSH keys (
~/.ssh/id_*, excluding.pub) - Cloud credentials (
~/.aws/credentials,~/.config/gcloud/, etc.) - Token files (
.env,.netrc,.vault-token) - System authentication (
/etc/shadow,/etc/sudoers) - Browser profiles (saved passwords, cookies)
SIEM Integration for Production
For production deployments, send audit events to an external SIEM:Webhook Notifications
Get real-time alerts when Rampart blocks suspicious activity:Project Policy Security
Project-local.rampart/policy.yaml files are loaded automatically when present. A malicious repository could include a permissive project policy.
Mitigations:
- Deny-wins evaluation — Project policies can only add restrictions, not weaken global policies
- Environment variable —
RAMPART_NO_PROJECT_POLICY=1skips project policy loading - Visibility — Project policy denials are prefixed with
[Project Policy]in error messages
Token Security
The bearer token for Rampart API authentication is stored in~/.rampart/token with 0600 permissions.
Best practices:
-
Rotate tokens regularly:
-
Store tokens in the service user’s home directory when using user separation:
- Use native hooks when possible — Claude Code and Cline don’t require token files
Platform-Specific Considerations
macOS
v0.4.4+ includes macOS-specific protections:- Keychain access — Blocks
security dump-keychain, requires approval for password queries - Gatekeeper bypass — Blocks
spctl --master-disable - SIP tampering — Blocks
csrutil disable - LaunchAgent persistence — Blocks
launchctl loadfor persistence
Windows
v0.6.6+ includes Windows-specific protections:- Registry persistence — Blocks Run key modifications
- Credential dumping — Blocks SAM/SYSTEM/SECURITY registry access
- Download cradles — Blocks
IEX (IWR ...)andcertutilabuse
Defense in Depth
Rampart is a seatbelt, not a roll cage. It catches the vast majority of dangerous situations an AI agent will encounter — accidental or manipulated. For full isolation, use Rampart in combination with:- Containers — Docker, Podman, or LXC
- Virtual machines — Isolate agent workloads
- Mandatory Access Control — SELinux, AppArmor, or seccomp
- Network segmentation — Restrict agent network access
Production Checklist
- Agent runs as a non-root user
- Rampart service runs as a separate user (
rampartaccount) - Audit logs are in a protected directory (
/var/lib/rampart/audit) - SIEM export is enabled (
--syslogor--cef) - Webhook notifications are configured
- Token is rotated and stored securely
-
RAMPART_NO_PROJECT_POLICY=1is set for CI/untrusted environments - Custom policies are added for your environment’s sensitive files
Next Steps
OWASP Coverage
See how Rampart maps to OWASP Top 10 for Agentic AI
Self-Modification Protection
Learn how Rampart prevents agents from modifying policies
Threat Model
Understand what Rampart protects against and known limitations