@solongate/proxy 0.28.0 → 0.28.2

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/dist/index.js CHANGED
@@ -521,7 +521,6 @@ function wrapServer(serverName, server, policy) {
521
521
  const env = { ...server.env ?? {} };
522
522
  env.SOLONGATE_API_KEY = "${SOLONGATE_API_KEY}";
523
523
  const proxyArgs = ["-y", "@solongate/proxy@latest"];
524
- proxyArgs.push("--agent-name", serverName);
525
524
  if (policy) {
526
525
  proxyArgs.push("--policy", policy);
527
526
  }
@@ -5789,12 +5788,13 @@ var SolonGateProxy = class {
5789
5788
  httpAgentInfo = /* @__PURE__ */ new Map();
5790
5789
  /** Per-request sub-agent info from HTTP headers (transient, overwritten per request) */
5791
5790
  httpSubAgent = null;
5792
- /** Server label from --agent-name flag (e.g. "filesystem", "playwright") */
5793
- serverLabel = null;
5794
5791
  constructor(config) {
5795
5792
  this.config = config;
5796
5793
  this.guardConfig = config.advancedDetection ? { ...DEFAULT_INPUT_GUARD_CONFIG, advancedDetection: config.advancedDetection } : DEFAULT_INPUT_GUARD_CONFIG;
5797
- this.serverLabel = config.agentName ?? null;
5794
+ if (config.agentName) {
5795
+ this.agentName = config.agentName;
5796
+ this.agentId = config.agentName.toLowerCase().replace(/\s+/g, "-");
5797
+ }
5798
5798
  this.gate = new SolonGate({
5799
5799
  name: config.name ?? "solongate-proxy",
5800
5800
  apiKey: "sg_test_proxy_internal_00000000",
@@ -6007,19 +6007,10 @@ var SolonGateProxy = class {
6007
6007
  this.server.oninitialized = () => {
6008
6008
  if (this.server) {
6009
6009
  const clientVersion = this.server.getClientVersion();
6010
- const clientName = clientVersion?.name ?? null;
6011
- if (clientName && this.serverLabel) {
6012
- this.agentId = `${clientName}/${this.serverLabel}`;
6013
- this.agentName = `${clientName} (${this.serverLabel})`;
6014
- } else if (clientName) {
6015
- this.agentId = clientVersion?.version ? `${clientName}/${clientVersion.version}` : clientName;
6016
- this.agentName = clientName;
6017
- } else if (this.serverLabel) {
6018
- this.agentId = this.serverLabel.toLowerCase().replace(/\s+/g, "-");
6019
- this.agentName = this.serverLabel;
6020
- }
6021
- if (this.agentId) {
6022
- log2(`Agent identified: ${this.agentName} (${this.agentId})`);
6010
+ if (clientVersion?.name) {
6011
+ this.agentId = clientVersion.name;
6012
+ this.agentName = clientVersion.name;
6013
+ log2(`Agent identified from MCP clientInfo: ${this.agentName}`);
6023
6014
  }
6024
6015
  }
6025
6016
  };
@@ -6457,13 +6448,8 @@ ${msg.content.text}`;
6457
6448
  const headerAgentId = req.headers["x-agent-id"];
6458
6449
  const headerAgentName = req.headers["x-agent-name"];
6459
6450
  if (headerAgentId) {
6460
- if (this.serverLabel) {
6461
- this.agentId = `${headerAgentId}/${this.serverLabel}`;
6462
- this.agentName = `${headerAgentName || headerAgentId} (${this.serverLabel})`;
6463
- } else {
6464
- this.agentId = headerAgentId;
6465
- this.agentName = headerAgentName || headerAgentId;
6466
- }
6451
+ this.agentId = headerAgentId;
6452
+ this.agentName = headerAgentName || headerAgentId;
6467
6453
  log2(`Agent identified from HTTP headers: ${this.agentName} (${this.agentId})`);
6468
6454
  }
6469
6455
  }
package/dist/init.js CHANGED
@@ -102,7 +102,6 @@ function wrapServer(serverName, server, policy) {
102
102
  const env = { ...server.env ?? {} };
103
103
  env.SOLONGATE_API_KEY = "${SOLONGATE_API_KEY}";
104
104
  const proxyArgs = ["-y", "@solongate/proxy@latest"];
105
- proxyArgs.push("--agent-name", serverName);
106
105
  if (policy) {
107
106
  proxyArgs.push("--policy", policy);
108
107
  }
package/dist/lib.js CHANGED
@@ -4229,12 +4229,13 @@ var SolonGateProxy = class {
4229
4229
  httpAgentInfo = /* @__PURE__ */ new Map();
4230
4230
  /** Per-request sub-agent info from HTTP headers (transient, overwritten per request) */
4231
4231
  httpSubAgent = null;
4232
- /** Server label from --agent-name flag (e.g. "filesystem", "playwright") */
4233
- serverLabel = null;
4234
4232
  constructor(config) {
4235
4233
  this.config = config;
4236
4234
  this.guardConfig = config.advancedDetection ? { ...DEFAULT_INPUT_GUARD_CONFIG, advancedDetection: config.advancedDetection } : DEFAULT_INPUT_GUARD_CONFIG;
4237
- this.serverLabel = config.agentName ?? null;
4235
+ if (config.agentName) {
4236
+ this.agentName = config.agentName;
4237
+ this.agentId = config.agentName.toLowerCase().replace(/\s+/g, "-");
4238
+ }
4238
4239
  this.gate = new SolonGate({
4239
4240
  name: config.name ?? "solongate-proxy",
4240
4241
  apiKey: "sg_test_proxy_internal_00000000",
@@ -4447,19 +4448,10 @@ var SolonGateProxy = class {
4447
4448
  this.server.oninitialized = () => {
4448
4449
  if (this.server) {
4449
4450
  const clientVersion = this.server.getClientVersion();
4450
- const clientName = clientVersion?.name ?? null;
4451
- if (clientName && this.serverLabel) {
4452
- this.agentId = `${clientName}/${this.serverLabel}`;
4453
- this.agentName = `${clientName} (${this.serverLabel})`;
4454
- } else if (clientName) {
4455
- this.agentId = clientVersion?.version ? `${clientName}/${clientVersion.version}` : clientName;
4456
- this.agentName = clientName;
4457
- } else if (this.serverLabel) {
4458
- this.agentId = this.serverLabel.toLowerCase().replace(/\s+/g, "-");
4459
- this.agentName = this.serverLabel;
4460
- }
4461
- if (this.agentId) {
4462
- log2(`Agent identified: ${this.agentName} (${this.agentId})`);
4451
+ if (clientVersion?.name) {
4452
+ this.agentId = clientVersion.name;
4453
+ this.agentName = clientVersion.name;
4454
+ log2(`Agent identified from MCP clientInfo: ${this.agentName}`);
4463
4455
  }
4464
4456
  }
4465
4457
  };
@@ -4897,13 +4889,8 @@ ${msg.content.text}`;
4897
4889
  const headerAgentId = req.headers["x-agent-id"];
4898
4890
  const headerAgentName = req.headers["x-agent-name"];
4899
4891
  if (headerAgentId) {
4900
- if (this.serverLabel) {
4901
- this.agentId = `${headerAgentId}/${this.serverLabel}`;
4902
- this.agentName = `${headerAgentName || headerAgentId} (${this.serverLabel})`;
4903
- } else {
4904
- this.agentId = headerAgentId;
4905
- this.agentName = headerAgentName || headerAgentId;
4906
- }
4892
+ this.agentId = headerAgentId;
4893
+ this.agentName = headerAgentName || headerAgentId;
4907
4894
  log2(`Agent identified from HTTP headers: ${this.agentName} (${this.agentId})`);
4908
4895
  }
4909
4896
  }
package/hooks/audit.mjs CHANGED
@@ -63,6 +63,8 @@ process.stdin.on('end', async () => {
63
63
  reason: hasError ? 'tool returned error' : 'allowed',
64
64
  source: 'claude-code-hook',
65
65
  evaluationTimeMs: 0,
66
+ agent_id: 'claude-code',
67
+ agent_name: 'Claude Code',
66
68
  }),
67
69
  signal: AbortSignal.timeout(5000),
68
70
  });
package/hooks/guard.mjs CHANGED
@@ -346,6 +346,7 @@ process.stdin.on('end', async () => {
346
346
  tool: data.tool_name || '', arguments: args,
347
347
  decision: 'DENY', reason,
348
348
  source: 'claude-code-guard',
349
+ agent_id: 'claude-code', agent_name: 'Claude Code',
349
350
  }),
350
351
  signal: AbortSignal.timeout(3000),
351
352
  });
@@ -977,6 +978,7 @@ process.stdin.on('end', async () => {
977
978
  decision: isLogOnly ? 'ALLOW' : 'DENY',
978
979
  reason: msg,
979
980
  source: 'claude-code-guard',
981
+ agent_id: 'claude-code', agent_name: 'Claude Code',
980
982
  pi_detected: true,
981
983
  pi_trust_score: piResult.trustScore,
982
984
  pi_blocked: !isLogOnly,
@@ -1037,6 +1039,7 @@ process.stdin.on('end', async () => {
1037
1039
  decision: 'ALLOW',
1038
1040
  reason: 'Prompt injection detected but below threshold (trust: ' + (piResult.trustScore * 100).toFixed(0) + '%)',
1039
1041
  source: 'claude-code-guard',
1042
+ agent_id: 'claude-code', agent_name: 'Claude Code',
1040
1043
  pi_detected: true,
1041
1044
  pi_trust_score: piResult.trustScore,
1042
1045
  pi_blocked: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solongate/proxy",
3
- "version": "0.28.0",
3
+ "version": "0.28.2",
4
4
  "description": "MCP security proxy — protect any MCP server with customizable policies, path/command constraints, rate limiting, and audit logging. Zero code changes required.",
5
5
  "type": "module",
6
6
  "bin": {