@agent-inspect/mcp-server 6.29.5 → 6.30.0

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/cli.cjs CHANGED
@@ -3649,6 +3649,18 @@ function limitFindings(findings, maxFindings) {
3649
3649
  function hasRedactionMarker(value, markers) {
3650
3650
  return markers.some((marker) => value.includes(marker)) || /^\[HASH:[A-Za-z0-9_-]+\]$/.test(value);
3651
3651
  }
3652
+ function isFullyRedactedValue(value, markers = ["[REDACTED]", "[REDACTED:"]) {
3653
+ if (typeof value !== "string") return false;
3654
+ const trimmed = value.trim();
3655
+ if (trimmed.length === 0) return false;
3656
+ if (/^\[HASH:[A-Za-z0-9_-]+\]$/.test(trimmed)) return true;
3657
+ if (/^\[REDACTED:[^\]]*\]$/.test(trimmed)) return true;
3658
+ for (const marker of markers) {
3659
+ if (marker.endsWith(":")) continue;
3660
+ if (trimmed === marker) return true;
3661
+ }
3662
+ return false;
3663
+ }
3652
3664
  function isSensitiveKey(key, sensitiveKeys) {
3653
3665
  return isCredentialSensitiveKey(key, sensitiveKeys);
3654
3666
  }
@@ -3746,6 +3758,7 @@ function createSafetyRedactionRule(options = {}) {
3746
3758
  function createSafetyRawContentRule(options = {}) {
3747
3759
  const forbiddenKeys = options.forbiddenKeys ?? DEFAULT_RAW_CONTENT_KEYS;
3748
3760
  const safePathPrefixes = options.safePathPrefixes ?? DEFAULT_SAFE_RAW_CONTENT_PATH_PREFIXES;
3761
+ const markers = options.redactedMarkers ?? ["[REDACTED]", "[REDACTED:"];
3749
3762
  return {
3750
3763
  id: "safety.rawPrompt",
3751
3764
  category: "safety",
@@ -3756,6 +3769,7 @@ function createSafetyRawContentRule(options = {}) {
3756
3769
  for (const entry of eventValueEntries(event, { includeSummaries: options.includeSummaries })) {
3757
3770
  const key = entry.key ?? lastPathSegment(entry.path);
3758
3771
  if (!isRawContentPath(entry.path, key, forbiddenKeys, safePathPrefixes)) continue;
3772
+ if (isFullyRedactedValue(entry.value, markers)) continue;
3759
3773
  findings.push(
3760
3774
  failFinding(
3761
3775
  "safety.rawPrompt",