agent-inspect 6.31.4 → 6.31.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.31.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 909ea70: Strip userinfo credentials from common connection URIs (postgres, mysql, mongodb, redis, amqp, and TLS variants) under share/strict while keeping scheme, host, port, and database/queue path.
8
+
3
9
  ## 6.31.4
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -213,7 +213,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
213
213
 
214
214
  ## Status and documentation
215
215
 
216
- **Current published baseline:** **6.31.4** · persisted schema `1.0` · Node.js `>=20` · MIT.
216
+ **Current published baseline:** **6.31.5** · persisted schema `1.0` · Node.js `>=20` · MIT.
217
217
 
218
218
  Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
219
219
 
@@ -43,7 +43,7 @@ For reviewer-reproducible trajectory checks (6.28+), prefer Evidence that includ
43
43
  - Inspect log-derived fields from `logs` / `tail` ingest configs, including custom `run-id`, `event`, `parent`, timestamp, and attribute mappings.
44
44
  - Avoid posting raw prompts, completions, tool inputs, or tool outputs in public threads unless the content is approved for public disclosure.
45
45
  - For cross-system correlation, retain a bounded identifier instead of copying the external record or payload. Follow [External reference metadata](./EXTERNAL-REFERENCES.md), and expect `share` / `strict` profiles to redact the named correlation fields.
46
- - `share` and `strict` rewrite http(s) URLs rather than dropping them: userinfo and credential-looking query or fragment params are replaced, identifier-like path segments become `[id]`, and scheme, host and path stay, so a retry on the same page is still recognizable. Only http and https URLs are rewritten: credentials in other schemes such as `postgres://user:pass@host/db` are left as they are, so check those by hand.
46
+ - `share` and `strict` rewrite http(s) URLs rather than dropping them: userinfo and credential-looking query or fragment params are replaced, identifier-like path segments become `[id]`, and scheme, host and path stay, so a retry on the same page is still recognizable. The same profiles also strip userinfo from common connection URIs (`postgres` / `postgresql`, `mysql` / `mariadb`, `mongodb` / `mongodb+srv`, `redis` / `rediss`, `amqp` / `amqps`) while keeping scheme, host, port, and database/queue path: `postgres://user:secret@db.example.com:5432/app_db` becomes `postgres://db.example.com:5432/app_db`. Other schemes still need a manual check.
47
47
  - Prefer Markdown export for issue or PR sharing when a summarized tree is enough.
48
48
 
49
49
  ## Remove or replace sensitive values
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "6.31.4",
3
+ "version": "6.31.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local evidence debugger and trajectory-test toolkit for TypeScript AI agents — execution trees, TraceContract checks, Evidence v2, and read-only MCP",
@@ -16165,7 +16165,7 @@ var init_src = __esm({
16165
16165
  });
16166
16166
 
16167
16167
  // package.json
16168
- var version = "6.31.4";
16168
+ var version = "6.31.5";
16169
16169
 
16170
16170
  // packages/cli/src/list.ts
16171
16171
  init_advanced();
@@ -17962,6 +17962,19 @@ init_credential_value_patterns();
17962
17962
  // packages/core/src/safety/url-redaction.ts
17963
17963
  init_sensitive_key();
17964
17964
  var HTTP_URL = /^https?:\/\/[^\s]+$/i;
17965
+ var CONNECTION_PROTOCOLS = /* @__PURE__ */ new Set([
17966
+ "postgres:",
17967
+ "postgresql:",
17968
+ "mysql:",
17969
+ "mariadb:",
17970
+ "mongodb:",
17971
+ "mongodb+srv:",
17972
+ "redis:",
17973
+ "rediss:",
17974
+ "amqp:",
17975
+ "amqps:"
17976
+ ]);
17977
+ var CONNECTION_URI = /^(?:postgres|postgresql|mysql|mariadb|mongodb(?:\+srv)?|rediss?|amqps?):\/\/[^\s]+$/i;
17965
17978
  var UUID_SEGMENT = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
17966
17979
  var HEX_SEGMENT = /^[0-9a-f]{12,}$/i;
17967
17980
  var NUMERIC_SEGMENT = /^\d{5,}$/;
@@ -17969,14 +17982,25 @@ var OPAQUE_SEGMENT = /^[A-Za-z0-9_-]{20,}$/;
17969
17982
  function looksLikeHttpUrl(value) {
17970
17983
  return HTTP_URL.test(value.trim());
17971
17984
  }
17972
- function parseHttpUrl(value) {
17985
+ function looksLikeConnectionUri(value) {
17986
+ return CONNECTION_URI.test(value.trim());
17987
+ }
17988
+ function looksLikeUrlForRedaction(value) {
17989
+ return looksLikeHttpUrl(value) || looksLikeConnectionUri(value);
17990
+ }
17991
+ function parseRedactableUrl(value) {
17973
17992
  try {
17974
17993
  const url = new URL(value.trim());
17975
- return url.protocol === "http:" || url.protocol === "https:" ? url : void 0;
17994
+ if (url.protocol === "http:" || url.protocol === "https:") return url;
17995
+ if (CONNECTION_PROTOCOLS.has(url.protocol)) return url;
17996
+ return void 0;
17976
17997
  } catch {
17977
17998
  return void 0;
17978
17999
  }
17979
18000
  }
18001
+ function isHttpProtocol(protocol) {
18002
+ return protocol === "http:" || protocol === "https:";
18003
+ }
17980
18004
  function isIdentifierSegment(segment) {
17981
18005
  if (UUID_SEGMENT.test(segment)) return true;
17982
18006
  if (HEX_SEGMENT.test(segment)) return true;
@@ -18014,15 +18038,16 @@ function redactUrlString(value, options) {
18014
18038
  credentialRedacted: false,
18015
18039
  identifiersMasked: false
18016
18040
  };
18017
- if (!looksLikeHttpUrl(value)) return unchanged;
18018
- const url = parseHttpUrl(value);
18041
+ if (!looksLikeUrlForRedaction(value)) return unchanged;
18042
+ const url = parseRedactableUrl(value);
18019
18043
  if (!url) return unchanged;
18020
18044
  const replacement = options.replacement ?? "[REDACTED]";
18021
18045
  const idPlaceholder = options.idPlaceholder ?? "[id]";
18046
+ const http = isHttpProtocol(url.protocol);
18022
18047
  let credentialRedacted = url.username.length > 0 || url.password.length > 0;
18023
18048
  let identifiersMasked = false;
18024
18049
  let pathname = url.pathname;
18025
- if (options.maskPathIds === true) {
18050
+ if (http && options.maskPathIds === true) {
18026
18051
  pathname = url.pathname.split("/").map((segment) => {
18027
18052
  if (segment.length === 0 || !isIdentifierSegment(decodeParam(segment))) {
18028
18053
  return segment;
@@ -20289,6 +20314,19 @@ function valueContainsKeyValueSecret(value) {
20289
20314
 
20290
20315
  // packages/redact/src/url-redaction.ts
20291
20316
  var HTTP_URL2 = /^https?:\/\/[^\s]+$/i;
20317
+ var CONNECTION_PROTOCOLS2 = /* @__PURE__ */ new Set([
20318
+ "postgres:",
20319
+ "postgresql:",
20320
+ "mysql:",
20321
+ "mariadb:",
20322
+ "mongodb:",
20323
+ "mongodb+srv:",
20324
+ "redis:",
20325
+ "rediss:",
20326
+ "amqp:",
20327
+ "amqps:"
20328
+ ]);
20329
+ var CONNECTION_URI2 = /^(?:postgres|postgresql|mysql|mariadb|mongodb(?:\+srv)?|rediss?|amqps?):\/\/[^\s]+$/i;
20292
20330
  var UUID_SEGMENT2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
20293
20331
  var HEX_SEGMENT2 = /^[0-9a-f]{12,}$/i;
20294
20332
  var NUMERIC_SEGMENT2 = /^\d{5,}$/;
@@ -20296,14 +20334,25 @@ var OPAQUE_SEGMENT2 = /^[A-Za-z0-9_-]{20,}$/;
20296
20334
  function looksLikeHttpUrl2(value) {
20297
20335
  return HTTP_URL2.test(value.trim());
20298
20336
  }
20299
- function parseHttpUrl2(value) {
20337
+ function looksLikeConnectionUri2(value) {
20338
+ return CONNECTION_URI2.test(value.trim());
20339
+ }
20340
+ function looksLikeUrlForRedaction2(value) {
20341
+ return looksLikeHttpUrl2(value) || looksLikeConnectionUri2(value);
20342
+ }
20343
+ function parseRedactableUrl2(value) {
20300
20344
  try {
20301
20345
  const url = new URL(value.trim());
20302
- return url.protocol === "http:" || url.protocol === "https:" ? url : void 0;
20346
+ if (url.protocol === "http:" || url.protocol === "https:") return url;
20347
+ if (CONNECTION_PROTOCOLS2.has(url.protocol)) return url;
20348
+ return void 0;
20303
20349
  } catch {
20304
20350
  return void 0;
20305
20351
  }
20306
20352
  }
20353
+ function isHttpProtocol2(protocol) {
20354
+ return protocol === "http:" || protocol === "https:";
20355
+ }
20307
20356
  function isIdentifierSegment2(segment) {
20308
20357
  if (UUID_SEGMENT2.test(segment)) return true;
20309
20358
  if (HEX_SEGMENT2.test(segment)) return true;
@@ -20341,15 +20390,16 @@ function redactUrlString2(value, options) {
20341
20390
  credentialRedacted: false,
20342
20391
  identifiersMasked: false
20343
20392
  };
20344
- if (!looksLikeHttpUrl2(value)) return unchanged;
20345
- const url = parseHttpUrl2(value);
20393
+ if (!looksLikeUrlForRedaction2(value)) return unchanged;
20394
+ const url = parseRedactableUrl2(value);
20346
20395
  if (!url) return unchanged;
20347
20396
  const replacement = options.replacement ?? "[REDACTED]";
20348
20397
  const idPlaceholder = options.idPlaceholder ?? "[id]";
20398
+ const http = isHttpProtocol2(url.protocol);
20349
20399
  let credentialRedacted = url.username.length > 0 || url.password.length > 0;
20350
20400
  let identifiersMasked = false;
20351
20401
  let pathname = url.pathname;
20352
- if (options.maskPathIds === true) {
20402
+ if (http && options.maskPathIds === true) {
20353
20403
  pathname = url.pathname.split("/").map((segment) => {
20354
20404
  if (segment.length === 0 || !isIdentifierSegment2(decodeParam2(segment))) {
20355
20405
  return segment;
@@ -20799,7 +20849,7 @@ var Redactor2 = class {
20799
20849
  return applyRule(rule, value, this.#replacement);
20800
20850
  }
20801
20851
  }
20802
- if (typeof value === "string" && looksLikeHttpUrl2(value)) {
20852
+ if (typeof value === "string" && looksLikeUrlForRedaction2(value)) {
20803
20853
  const url = redactUrlString2(value, {
20804
20854
  sensitiveKeys: this.#sensitiveKeys,
20805
20855
  isSensitiveValue: (candidate) => this.#detect(candidate, key, path44) !== void 0,