agent-inspect 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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, resolveBundleRunIds, getTraceFilePath, openTrace, sha256Hex, collectTraceSchemaVersions, aggregateBundleSafeStatus, bundleFailsOnSafety, bundleRunAssetRelativePath, buildPlaceholderArtifact, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceHtmlShell, buildEvidenceProvenanceViewHtml, EVIDENCE_FORMAT_VERSION, inferEvidenceFileRole, buildEvidenceSafetyViewHtml, buildEvidenceDiffViewHtml, buildEvidenceCircuitViewHtml, buildEvidenceOutcomesViewHtml, buildEvidenceContractsViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceCausalFailureViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceTreeViewHtml, buildEvidenceManifest, serializeEvidenceManifest, buildZipArchive, assertBundlePathContained, enrichSessionRunRecord, normalizeBundleOutputPath, sanitizeBundleRunId, defaultBundleOutputPath, runTraceChecks, assertEvidenceRelativePath, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, TraceReadError, resolveRedactionProfile, applyProfileMetadataCaps, Redactor, flattenTree, escapeHtml, safeString, compactAttributes, stableJson, escapeMarkdown, truncateStringForProfile, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, isAgentInspectTrace, filterMetasBySessionScope, aggregateSessionCheckResults, createBaselineRegressionRule, summarizeSemanticParity, buildEvidenceCiPackage, verifyEvidenceDirectory, diffTraceEvents, renderRunDiff, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, formatStepLabel, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, renderErrorLine, getIndent, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, diffRuns, manualTraceEventsToComparableRun } from './chunk-GOHYSE7W.mjs';
2
+ import { createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createSafetyOversizedAttributeRule, resolveTraceDir, parseDuration, buildSessionIndex, resolveBundleRunIds, getTraceFilePath, openTrace, sha256Hex, collectTraceSchemaVersions, aggregateBundleSafeStatus, bundleFailsOnSafety, bundleRunAssetRelativePath, buildPlaceholderArtifact, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceHtmlShell, buildEvidenceProvenanceViewHtml, EVIDENCE_FORMAT_VERSION, inferEvidenceFileRole, buildEvidenceSafetyViewHtml, buildEvidenceDiffViewHtml, buildEvidenceCircuitViewHtml, buildEvidenceOutcomesViewHtml, buildEvidenceContractsViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceCausalFailureViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceTreeViewHtml, buildEvidenceManifest, serializeEvidenceManifest, buildZipArchive, assertBundlePathContained, enrichSessionRunRecord, normalizeBundleOutputPath, sanitizeBundleRunId, defaultBundleOutputPath, runTraceChecks, assertEvidenceRelativePath, TraceDirectory, loadTraceMetadataList, loadSessionRunRecords, TraceReadError, resolveRedactionProfile, applyProfileMetadataCaps, Redactor, flattenTree, escapeHtml, safeString, compactAttributes, stableJson, escapeMarkdown, truncateStringForProfile, extractMetadata, filterTraces, truncateName, buildRunSummary, formatDuration, formatTimestamp, isAgentInspectTrace, filterMetasBySessionScope, aggregateSessionCheckResults, createBaselineRegressionRule, summarizeSemanticParity, buildEvidenceCiPackage, verifyEvidenceDirectory, diffTraceEvents, renderRunDiff, buildRunTimeline, renderTimeline, buildTraceStats, renderTraceStats, parseDurationFilter, searchTraces, formatStepLabel, buildActivitySummary, renderActivitySummaryHuman, buildRunWhatSummary, renderRunWhat, buildLocalExplanation, resolveSuiteTemplate, defaultSuiteConfigTemplate, loadSuiteConfig, validateSuiteConfig, runSuite, renderSuiteReport, analyzeCohort, renderCohortReport, gateHasThresholds, runGate, renderGateReport, persistedInspectEventsToTraceEvents, renderStepLine, renderErrorLine, getIndent, TreeBuilder, zeroKinds, validateEvent, traceEventToPersistedInspectEvent, isPersistedInspectEvent, createRunStatusRule, createStructureOrphanRule, createStructureCycleRule, createRunDurationRule, createMaxStepDurationRule, createRequireCompletedRule, createStallDetectionRule, createObservedOutcomeRule, createRunDepthRule, createToolUsageRule, createLlmUsageRule, createStructureRelationshipRule, createStructureParallelWidthRule, summarizeObservedOutcomes, extractOutcomesFromTraceEvents, renderObservedOutcomesMarkdown, renderObservedOutcomesHtml, DEFAULT_SUITE_ARTIFACTS_DIR, parseCohortMetricList, COHORT_METRIC_IDS, parseGateList, nanoid, diffRuns, manualTraceEventsToComparableRun } from './chunk-25LUDS4T.mjs';
3
3
  import { realpathSync, constants as constants$1, existsSync, readFileSync } from 'fs';
4
4
  import path18 from 'path';
5
5
  import { fileURLToPath, pathToFileURL } from 'url';
@@ -13,7 +13,7 @@ import { createServer } from 'http';
13
13
  import { createRequire } from 'module';
14
14
 
15
15
  // package.json
16
- var version = "6.17.6";
16
+ var version = "6.17.7";
17
17
 
18
18
  // packages/cli/src/trace-dir-scale.ts
19
19
  var TRACE_COUNT_WARN = 1e3;
@@ -3353,7 +3353,7 @@ async function newestTraceMtimeMs(traceDir) {
3353
3353
  }
3354
3354
  async function loadSessionRuns(traceDir) {
3355
3355
  try {
3356
- const mod = await import('./src-OYGG7QAZ.mjs');
3356
+ const mod = await import('./src-2FS6BLR7.mjs');
3357
3357
  const dbPath = mod.resolveIndexDbPath(traceDir);
3358
3358
  const status = mod.indexStatus(dbPath);
3359
3359
  if (!status.healthy) {
@@ -3875,6 +3875,17 @@ function isCredentialSensitiveKey(key, sensitiveKeys) {
3875
3875
  return false;
3876
3876
  }
3877
3877
 
3878
+ // packages/redact/src/key-value-secret.ts
3879
+ var KEY_VALUE_SECRET_PATTERN_SOURCE = String.raw`\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=([^\s"'\\]{8,})`;
3880
+ var KEY_VALUE_SECRET_PATTERN = new RegExp(
3881
+ KEY_VALUE_SECRET_PATTERN_SOURCE,
3882
+ "i"
3883
+ );
3884
+ function valueContainsKeyValueSecret(value) {
3885
+ KEY_VALUE_SECRET_PATTERN.lastIndex = 0;
3886
+ return KEY_VALUE_SECRET_PATTERN.test(value);
3887
+ }
3888
+
3878
3889
  // packages/redact/src/index.ts
3879
3890
  var DEFAULT_REDACT_KEYS2 = [
3880
3891
  "authorization",
@@ -4081,6 +4092,15 @@ var credentialDetectors = [
4081
4092
  pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*-----END [A-Z ]*PRIVATE KEY-----/,
4082
4093
  severity: "error"
4083
4094
  }),
4095
+ {
4096
+ id: "value.keyValueSecret",
4097
+ severity: "error",
4098
+ matchKind: "value",
4099
+ detect(input3) {
4100
+ if (typeof input3.value !== "string") return [];
4101
+ return valueContainsKeyValueSecret(input3.value) ? [{ action: "replace", severity: "error", matchKind: "value" }] : [];
4102
+ }
4103
+ },
4084
4104
  {
4085
4105
  id: "value.creditCard",
4086
4106
  severity: "error",
@@ -5800,12 +5820,30 @@ function uniqueSelectIds(ids) {
5800
5820
  }
5801
5821
  return out;
5802
5822
  }
5823
+ function resolveForbiddenToolOptions(options) {
5824
+ const merged = [...options.forbiddenTool ?? [], ...options.forbidTool ?? []];
5825
+ const seen = /* @__PURE__ */ new Set();
5826
+ const out = [];
5827
+ for (const name of merged) {
5828
+ if (seen.has(name)) continue;
5829
+ seen.add(name);
5830
+ out.push(name);
5831
+ }
5832
+ return out;
5833
+ }
5834
+ function withResolvedForbiddenTools(options) {
5835
+ return {
5836
+ ...options,
5837
+ forbiddenTool: resolveForbiddenToolOptions(options),
5838
+ forbidTool: void 0
5839
+ };
5840
+ }
5803
5841
  function cliShorthandSelectIds(options) {
5804
5842
  const ids = [];
5805
5843
  if (options.failOnObservation !== void 0 && options.failOnObservation.trim() !== "") {
5806
5844
  ids.push("outcome.status");
5807
5845
  }
5808
- if ((options.requiredTool?.length ?? 0) > 0 || (options.forbiddenTool?.length ?? 0) > 0) {
5846
+ if ((options.requiredTool?.length ?? 0) > 0 || (options.forbiddenTool?.length ?? 0) > 0 || (options.forbidTool?.length ?? 0) > 0) {
5809
5847
  ids.push("tool.usage");
5810
5848
  }
5811
5849
  if ((options.allowedModel?.length ?? 0) > 0 || options.maxTotalTokens !== void 0) {
@@ -6526,6 +6564,7 @@ function readErrorResult(error) {
6526
6564
  );
6527
6565
  }
6528
6566
  async function checkCommand(target, options = {}, stdin = process.stdin) {
6567
+ options = withResolvedForbiddenTools(options);
6529
6568
  let result;
6530
6569
  let phase = "config";
6531
6570
  let evidenceRead;
@@ -11632,7 +11671,7 @@ function isModuleNotFound4(e) {
11632
11671
  }
11633
11672
  async function loadIndexSqlite() {
11634
11673
  try {
11635
- return await import('./src-OYGG7QAZ.mjs');
11674
+ return await import('./src-2FS6BLR7.mjs');
11636
11675
  } catch (e) {
11637
11676
  if (isModuleNotFound4(e)) {
11638
11677
  console.error(
@@ -12521,6 +12560,9 @@ function createCliProgram() {
12521
12560
  ]).option("--forbidden-tool <name>", "forbid a tool name (repeatable)", (value, previous = []) => [
12522
12561
  ...previous,
12523
12562
  value
12563
+ ]).option("--forbid-tool <name>", "alias for --forbidden-tool (repeatable)", (value, previous = []) => [
12564
+ ...previous,
12565
+ value
12524
12566
  ]).option("--allowed-model <model>", "allow an LLM model (repeatable)", (value, previous = []) => [
12525
12567
  ...previous,
12526
12568
  value