@agent-inspect/mcp-server 6.29.4 → 6.29.6

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.
@@ -256,6 +256,17 @@ function isTraceEvent(value) {
256
256
  }
257
257
  }
258
258
 
259
+ // packages/core/src/types/inspect-event.ts
260
+ var ATTRIBUTION_CONFIDENCES = [
261
+ "unknown",
262
+ "heuristic",
263
+ "correlated",
264
+ "explicit"
265
+ ];
266
+ function isAttributionConfidence(value) {
267
+ return typeof value === "string" && ATTRIBUTION_CONFIDENCES.includes(value);
268
+ }
269
+
259
270
  // packages/core/src/types/persisted-inspect-event.ts
260
271
  var INSPECT_KINDS = [
261
272
  "RUN",
@@ -271,12 +282,6 @@ var INSPECT_KINDS = [
271
282
  "LOG",
272
283
  "OUTCOME"
273
284
  ];
274
- var ATTRIBUTION_CONFIDENCES = [
275
- "explicit",
276
- "correlated",
277
- "heuristic",
278
- "unknown"
279
- ];
280
285
  var PERSISTED_EVENT_SOURCE_TYPES = [
281
286
  "manual",
282
287
  "json-log",
@@ -312,9 +317,6 @@ function isOptionalNonNegativeNumber(value) {
312
317
  function isInspectKind(value) {
313
318
  return typeof value === "string" && INSPECT_KINDS.includes(value);
314
319
  }
315
- function isAttributionConfidence(value) {
316
- return typeof value === "string" && ATTRIBUTION_CONFIDENCES.includes(value);
317
- }
318
320
  function isPersistedEventSourceType(value) {
319
321
  return typeof value === "string" && PERSISTED_EVENT_SOURCE_TYPES.includes(value);
320
322
  }
@@ -3637,6 +3639,18 @@ function limitFindings(findings, maxFindings) {
3637
3639
  function hasRedactionMarker(value, markers) {
3638
3640
  return markers.some((marker) => value.includes(marker)) || /^\[HASH:[A-Za-z0-9_-]+\]$/.test(value);
3639
3641
  }
3642
+ function isFullyRedactedValue(value, markers = ["[REDACTED]", "[REDACTED:"]) {
3643
+ if (typeof value !== "string") return false;
3644
+ const trimmed = value.trim();
3645
+ if (trimmed.length === 0) return false;
3646
+ if (/^\[HASH:[A-Za-z0-9_-]+\]$/.test(trimmed)) return true;
3647
+ if (/^\[REDACTED:[^\]]*\]$/.test(trimmed)) return true;
3648
+ for (const marker of markers) {
3649
+ if (marker.endsWith(":")) continue;
3650
+ if (trimmed === marker) return true;
3651
+ }
3652
+ return false;
3653
+ }
3640
3654
  function isSensitiveKey(key, sensitiveKeys) {
3641
3655
  return isCredentialSensitiveKey(key, sensitiveKeys);
3642
3656
  }
@@ -3734,6 +3748,7 @@ function createSafetyRedactionRule(options = {}) {
3734
3748
  function createSafetyRawContentRule(options = {}) {
3735
3749
  const forbiddenKeys = options.forbiddenKeys ?? DEFAULT_RAW_CONTENT_KEYS;
3736
3750
  const safePathPrefixes = options.safePathPrefixes ?? DEFAULT_SAFE_RAW_CONTENT_PATH_PREFIXES;
3751
+ const markers = options.redactedMarkers ?? ["[REDACTED]", "[REDACTED:"];
3737
3752
  return {
3738
3753
  id: "safety.rawPrompt",
3739
3754
  category: "safety",
@@ -3744,6 +3759,7 @@ function createSafetyRawContentRule(options = {}) {
3744
3759
  for (const entry of eventValueEntries(event, { includeSummaries: options.includeSummaries })) {
3745
3760
  const key = entry.key ?? lastPathSegment(entry.path);
3746
3761
  if (!isRawContentPath(entry.path, key, forbiddenKeys, safePathPrefixes)) continue;
3762
+ if (isFullyRedactedValue(entry.value, markers)) continue;
3747
3763
  findings.push(
3748
3764
  failFinding(
3749
3765
  "safety.rawPrompt",
@@ -8729,5 +8745,5 @@ async function runReadOnlyMcpServer(options = {}) {
8729
8745
  }
8730
8746
 
8731
8747
  export { MCP_MAX_REQUEST_BYTES, MCP_PROTOCOL_VERSION, MCP_SERVER_INSTRUCTIONS, READ_ONLY_TOOLS, TRACE_DATA_UNTRUSTED_WARNING, callReadOnlyTool, createMcpServerContext, handleMcpProtocolLine, runReadOnlyMcpServer };
8732
- //# sourceMappingURL=chunk-K47MV5AJ.mjs.map
8733
- //# sourceMappingURL=chunk-K47MV5AJ.mjs.map
8748
+ //# sourceMappingURL=chunk-O7IT6DMO.mjs.map
8749
+ //# sourceMappingURL=chunk-O7IT6DMO.mjs.map