@solongate/proxy 0.47.1 → 0.47.3

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
@@ -1,51 +1,73 @@
1
1
  # @solongate/proxy
2
2
 
3
- **AI Tool Security Proxy** Protect any AI tool server with security policies, input validation, rate limiting, and audit logging. Zero code changes required.
3
+ **Security for AI agents.** SolonGate enforces a security policy on every action an AI agent takes every tool call is allowed, blocked, or logged before it runs. No code changes.
4
4
 
5
5
  ```
6
- AI Client ──(stdio)──> SolonGate Proxy ──(stdio)──> Tool Server
7
-
8
- [rate limit]
9
- [input guard]
10
- [policy eval]
11
- [audit log]
6
+ AI agent ──(tool call)──> SolonGate guard ──> Tool runs
7
+
8
+ [policy eval] ← OPA-WASM, fail-closed
9
+ [prompt-injection scan]
10
+ [allow / block / audit]
12
11
  ```
13
12
 
14
- **Works with every AI platform:** Claude Code, Claude Desktop, Cursor, Windsurf, Cline, Zed, and any application that uses AI tool calls.
13
+ SolonGate comes in two editions that share the same policy model and dashboard:
15
14
 
16
- ## Quick Start
15
+ - **Cloud** — managed, nothing to host. Pair your machine with one command and manage policies + audit logs at [dashboard.solongate.com](https://dashboard.solongate.com).
16
+ - **Local / air-gapped** — run the whole stack on your own hardware with Docker, zero outbound connectivity, no API keys.
17
17
 
18
- ### Automatic Setup
18
+ ---
19
19
 
20
- Run this in your project directory:
20
+ ## Quick start (Cloud)
21
+
22
+ **You need:** a free [SolonGate account](https://auth.solongate.com), Node.js 18+ on the machine you want to protect, and an AI tool that makes tool calls (Claude Code; Gemini CLI is also supported).
23
+
24
+ Pair the machine and turn on the guard — one command, no API keys to copy:
21
25
 
22
26
  ```bash
23
- npx @solongate/proxy init --all
27
+ npx -y @solongate/proxy@latest login
24
28
  ```
25
29
 
26
- Restart your AI client. Done.
30
+ It opens your browser to authorize the device. Approve it from your signed-in dashboard and SolonGate installs a **global guard hook** that intercepts every tool call from every AI session on the machine and evaluates it against your active policy.
31
+
32
+ > Start a **new** terminal session afterwards — hooks load when a session starts, so already-open terminals aren't guarded yet.
33
+
34
+ ## Write a policy
35
+
36
+ Open **Policies** in the dashboard and create one. A policy is a set of rules; each rule targets a tool plus a constraint (path / command / filename / URL) and is either ALLOW or DENY. Two modes:
37
+
38
+ - **Denylist** — everything is allowed except what you block (e.g. deny any file named `*.env`, or commands matching `*rm -rf*`).
39
+ - **Whitelist** — nothing is allowed except what you permit.
27
40
 
28
- ### Manual Setup
41
+ Click **Activate** to make a policy the one the guard enforces. Rules compile to an OPA-WASM bundle and take effect on the next tool call.
42
+
43
+ ## Review the audit log
44
+
45
+ Every decision shows up under **Audit** — what was allowed, what was blocked, and which rule matched. When a legitimate action is blocked, open the entry and click **Whitelist this**: SolonGate adds a narrow ALLOW exception for exactly that action and recompiles. Revoke any exception from **Granted exceptions**.
46
+
47
+ ## Uninstall
48
+
49
+ ```bash
50
+ npx @solongate/proxy init --global --restore
51
+ ```
29
52
 
30
- Edit your `.mcp.json`:
53
+ ---
54
+
55
+ ## Advanced: wrap a single MCP server (proxy mode)
56
+
57
+ Instead of the machine-wide guard, you can place SolonGate **in front of one MCP server** so it works with any MCP client (Claude Desktop, Cursor, Windsurf, Cline, Zed, …). Edit your `.mcp.json`:
31
58
 
32
59
  ```json
33
60
  {
34
61
  "mcpServers": {
35
62
  "my-server": {
36
63
  "command": "npx",
37
- "args": [
38
- "@solongate/proxy",
39
- "--policy", "restricted",
40
- "--",
41
- "node", "./my-server/dist/index.js"
42
- ]
64
+ "args": ["@solongate/proxy", "--policy", "restricted", "--", "node", "./my-server/dist/index.js"]
43
65
  }
44
66
  }
45
67
  }
46
68
  ```
47
69
 
48
- ## Policy Presets
70
+ ### Policy presets
49
71
 
50
72
  | Preset | Description |
51
73
  |--------|-------------|
@@ -54,23 +76,7 @@ Edit your `.mcp.json`:
54
76
  | `permissive` | Allows all tools, still enforces input validation |
55
77
  | `deny-all` | Blocks all tool calls (emergency lockdown) |
56
78
 
57
- ## What Gets Blocked
58
-
59
- **Input Guard** (always active):
60
- - Path traversal: `../../etc/passwd`
61
- - Shell injection: `; rm -rf /`, `` `whoami` ``, `$(curl evil.com)`
62
- - Pipe injection: `| cat /etc/shadow`
63
- - Oversized inputs (DoS prevention)
64
-
65
- **Policy Engine** (configurable):
66
- - Shell execution tools (`shell_exec`, `run_command`, etc.)
67
- - Eval/exec tools
68
- - Web fetch (data exfiltration prevention)
69
- - Any tool matching your custom patterns
70
-
71
- ## Custom Policies
72
-
73
- Create a JSON policy file:
79
+ ### Custom policy file
74
80
 
75
81
  ```json
76
82
  {
@@ -78,24 +84,8 @@ Create a JSON policy file:
78
84
  "name": "My Custom Policy",
79
85
  "version": 1,
80
86
  "rules": [
81
- {
82
- "id": "deny-exec",
83
- "effect": "DENY",
84
- "priority": 100,
85
- "toolPattern": "*exec*",
86
- "permission": "EXECUTE",
87
- "minimumTrustLevel": "UNTRUSTED",
88
- "enabled": true
89
- },
90
- {
91
- "id": "allow-rest",
92
- "effect": "ALLOW",
93
- "priority": 1000,
94
- "toolPattern": "*",
95
- "permission": "EXECUTE",
96
- "minimumTrustLevel": "UNTRUSTED",
97
- "enabled": true
98
- }
87
+ { "id": "deny-exec", "effect": "DENY", "priority": 100, "toolPattern": "*exec*", "permission": "EXECUTE", "minimumTrustLevel": "UNTRUSTED", "enabled": true },
88
+ { "id": "allow-rest", "effect": "ALLOW", "priority": 1000, "toolPattern": "*", "permission": "EXECUTE", "minimumTrustLevel": "UNTRUSTED", "enabled": true }
99
89
  ]
100
90
  }
101
91
  ```
@@ -104,12 +94,11 @@ Create a JSON policy file:
104
94
  npx @solongate/proxy --policy ./my-policy.json -- node my-server.js
105
95
  ```
106
96
 
107
- ## CLI Options
97
+ ### CLI options
108
98
 
109
99
  ```
110
100
  solongate-proxy [options] -- <server-command> [args...]
111
101
 
112
- Options:
113
102
  --policy <preset|file> Policy preset or JSON file (default: restricted)
114
103
  --name <name> Proxy display name
115
104
  --verbose Show detailed error messages
@@ -121,19 +110,15 @@ Options:
121
110
  --api-url <url> Custom API URL (default: api.solongate.com)
122
111
  ```
123
112
 
124
- ## Restore Original Config
125
-
126
- ```bash
127
- npx @solongate/proxy init --restore
128
- ```
113
+ ---
129
114
 
130
115
  ## Why SolonGate?
131
116
 
132
- AI tool servers give AI agents direct access to your system — shell commands, file system, databases, network. A single prompt injection attack can turn your AI assistant into an attacker.
133
-
134
- SolonGate sits between the AI client and the tool server, enforcing security policies on every tool call before it reaches the server.
117
+ AI agents get direct access to your system — shell, file system, databases, network. A single prompt-injection attack can turn your assistant into an attacker. SolonGate sits between the agent and the action, enforcing your policy on every tool call before it runs, and recording every decision for audit.
135
118
 
136
- Learn more at [solongate.com](https://solongate.com)
119
+ - **Docs:** [solongate.com/docs](https://solongate.com/docs)
120
+ - **Dashboard:** [dashboard.solongate.com](https://dashboard.solongate.com)
121
+ - **Air-gapped guide:** [solongate.com/docs/local](https://solongate.com/docs/local)
137
122
 
138
123
  ## License
139
124
 
package/dist/index.js CHANGED
@@ -7510,7 +7510,10 @@ function openBrowser(url) {
7510
7510
  try {
7511
7511
  const cmd = process.platform === "win32" ? "cmd" : process.platform === "darwin" ? "open" : "xdg-open";
7512
7512
  const args = process.platform === "win32" ? ["/c", "start", '""', url] : [url];
7513
- spawn(cmd, args, { stdio: "ignore", detached: true }).unref();
7513
+ const child = spawn(cmd, args, { stdio: "ignore", detached: true });
7514
+ child.on("error", () => {
7515
+ });
7516
+ child.unref();
7514
7517
  } catch {
7515
7518
  }
7516
7519
  }
package/dist/login.js CHANGED
@@ -233,7 +233,10 @@ function openBrowser(url) {
233
233
  try {
234
234
  const cmd = process.platform === "win32" ? "cmd" : process.platform === "darwin" ? "open" : "xdg-open";
235
235
  const args = process.platform === "win32" ? ["/c", "start", '""', url] : [url];
236
- spawn(cmd, args, { stdio: "ignore", detached: true }).unref();
236
+ const child = spawn(cmd, args, { stdio: "ignore", detached: true });
237
+ child.on("error", () => {
238
+ });
239
+ child.unref();
237
240
  } catch {
238
241
  }
239
242
  }