agent-inspect 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/CHANGELOG.md +22 -0
- package/README.md +1 -1
- package/docs/CLI.md +27 -5
- package/docs/TRACE-CONTRACTS.md +10 -7
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-XWQEHKGB.mjs → chunk-BDRJENLM.mjs} +2334 -102
- package/packages/cli/dist/chunk-BDRJENLM.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +3122 -168
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +793 -61
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-XNC4EUN3.mjs → src-ZUGAUXY6.mjs} +3 -3
- package/packages/cli/dist/{src-XNC4EUN3.mjs.map → src-ZUGAUXY6.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +19 -1
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +2 -2
- package/packages/core/dist/advanced.d.ts +2 -2
- package/packages/core/dist/advanced.mjs +2 -2
- package/packages/core/dist/checks.cjs +33 -1
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +2 -2
- package/packages/core/dist/checks.d.ts +2 -2
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-TU47EKKS.mjs → chunk-OOX25GTH.mjs} +35 -3
- package/packages/core/dist/chunk-OOX25GTH.mjs.map +1 -0
- package/packages/core/dist/{index-DvSbXNot.d.ts → index-7hG_qggp.d.ts} +5 -0
- package/packages/core/dist/{index-DKv7esIo.d.cts → index-CQJUNPPe.d.cts} +5 -0
- package/packages/cli/dist/chunk-XWQEHKGB.mjs.map +0 -1
- package/packages/core/dist/chunk-TU47EKKS.mjs.map +0 -1
|
@@ -6,8 +6,8 @@ import { a as InspectRunTree } from './inspect-event-ClM5Z8om.cjs';
|
|
|
6
6
|
export { b as ATTRIBUTION_CONFIDENCES, c as ATTRIBUTION_CONFIDENCE_RANK, A as AttributionConfidence, E as EventSource, d as InspectEvent, I as InspectKind, e as InspectNode, i as isAttributionConfidence } from './inspect-event-ClM5Z8om.cjs';
|
|
7
7
|
import { P as PersistedInspectEvent } from './persisted-inspect-event-q2ViiBW6.cjs';
|
|
8
8
|
import { Stats } from 'node:fs';
|
|
9
|
-
import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-
|
|
10
|
-
export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-
|
|
9
|
+
import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-CQJUNPPe.cjs';
|
|
10
|
+
export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-CQJUNPPe.cjs';
|
|
11
11
|
import { b as ObservedOutcome } from './types-BA_IOdg4.cjs';
|
|
12
12
|
export { a as ObservedOutcomeStatus } from './types-BA_IOdg4.cjs';
|
|
13
13
|
import './writers.cjs';
|
|
@@ -6,8 +6,8 @@ import { a as InspectRunTree } from './inspect-event-ClM5Z8om.js';
|
|
|
6
6
|
export { b as ATTRIBUTION_CONFIDENCES, c as ATTRIBUTION_CONFIDENCE_RANK, A as AttributionConfidence, E as EventSource, d as InspectEvent, I as InspectKind, e as InspectNode, i as isAttributionConfidence } from './inspect-event-ClM5Z8om.js';
|
|
7
7
|
import { P as PersistedInspectEvent } from './persisted-inspect-event-DG02LhEP.js';
|
|
8
8
|
import { Stats } from 'node:fs';
|
|
9
|
-
import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-
|
|
10
|
-
export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-
|
|
9
|
+
import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-7hG_qggp.js';
|
|
10
|
+
export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-7hG_qggp.js';
|
|
11
11
|
import { b as ObservedOutcome } from './types-BA_IOdg4.js';
|
|
12
12
|
export { a as ObservedOutcomeStatus } from './types-BA_IOdg4.js';
|
|
13
13
|
import './writers.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { extractSessionWorkflowMetadata, sessionKeyForRun, defineTraceContract, runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-
|
|
2
|
-
export { extractSessionWorkflowMetadata, sessionKeyForRun } from './chunk-
|
|
1
|
+
import { extractSessionWorkflowMetadata, sessionKeyForRun, defineTraceContract, runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-OOX25GTH.mjs';
|
|
2
|
+
export { extractSessionWorkflowMetadata, sessionKeyForRun } from './chunk-OOX25GTH.mjs';
|
|
3
3
|
export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-ZFJ2ICTC.mjs';
|
|
4
4
|
import { buildRunTimeline, filterTraces, extractMetadata, buildRunSummary } from './chunk-KWBO36PH.mjs';
|
|
5
5
|
export { buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildTraceStats, extractMetadata, filterTraces, formatStepLabel, renderRunWhat, renderTimeline, renderTraceStats } from './chunk-KWBO36PH.mjs';
|
|
@@ -3981,6 +3981,18 @@ function limitFindings(findings, maxFindings) {
|
|
|
3981
3981
|
function hasRedactionMarker(value, markers) {
|
|
3982
3982
|
return markers.some((marker) => value.includes(marker)) || /^\[HASH:[A-Za-z0-9_-]+\]$/.test(value);
|
|
3983
3983
|
}
|
|
3984
|
+
function isFullyRedactedValue(value, markers = ["[REDACTED]", "[REDACTED:"]) {
|
|
3985
|
+
if (typeof value !== "string") return false;
|
|
3986
|
+
const trimmed = value.trim();
|
|
3987
|
+
if (trimmed.length === 0) return false;
|
|
3988
|
+
if (/^\[HASH:[A-Za-z0-9_-]+\]$/.test(trimmed)) return true;
|
|
3989
|
+
if (/^\[REDACTED:[^\]]*\]$/.test(trimmed)) return true;
|
|
3990
|
+
for (const marker of markers) {
|
|
3991
|
+
if (marker.endsWith(":")) continue;
|
|
3992
|
+
if (trimmed === marker) return true;
|
|
3993
|
+
}
|
|
3994
|
+
return false;
|
|
3995
|
+
}
|
|
3984
3996
|
function isSensitiveKey(key, sensitiveKeys) {
|
|
3985
3997
|
return isCredentialSensitiveKey(key, sensitiveKeys);
|
|
3986
3998
|
}
|
|
@@ -4335,8 +4347,26 @@ function createToolUsageRule(options) {
|
|
|
4335
4347
|
const findings = [];
|
|
4336
4348
|
for (const required of options.required ?? []) {
|
|
4337
4349
|
if (!nameSet.has(required)) {
|
|
4350
|
+
const otherKinds = [
|
|
4351
|
+
...new Set(
|
|
4352
|
+
context.events.filter((event) => {
|
|
4353
|
+
const kind = typeof event.kind === "string" ? event.kind.toUpperCase() : "";
|
|
4354
|
+
if (kind === "TOOL") return false;
|
|
4355
|
+
return resolveCanonicalToolName(event) === required || event.name === required || event.name === `tool:${required}` || event.name.endsWith(`:${required}`);
|
|
4356
|
+
}).map(
|
|
4357
|
+
(event) => typeof event.kind === "string" ? event.kind.toUpperCase() : "UNKNOWN"
|
|
4358
|
+
)
|
|
4359
|
+
)
|
|
4360
|
+
].sort();
|
|
4361
|
+
const hint = otherKinds.length > 0 ? ` Required name appears under non-TOOL kind(s): ${otherKinds.join(", ")}. tools.required / requiredOrder match TOOL events only.` : "";
|
|
4338
4362
|
findings.push(
|
|
4339
|
-
failFinding(
|
|
4363
|
+
failFinding(
|
|
4364
|
+
"tool.usage",
|
|
4365
|
+
`Required tool ${required} did not appear.${hint}`,
|
|
4366
|
+
runEvidence(context.selectedRun),
|
|
4367
|
+
required,
|
|
4368
|
+
names
|
|
4369
|
+
)
|
|
4340
4370
|
);
|
|
4341
4371
|
}
|
|
4342
4372
|
}
|
|
@@ -5059,6 +5089,7 @@ function createSafetyRedactionRule(options = {}) {
|
|
|
5059
5089
|
function createSafetyRawContentRule(options = {}) {
|
|
5060
5090
|
const forbiddenKeys = options.forbiddenKeys ?? DEFAULT_RAW_CONTENT_KEYS;
|
|
5061
5091
|
const safePathPrefixes = options.safePathPrefixes ?? DEFAULT_SAFE_RAW_CONTENT_PATH_PREFIXES;
|
|
5092
|
+
const markers = options.redactedMarkers ?? ["[REDACTED]", "[REDACTED:"];
|
|
5062
5093
|
return {
|
|
5063
5094
|
id: "safety.rawPrompt",
|
|
5064
5095
|
category: "safety",
|
|
@@ -5069,6 +5100,7 @@ function createSafetyRawContentRule(options = {}) {
|
|
|
5069
5100
|
for (const entry of eventValueEntries(event, { includeSummaries: options.includeSummaries })) {
|
|
5070
5101
|
const key = entry.key ?? lastPathSegment(entry.path);
|
|
5071
5102
|
if (!isRawContentPath(entry.path, key, forbiddenKeys, safePathPrefixes)) continue;
|
|
5103
|
+
if (isFullyRedactedValue(entry.value, markers)) continue;
|
|
5072
5104
|
findings.push(
|
|
5073
5105
|
failFinding(
|
|
5074
5106
|
"safety.rawPrompt",
|