You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -498,6 +498,16 @@ For [OpenClaw](https://github.com/openclaw/openclaw) users — one command sets
498
498
rampart setup openclaw
499
499
```
500
500
501
+
This covers all `exec` tool calls. For full file tool coverage (Read, Write, Edit), run:
502
+
503
+
```bash
504
+
rampart setup openclaw --patch-tools
505
+
```
506
+
507
+
This patches OpenClaw's Read, Write, Edit, and Grep tools to check Rampart before file operations. Requires write access to the OpenClaw installation directory (typically needs `sudo` for global npm installs).
508
+
509
+
⚠️ **Re-run after OpenClaw upgrades** — the patch modifies files in `node_modules` that get replaced on update. Between upgrade and re-patch, file tools bypass Rampart (exec shim remains active).
510
+
501
511
Works on Linux (systemd) and macOS (launchd).
502
512
503
513
---
@@ -649,8 +659,9 @@ Current: **v0.1.8** — all tests passing.
649
659
650
660
| Agent | Method | Status |
651
661
|-------|--------|--------|
652
-
| Claude Code | `rampart setup claude-code` | Native hooks, all platforms |
Copy file name to clipboardExpand all lines: docs/THREAT-MODEL.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Threat Model
2
2
3
-
> Last reviewed: 2026-02-12 | Applies to: v0.1.8
3
+
> Last reviewed: 2026-02-13 | Applies to: v0.1.9-dev (with file tool patching)
4
4
5
5
Rampart is a policy engine for AI agents — not a sandbox, not a hypervisor, not a full isolation boundary. This document describes what Rampart protects against, what it doesn't, and why.
6
6
@@ -49,11 +49,13 @@ Policy files are the security boundary. If an attacker can modify policy files,
49
49
Rampart evaluates the command string passed to the shell. This applies to **all integration methods** — native hooks (Claude Code, Cline), wrap mode, LD_PRELOAD, and the HTTP API all see the same command string. If an agent runs `python3 script.py`, Rampart sees and evaluates `python3 script.py` — but cannot inspect what `script.py` does internally.
50
50
51
51
**Mitigations:**
52
+
-**LD_PRELOAD cascade** (v0.1.9+): When using `rampart preload` or `rampart wrap`, child processes spawned by allowed commands automatically inherit the interceptor. This means `python3 script.py` calling `os.system("rm -rf /")` is caught — the subprocess goes through Rampart's policy engine. Covers `execve`, `execvpe`, and `posix_spawn` call paths.
52
53
- The optional [rampart-verify](https://github.com/peg/rampart-verify) sidecar uses LLM classification to assess intent of commands like `python3 -c "..."` based on the inline code
53
-
- File write hooks can catch the creation of malicious scripts before execution
54
54
- Patterns like `python3 -c *` can be routed to semantic verification via `action: webhook`
55
55
56
-
**Remaining surface:** Multi-step sequences (write file, then execute) are an active area of development. In practice, AI agents overwhelmingly shell out via `subprocess`/`os.system` rather than using native APIs — and those shell-outs go through Rampart.
56
+
**Remaining surface:** The cascade only applies to wrap/preload modes, not native hooks (Claude Code, Cline). Programs that use native file I/O without shelling out, or setuid binaries that drop LD_PRELOAD, are not covered.
57
+
58
+
**Multi-step sequences:** With file tool coverage enabled (native hooks or `--patch-tools`), write-then-execute sequences are evaluated at both steps independently — the write is checked against file policies and the exec against command policies.
57
59
58
60
### 2. Audit Log Rewrite
59
61
@@ -91,7 +93,22 @@ An agent could potentially encode commands to bypass pattern matching:
91
93
92
94
**Coverage:** The two-layer approach (pattern matching + LLM classification) significantly reduces the obfuscation surface. Pattern matching catches known encodings; the LLM layer catches intent regardless of how the command is formatted.
93
95
94
-
### 5. Fail-Open Behavior
96
+
### 5. Framework-Specific Patching
97
+
98
+
Some agent frameworks (e.g., OpenClaw) don't expose hook points for file operations. Rampart provides a `--patch-tools` option that modifies framework source files to add policy checks before read/write/edit operations. These patches don't survive framework upgrades — they modify files in `node_modules` that get replaced on update.
99
+
100
+
**Mitigations:**
101
+
-`rampart setup openclaw --patch-tools` must be re-run immediately after OpenClaw upgrades to restore protection
102
+
- Native hook integrations (Claude Code, Cline) don't have this limitation — they use the framework's own hook system
103
+
- A feature request for generic tool authorization hooks benefits the entire ecosystem and would eliminate the need for patching
104
+
105
+
**Security implications:**
106
+
-**Timing window:** Between OpenClaw upgrade and re-patch, file tools bypass all policies (exec shim remains active)
107
+
-**Silent degradation:** If the target code changes in a new version, patches fail to apply and file tools fail-open without warning. The patch script exits with an error, but if run unattended this could go unnoticed.
108
+
109
+
**Trade-off:** Monkey-patching is fragile but functional. It closes a real security gap today while proper upstream support is developed. The patches fail-open — if the patched code changes in an upgrade, the worst case is that file tools bypass Rampart (reverting to the pre-patch state), not that they break.
110
+
111
+
### 6. Fail-Open Behavior
95
112
96
113
When `rampart serve` is unreachable (crashed, network issue), the shim defaults to **fail-open** — commands execute without policy checks. This is a deliberate design choice: fail-closed would lock you out of your own machine.
0 commit comments