claude-warden 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +45 -10
- package/dist/cli.cjs +1231 -1251
- package/dist/codex-export.cjs +1231 -1251
- package/dist/copilot.cjs +1227 -1251
- package/dist/index.cjs +1227 -1251
- package/package.json +16 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "warden",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Smart command safety filter for Claude Code — parses shell pipelines and evaluates per-command safety rules to auto-approve safe commands and block dangerous ones",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "banyudu"
|
package/README.md
CHANGED
|
@@ -104,27 +104,62 @@ cd claude-warden && npm install && npm run build
|
|
|
104
104
|
claude --plugin-dir ./claude-warden
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
## Codex CLI
|
|
107
|
+
## Codex CLI
|
|
108
108
|
|
|
109
|
-
Codex
|
|
109
|
+
Codex supports [PreToolUse hooks](https://developers.openai.com/codex/hooks) with a wire protocol nearly identical to Claude Code's, so the **same** Warden hook binary works natively — no rule export needed.
|
|
110
|
+
|
|
111
|
+
### Setup
|
|
112
|
+
|
|
113
|
+
1. Install Warden globally so the `warden-hook` binary lands in your `PATH`:
|
|
110
114
|
|
|
111
115
|
```bash
|
|
112
|
-
|
|
113
|
-
|
|
116
|
+
npm install -g claude-warden
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
2. Drop the following into `~/.codex/hooks.json` (user-wide) or `<repo>/.codex/hooks.json` (project-scoped):
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"hooks": {
|
|
124
|
+
"PreToolUse": [
|
|
125
|
+
{
|
|
126
|
+
"matcher": "Bash",
|
|
127
|
+
"hooks": [
|
|
128
|
+
{
|
|
129
|
+
"type": "command",
|
|
130
|
+
"command": "warden-hook",
|
|
131
|
+
"statusMessage": "Checking Bash command with Warden"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
114
138
|
```
|
|
115
139
|
|
|
116
|
-
|
|
140
|
+
A ready-to-use template ships at [`.codex/hooks.json`](.codex/hooks.json). If `warden-hook` isn't on your `PATH` (e.g. non-global install), use the absolute path instead: `node /path/to/claude-warden/dist/index.cjs`.
|
|
117
141
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
142
|
+
### How it works
|
|
143
|
+
|
|
144
|
+
Codex sends the same `{tool_name, tool_input.command, cwd, session_id, ...}` payload on stdin and accepts the same `hookSpecificOutput.permissionDecision` response as Claude Code. The identical `dist/index.cjs` binary runs the full parser/evaluator pipeline — trusted hosts, YOLO mode, argument-aware rules, and all. The same `~/.claude/warden.yaml` and `.claude/warden.yaml` config files drive both.
|
|
145
|
+
|
|
146
|
+
### Known Codex limitations
|
|
121
147
|
|
|
122
|
-
|
|
148
|
+
- **Bash only** — Codex PreToolUse currently intercepts only shell commands; MCP, Write, and WebSearch tools are not hooked.
|
|
149
|
+
- **Work in progress upstream** — Codex's hook system may miss some shell invocations. Treat it as defense-in-depth, not a hard sandbox.
|
|
150
|
+
- **`deny` is authoritative; `allow`/`ask` fail open** — Codex currently honors `deny` (and exit code 2) but treats `allow`/`ask` as "fail open" (command proceeds). This is safe: Warden's deny list still blocks dangerous commands.
|
|
151
|
+
- **No undo** — hooks cannot revert a command that has already executed.
|
|
152
|
+
|
|
153
|
+
### Fallback: static rule export
|
|
154
|
+
|
|
155
|
+
For environments where the hook approach isn't viable, Warden can still export a static `execpolicy` rules file:
|
|
123
156
|
|
|
124
157
|
```bash
|
|
125
|
-
|
|
158
|
+
pnpm run codex:export-rules # writes .codex/rules/warden.rules
|
|
126
159
|
```
|
|
127
160
|
|
|
161
|
+
Use `--cwd <dir>`, `--out <path>`, or `--stdout` to customize. This snapshot loses dynamic behavior (trusted hosts, YOLO, etc.) but works with older Codex setups.
|
|
162
|
+
|
|
128
163
|
## GitHub Copilot CLI
|
|
129
164
|
|
|
130
165
|
Warden supports GitHub Copilot CLI's [preToolUse hook](https://docs.github.com/en/copilot/reference/hooks-configuration) natively.
|