@solongate/proxy 0.83.37 → 0.83.39

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.
@@ -14,6 +14,8 @@ export interface RuleSpec {
14
14
  kind?: 'command' | 'path' | 'url' | 'tool';
15
15
  value?: string;
16
16
  effect?: 'ALLOW' | 'DENY';
17
+ /** Scopes the rule to a class of call. Absent means every class. */
18
+ permission?: string[];
17
19
  }
18
20
  export declare function addRule(id: string, spec: RuleSpec): Promise<{
19
21
  ok: true;
@@ -772,7 +772,21 @@ async function run(argv) {
772
772
  value = v;
773
773
  }
774
774
  }
775
- const res = await api.policies.addRule(id, { toolPattern, kind, value, effect });
775
+ let permission;
776
+ const rawPerm = flagStr(flags, "permission");
777
+ if (rawPerm !== void 0) {
778
+ const known = { read: "READ", write: "WRITE", execute: "EXECUTE", network: "NETWORK" };
779
+ const out2 = [];
780
+ for (const part of rawPerm.split(",")) {
781
+ const t = part.trim();
782
+ if (!t) continue;
783
+ const name = known[t.toLowerCase()];
784
+ if (!name) return err(` Unknown permission "${t}". One or more of: READ, WRITE, EXECUTE, NETWORK`), 1;
785
+ if (!out2.includes(name)) out2.push(name);
786
+ }
787
+ if (out2.length) permission = out2;
788
+ }
789
+ const res = await api.policies.addRule(id, { toolPattern, kind, value, effect, permission });
776
790
  if (json) return printJson(res), 0;
777
791
  if (res.deduped) err(green(" \u2713 ") + dim(`Equivalent ${effect} rule already present.`));
778
792
  else err(green(` \u2713 ${effect} rule added`) + dim(` (${res.rule?.id})`));
package/dist/index.js CHANGED
@@ -13066,7 +13066,21 @@ async function run2(argv) {
13066
13066
  value = v;
13067
13067
  }
13068
13068
  }
13069
- const res = await api.policies.addRule(id, { toolPattern, kind, value, effect });
13069
+ let permission;
13070
+ const rawPerm = flagStr(flags, "permission");
13071
+ if (rawPerm !== void 0) {
13072
+ const known = { read: "READ", write: "WRITE", execute: "EXECUTE", network: "NETWORK" };
13073
+ const out2 = [];
13074
+ for (const part of rawPerm.split(",")) {
13075
+ const t = part.trim();
13076
+ if (!t) continue;
13077
+ const name = known[t.toLowerCase()];
13078
+ if (!name) return err(` Unknown permission "${t}". One or more of: READ, WRITE, EXECUTE, NETWORK`), 1;
13079
+ if (!out2.includes(name)) out2.push(name);
13080
+ }
13081
+ if (out2.length) permission = out2;
13082
+ }
13083
+ const res = await api.policies.addRule(id, { toolPattern, kind, value, effect, permission });
13070
13084
  if (json) return printJson(res), 0;
13071
13085
  if (res.deduped) err(green(" \u2713 ") + dim(`Equivalent ${effect} rule already present.`));
13072
13086
  else err(green(` \u2713 ${effect} rule added`) + dim(` (${res.rule?.id})`));
@@ -17727,6 +17741,7 @@ function printHelp() {
17727
17741
  cmd("policy show <id>", "show one policy (rules, mode)");
17728
17742
  cmd("policy allow <id> [--command|--path|--url <val>]", "add an ALLOW rule");
17729
17743
  cmd("policy deny <id> [--command|--path|--url <val>]", "add a DENY rule");
17744
+ cmd(" --permission READ,WRITE,EXECUTE,NETWORK", "scope an allow/deny to a class of call");
17730
17745
  cmd("policy revoke <id> <ruleId>", "remove a rule");
17731
17746
  cmd("policy activate <id> | --off", "pin the active policy, or enforce nothing");
17732
17747
  cmd("policy active", "show the resolved active policy");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.83.37",
3
+ "version": "0.83.39",
4
4
  "description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -61,12 +61,12 @@
61
61
  "node": ">=20.0.0"
62
62
  },
63
63
  "optionalDependencies": {
64
- "@solongate/guard-linux-x64": "0.83.37",
65
- "@solongate/guard-linux-arm64": "0.83.37",
66
- "@solongate/guard-darwin-x64": "0.83.37",
67
- "@solongate/guard-darwin-arm64": "0.83.37",
68
- "@solongate/guard-win32-x64": "0.83.37",
69
- "@solongate/guard-win32-arm64": "0.83.37"
64
+ "@solongate/guard-linux-x64": "0.83.39",
65
+ "@solongate/guard-linux-arm64": "0.83.39",
66
+ "@solongate/guard-darwin-x64": "0.83.39",
67
+ "@solongate/guard-darwin-arm64": "0.83.39",
68
+ "@solongate/guard-win32-x64": "0.83.39",
69
+ "@solongate/guard-win32-arm64": "0.83.39"
70
70
  },
71
71
  "dependencies": {
72
72
  "@modelcontextprotocol/sdk": "^1.26.0",