@agent-inspect/eval 6.17.6 → 6.17.8

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.mjs CHANGED
@@ -266,6 +266,17 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
266
266
  return false;
267
267
  }
268
268
 
269
+ // packages/redact/src/key-value-secret.ts
270
+ var KEY_VALUE_SECRET_PATTERN_SOURCE = String.raw`\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=([^\s"'\\]{8,})`;
271
+ var KEY_VALUE_SECRET_PATTERN = new RegExp(
272
+ KEY_VALUE_SECRET_PATTERN_SOURCE,
273
+ "i"
274
+ );
275
+ function valueContainsKeyValueSecret(value) {
276
+ KEY_VALUE_SECRET_PATTERN.lastIndex = 0;
277
+ return KEY_VALUE_SECRET_PATTERN.test(value);
278
+ }
279
+
269
280
  // packages/redact/src/index.ts
270
281
  var DEFAULT_REDACT_KEYS = [
271
282
  "authorization",
@@ -472,6 +483,15 @@ var credentialDetectors = [
472
483
  pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*-----END [A-Z ]*PRIVATE KEY-----/,
473
484
  severity: "error"
474
485
  }),
486
+ {
487
+ id: "value.keyValueSecret",
488
+ severity: "error",
489
+ matchKind: "value",
490
+ detect(input) {
491
+ if (typeof input.value !== "string") return [];
492
+ return valueContainsKeyValueSecret(input.value) ? [{ action: "replace", severity: "error", matchKind: "value" }] : [];
493
+ }
494
+ },
475
495
  {
476
496
  id: "value.creditCard",
477
497
  severity: "error",