@agent-inspect/eval 6.17.6 → 6.17.7

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.cjs CHANGED
@@ -272,6 +272,17 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
272
272
  return false;
273
273
  }
274
274
 
275
+ // packages/redact/src/key-value-secret.ts
276
+ var KEY_VALUE_SECRET_PATTERN_SOURCE = String.raw`\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=([^\s"'\\]{8,})`;
277
+ var KEY_VALUE_SECRET_PATTERN = new RegExp(
278
+ KEY_VALUE_SECRET_PATTERN_SOURCE,
279
+ "i"
280
+ );
281
+ function valueContainsKeyValueSecret(value) {
282
+ KEY_VALUE_SECRET_PATTERN.lastIndex = 0;
283
+ return KEY_VALUE_SECRET_PATTERN.test(value);
284
+ }
285
+
275
286
  // packages/redact/src/index.ts
276
287
  var DEFAULT_REDACT_KEYS = [
277
288
  "authorization",
@@ -478,6 +489,15 @@ var credentialDetectors = [
478
489
  pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*-----END [A-Z ]*PRIVATE KEY-----/,
479
490
  severity: "error"
480
491
  }),
492
+ {
493
+ id: "value.keyValueSecret",
494
+ severity: "error",
495
+ matchKind: "value",
496
+ detect(input) {
497
+ if (typeof input.value !== "string") return [];
498
+ return valueContainsKeyValueSecret(input.value) ? [{ action: "replace", severity: "error", matchKind: "value" }] : [];
499
+ }
500
+ },
481
501
  {
482
502
  id: "value.creditCard",
483
503
  severity: "error",