@solongate/proxy 0.47.3 → 0.47.5
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 +5 -60
- package/dist/index.js +22 -3
- package/hooks/guard.bundled.mjs +7536 -7536
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @solongate/proxy
|
|
2
2
|
|
|
3
|
+
> **Don't `npm i` this.** There's nothing to install. Run the one-liner below to pair your machine:
|
|
4
|
+
> ```bash
|
|
5
|
+
> npx -y @solongate/proxy@latest login
|
|
6
|
+
> ```
|
|
7
|
+
|
|
3
8
|
**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
9
|
|
|
5
10
|
```
|
|
@@ -52,66 +57,6 @@ npx @solongate/proxy init --global --restore
|
|
|
52
57
|
|
|
53
58
|
---
|
|
54
59
|
|
|
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`:
|
|
58
|
-
|
|
59
|
-
```json
|
|
60
|
-
{
|
|
61
|
-
"mcpServers": {
|
|
62
|
-
"my-server": {
|
|
63
|
-
"command": "npx",
|
|
64
|
-
"args": ["@solongate/proxy", "--policy", "restricted", "--", "node", "./my-server/dist/index.js"]
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Policy presets
|
|
71
|
-
|
|
72
|
-
| Preset | Description |
|
|
73
|
-
|--------|-------------|
|
|
74
|
-
| `restricted` | Blocks shell/exec/eval, allows reads and writes **(recommended)** |
|
|
75
|
-
| `read-only` | Only allows read/list/get/search/query operations |
|
|
76
|
-
| `permissive` | Allows all tools, still enforces input validation |
|
|
77
|
-
| `deny-all` | Blocks all tool calls (emergency lockdown) |
|
|
78
|
-
|
|
79
|
-
### Custom policy file
|
|
80
|
-
|
|
81
|
-
```json
|
|
82
|
-
{
|
|
83
|
-
"id": "my-policy",
|
|
84
|
-
"name": "My Custom Policy",
|
|
85
|
-
"version": 1,
|
|
86
|
-
"rules": [
|
|
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 }
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npx @solongate/proxy --policy ./my-policy.json -- node my-server.js
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### CLI options
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
solongate-proxy [options] -- <server-command> [args...]
|
|
101
|
-
|
|
102
|
-
--policy <preset|file> Policy preset or JSON file (default: restricted)
|
|
103
|
-
--name <name> Proxy display name
|
|
104
|
-
--verbose Show detailed error messages
|
|
105
|
-
--no-input-guard Disable input validation
|
|
106
|
-
--rate-limit <n> Per-tool rate limit (calls/min)
|
|
107
|
-
--global-rate-limit <n> Global rate limit (calls/min)
|
|
108
|
-
--config <file> Load full config from JSON file
|
|
109
|
-
--api-key <key> SolonGate Cloud API key (cloud policy + audit)
|
|
110
|
-
--api-url <url> Custom API URL (default: api.solongate.com)
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
60
|
## Why SolonGate?
|
|
116
61
|
|
|
117
62
|
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.
|
package/dist/index.js
CHANGED
|
@@ -285,7 +285,7 @@ function parseArgs(argv) {
|
|
|
285
285
|
}
|
|
286
286
|
if (!apiKey) {
|
|
287
287
|
throw new Error(
|
|
288
|
-
"Not logged in. Run
|
|
288
|
+
"Not logged in. Run this once to get started:\n\n npx -y @solongate/proxy@latest login\n"
|
|
289
289
|
);
|
|
290
290
|
}
|
|
291
291
|
if (!apiKey.startsWith("sg_live_") && !apiKey.startsWith("sg_test_")) {
|
|
@@ -341,7 +341,7 @@ function parseArgs(argv) {
|
|
|
341
341
|
}
|
|
342
342
|
if (upstreamArgs.length === 0) {
|
|
343
343
|
throw new Error(
|
|
344
|
-
"No upstream server command provided.\n\
|
|
344
|
+
"No upstream server command provided.\n\nIf you just want to get started, run:\n npx -y @solongate/proxy@latest login\n"
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
const [command, ...commandArgs] = upstreamArgs;
|
|
@@ -11568,8 +11568,10 @@ ${msg.content.text}`;
|
|
|
11568
11568
|
};
|
|
11569
11569
|
|
|
11570
11570
|
// src/index.ts
|
|
11571
|
+
init_cli_utils();
|
|
11571
11572
|
var CLI_SUBCOMMANDS = /* @__PURE__ */ new Set(["init", "login", "logout", "create", "inject", "pull", "push", "list", "ls"]);
|
|
11572
|
-
|
|
11573
|
+
var IS_HUMAN_CLI = process.argv.length <= 2 || CLI_SUBCOMMANDS.has(process.argv[2] ?? "");
|
|
11574
|
+
if (!IS_HUMAN_CLI) {
|
|
11573
11575
|
console.log = (...args) => {
|
|
11574
11576
|
process.stderr.write(`[SolonGate] ${args.map(String).join(" ")}
|
|
11575
11577
|
`);
|
|
@@ -11583,8 +11585,25 @@ if (!CLI_SUBCOMMANDS.has(process.argv[2] ?? "")) {
|
|
|
11583
11585
|
`);
|
|
11584
11586
|
};
|
|
11585
11587
|
}
|
|
11588
|
+
function printWelcome() {
|
|
11589
|
+
console.log("");
|
|
11590
|
+
console.log(` ${c.bold}${c.blue4}SolonGate${c.reset} ${c.dim}\u2014 secure gateway for your AI agents${c.reset}`);
|
|
11591
|
+
console.log("");
|
|
11592
|
+
console.log(" Get started with one command:");
|
|
11593
|
+
console.log("");
|
|
11594
|
+
console.log(` ${c.cyan}npx -y @solongate/proxy@latest login${c.reset}`);
|
|
11595
|
+
console.log("");
|
|
11596
|
+
console.log(` ${c.dim}This pairs your device and protects every Claude Code session${c.reset}`);
|
|
11597
|
+
console.log(` ${c.dim}on this machine with your cloud policy. Manage it at${c.reset}`);
|
|
11598
|
+
console.log(` ${c.cyan}https://dashboard.solongate.com${c.reset}`);
|
|
11599
|
+
console.log("");
|
|
11600
|
+
}
|
|
11586
11601
|
async function main6() {
|
|
11587
11602
|
const subcommand = process.argv[2];
|
|
11603
|
+
if (process.argv.length <= 2) {
|
|
11604
|
+
printWelcome();
|
|
11605
|
+
return;
|
|
11606
|
+
}
|
|
11588
11607
|
if (subcommand === "init") {
|
|
11589
11608
|
process.argv.splice(2, 1);
|
|
11590
11609
|
await Promise.resolve().then(() => (init_init(), init_exports));
|