@agent-inspect/eval 6.17.3 → 6.17.4

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Deterministic local eval rules over AgentInspect traces (no LLM judge by default).
4
4
 
5
5
 
6
- **Support level:** Supported — see [SUPPORT-LEVELS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/SUPPORT-LEVELS.md).
6
+ **Support level:** Supported — see [SUPPORT-LEVELS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/SUPPORT-LEVELS.md). Network behavior: [NETWORK-BEHAVIOR.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/NETWORK-BEHAVIOR.md).
7
7
 
8
8
  ## When to use
9
9
 
package/dist/index.cjs CHANGED
@@ -223,8 +223,11 @@ function runCircuits(events, options = {}) {
223
223
  }
224
224
 
225
225
  // packages/redact/src/sensitive-key.ts
226
+ function keyHasExplicitSeparator(value) {
227
+ return /[_\-.]/.test(value);
228
+ }
226
229
  function normalizeSensitiveKey(value) {
227
- return value.toLowerCase().replace(/[^a-z0-9_]/g, "");
230
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
228
231
  }
229
232
  var NON_CREDENTIAL_TOKEN_CONFIG_KEYS = new Set(
230
233
  [
@@ -254,6 +257,7 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
254
257
  const normalized = normalizeSensitiveKey(key);
255
258
  if (!normalized) return false;
256
259
  if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS.has(normalized)) return false;
260
+ const allowPrefixCompound = keyHasExplicitSeparator(key);
257
261
  for (const sensitive of sensitiveKeys) {
258
262
  const s = normalizeSensitiveKey(sensitive);
259
263
  if (!s) continue;
@@ -262,7 +266,8 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
262
266
  continue;
263
267
  }
264
268
  if (normalized === s) return true;
265
- if (normalized.endsWith(`_${s}`) || normalized.startsWith(`${s}_`)) return true;
269
+ if (normalized.endsWith(`_${s}`)) return true;
270
+ if (allowPrefixCompound && normalized.startsWith(`${s}_`)) return true;
266
271
  }
267
272
  return false;
268
273
  }