agent-inspect 6.17.5 → 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.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/docs/API.md +1 -1
- package/docs/CLI.md +2 -2
- package/docs/GETTING-STARTED.md +2 -1
- package/docs/SAFE-TRACE-SHARING.md +5 -1
- package/package.json +4 -4
- package/packages/cli/dist/{chunk-GOHYSE7W.mjs → chunk-25LUDS4T.mjs} +30 -25
- package/packages/cli/dist/chunk-25LUDS4T.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +116 -28
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +91 -8
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-OYGG7QAZ.mjs → src-2FS6BLR7.mjs} +3 -3
- package/packages/cli/dist/{src-OYGG7QAZ.mjs.map → src-2FS6BLR7.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +23 -22
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +24 -23
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +5 -1
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-DIZPIPY2.mjs → chunk-LQC7IED3.mjs} +7 -3
- package/packages/core/dist/chunk-LQC7IED3.mjs.map +1 -0
- package/packages/cli/dist/chunk-GOHYSE7W.mjs.map +0 -1
- package/packages/core/dist/chunk-DIZPIPY2.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 6.17.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f66c77a: Align high-confidence key/value credential redaction with verify-safe `key-value-secret` detection (for example `internal_token=<credential>`), keep path findings review-only, and document that redact remains best-effort (#327).
|
|
8
|
+
- 4d617f5: Clarify that `observe()` records only the top-level run boundary (no invented `step_*` events), and accept `check --forbid-tool` as a compatibility alias for `--forbidden-tool`.
|
|
9
|
+
- 0f4ada3: Fix `search --name` + `--status` so run-level filters are applied conjunctively and status-only hits no longer bypass a non-matching name (#323). Unblock CI after Vitest 3 coverage hangs: serialize local `npm install` in compat fixtures, exclude those suites from coverage workers, and run them as a separate non-coverage CI step.
|
|
10
|
+
|
|
11
|
+
## 6.17.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 075dc87: Security containment: enforce Studio ingest byte limits, reject symlinks, stream and atomically stage imports (bundle / file-drop / GitHub / HTTP), remediate Vitest/nanoid and website/example advisories, add the default-workflow no-egress harness (#225), lock the published API surface snapshot (#211), correct Evidence format docs (no signing; required sourceHashes), and extend free-text redaction residual coverage.
|
|
16
|
+
|
|
3
17
|
## 6.17.5
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ The root package is enough for custom capture, the CLI, checks, and Evidence wor
|
|
|
210
210
|
|
|
211
211
|
## Status and documentation
|
|
212
212
|
|
|
213
|
-
**Current published baseline:** **6.17.
|
|
213
|
+
**Current published baseline:** **6.17.7** · persisted schema `1.0` · Node.js `>=20` · MIT.
|
|
214
214
|
|
|
215
215
|
Legacy v0.1 and v0.2 traces remain readable. Check the npm badge and [changelog](CHANGELOG.md) for the current published version.
|
|
216
216
|
|
package/docs/API.md
CHANGED
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
- **`step(name, fn, options?)`**: traces a named unit of work inside `inspectRun` (`step_started` / `step_completed`). Step `metadata` inherits the parent run's redaction and size-bound settings.
|
|
84
84
|
- **`step.llm(model, fn)`**: convenience wrapper (`type: "llm"`, `metadata.model`).
|
|
85
85
|
- **`step.tool(toolName, fn)`**: convenience wrapper (`type: "tool"`, `metadata.toolName`).
|
|
86
|
-
- **`observe(agent, options?)`**: proxy wrapper that traces top-level `run` / `execute` / `invoke` methods via `inspectRun`.
|
|
86
|
+
- **`observe(agent, options?)`**: proxy wrapper that traces top-level `run` / `execute` / `invoke` methods via `inspectRun`. Does not invent nested `step_*` events inside those methods; use `step()` / adapters for an internal tree.
|
|
87
87
|
- **`observeOutcome(name, options)`** (v4.4.0+): records an observed outcome (`outcome_observed`) inside an active `inspectRun` context. Requires `expectation` and `status` (`passed` | `failed` | `unknown` | `skipped`); optional `method`, `actual`, and `evidence`. Outside a run → warn and no-op (never throws). `actual` / `evidence` are bounded and redacted before disk.
|
|
88
88
|
- **`getCurrentCorrelationMetadata()`**: returns active run correlation fields (`correlationId`, `requestId`, `decisionId`, `groupId`) inside `inspectRun` / `maybeInspectRun`; `undefined` outside a traced run or when none were set.
|
|
89
89
|
- **`RedactionProfile`**: `"local" | "share" | "strict"` — see `redactionProfile` on `InspectRunOptions` and `ExportOptions`.
|
package/docs/CLI.md
CHANGED
|
@@ -312,7 +312,7 @@ Options:
|
|
|
312
312
|
- `--json`: print deterministic `TraceCheckResult` JSON
|
|
313
313
|
- `--rule <id>`: select a rule id; repeatable
|
|
314
314
|
- `--max-duration-ms <number>`: add `run.duration`
|
|
315
|
-
- `--required-tool <name>` / `--forbidden-tool <name
|
|
315
|
+
- `--required-tool <name>` / `--forbidden-tool <name>` / `--forbid-tool <name>` (alias): add `tool.usage`
|
|
316
316
|
- `--allowed-model <model>` / `--max-total-tokens <number>`: add `llm.usage`
|
|
317
317
|
- `--session <id>`: check all runs in a workflow session (uses `--dir`; target may be `.`)
|
|
318
318
|
- `--group <id>`: check all runs sharing a `groupId` metadata value
|
|
@@ -324,7 +324,7 @@ Options:
|
|
|
324
324
|
- `trajectory`: completion/structure/relationship focus; excludes share-safety findings
|
|
325
325
|
- `safety`: raw-content / secret / redaction focus
|
|
326
326
|
- `comprehensive`: union of trajectory and safety
|
|
327
|
-
- Presets are a base select set. CLI shorthands on the same invocation (`--fail-on-observation`, `--required-tool`, `--forbidden-tool`, `--allowed-model`, `--max-total-tokens`, `--max-duration-ms`, `--max-step-duration`, `--detect-stalls`) extend that set; they are not dropped because the preset already selected rules. Config `checks.select` is not silently expanded with unrelated configured rules.
|
|
327
|
+
- Presets are a base select set. CLI shorthands on the same invocation (`--fail-on-observation`, `--required-tool`, `--forbidden-tool` / `--forbid-tool`, `--allowed-model`, `--max-total-tokens`, `--max-duration-ms`, `--max-step-duration`, `--detect-stalls`) extend that set; they are not dropped because the preset already selected rules. Config `checks.select` is not silently expanded with unrelated configured rules.
|
|
328
328
|
- `--evidence-on <fail|always|never>`: write local Evidence v2 (no upload); omitted = never
|
|
329
329
|
- `--evidence-dir <path>`: Evidence output directory or base path
|
|
330
330
|
- `--evidence-profile <local|share|strict>`: redaction profile for Evidence (default `share`)
|
package/docs/GETTING-STARTED.md
CHANGED
|
@@ -74,7 +74,8 @@ await agent.run({
|
|
|
74
74
|
This writes a local JSONL trace with stable event names (`schemaVersion: "0.1"`) when the observed `run` method is called:
|
|
75
75
|
|
|
76
76
|
- `run_started`, `run_completed`
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
`observe()` records only that top-level `run` / `execute` / `invoke` boundary. It does **not** invent internal `step_*` events for work inside the method body. Use explicit `step()` / `step.tool()` / `step.llm()`, or a framework adapter, when you need a nested execution tree.
|
|
78
79
|
|
|
79
80
|
## 3. Manually instrument custom flows
|
|
80
81
|
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
AgentInspect traces, log-ingest outputs, and exports are local files. They may still contain sensitive metadata that you attached manually, collected from logs, or included through optional preview settings. Use this checklist before sharing an artifact in a GitHub issue, Discussion, PR, support thread, or public post.
|
|
6
6
|
|
|
7
|
-
This guide is practical sharing guidance, not a guarantee that any artifact is safe to publish. Redaction profiles are **
|
|
7
|
+
This guide is practical sharing guidance, not a guarantee that any artifact is safe to publish. Redaction profiles are **best-effort transformation**, not compliance-grade DLP or a safety certification. Always finish with `verify-safe` before sharing.
|
|
8
|
+
|
|
9
|
+
Built-in profiles redact high-confidence credential forms (provider keys, JWTs, bearer tokens, and bounded `token=` / `api_key=` / `internal_token=` style key/value secrets). Broad or context-sensitive findings—such as private filesystem paths—may still appear under `verify-safe` and require human review. Org-specific patterns need programmatic custom detectors today; a bounded local CLI policy is proposed separately and is not yet supported.
|
|
10
|
+
|
|
11
|
+
`strict` is a stricter **rule set** (more keys), not a promise that every input produces bytes different from `share`.
|
|
8
12
|
|
|
9
13
|
## Quick presets (v1.3.0+)
|
|
10
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "6.17.
|
|
3
|
+
"version": "6.17.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local evidence debugger and trajectory-test toolkit for TypeScript AI agents — execution trees, TraceContract checks, Evidence v2, and read-only MCP",
|
|
@@ -211,18 +211,18 @@
|
|
|
211
211
|
},
|
|
212
212
|
"dependencies": {
|
|
213
213
|
"chalk": "^5.3.0",
|
|
214
|
-
"nanoid": "^5.
|
|
214
|
+
"nanoid": "^5.1.16",
|
|
215
215
|
"commander": "^12.1.0"
|
|
216
216
|
},
|
|
217
217
|
"devDependencies": {
|
|
218
218
|
"@changesets/cli": "^2.27.10",
|
|
219
219
|
"@size-limit/preset-small-lib": "^11.1.6",
|
|
220
220
|
"@types/node": "^22.10.2",
|
|
221
|
-
"@vitest/coverage-v8": "^2.
|
|
221
|
+
"@vitest/coverage-v8": "^3.2.7",
|
|
222
222
|
"size-limit": "^11.1.6",
|
|
223
223
|
"tsup": "^8.3.5",
|
|
224
224
|
"typescript": "^5.7.2",
|
|
225
|
-
"vitest": "^2.
|
|
225
|
+
"vitest": "^3.2.7"
|
|
226
226
|
},
|
|
227
227
|
"scripts": {
|
|
228
228
|
"clean": "pnpm -r exec -- node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
@@ -2796,29 +2796,30 @@ async function searchTraces(metas, options) {
|
|
|
2796
2796
|
}
|
|
2797
2797
|
function matchRunLevel(m, opts) {
|
|
2798
2798
|
if (opts.stepTypeFilter || opts.toolQuery) return [];
|
|
2799
|
-
|
|
2799
|
+
if (opts.statusFilter && m.status !== opts.statusFilter) return [];
|
|
2800
|
+
if (opts.nameQuery && !nameMatches(m.name ?? m.runId, opts.nameQuery)) {
|
|
2801
|
+
return [];
|
|
2802
|
+
}
|
|
2803
|
+
if (opts.durationFilter && !durationMatches(m.durationMs, opts.durationFilter)) {
|
|
2804
|
+
return [];
|
|
2805
|
+
}
|
|
2800
2806
|
const fields = [];
|
|
2801
|
-
if (opts.statusFilter
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
if (
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
matchReason: `run match: ${fields.join(", ")}`,
|
|
2818
|
-
matchedFields: fields,
|
|
2819
|
-
filePath: m.filePath
|
|
2820
|
-
});
|
|
2821
|
-
return out;
|
|
2807
|
+
if (opts.statusFilter) fields.push("run.status");
|
|
2808
|
+
if (opts.nameQuery) fields.push("run.name");
|
|
2809
|
+
if (opts.durationFilter) fields.push("run.durationMs");
|
|
2810
|
+
if (fields.length === 0) return [];
|
|
2811
|
+
return [
|
|
2812
|
+
{
|
|
2813
|
+
runId: m.runId,
|
|
2814
|
+
runName: m.name,
|
|
2815
|
+
runStatus: m.status,
|
|
2816
|
+
timestamp: m.startedAt,
|
|
2817
|
+
durationMs: m.durationMs,
|
|
2818
|
+
matchReason: `run match: ${fields.join(", ")}`,
|
|
2819
|
+
matchedFields: fields,
|
|
2820
|
+
filePath: m.filePath
|
|
2821
|
+
}
|
|
2822
|
+
];
|
|
2822
2823
|
}
|
|
2823
2824
|
function matchStepLevel(m, events, opts) {
|
|
2824
2825
|
const out = [];
|
|
@@ -6394,7 +6395,11 @@ var DEFAULT_SECRET_PATTERNS = [
|
|
|
6394
6395
|
{ id: "openai-key", pattern: /sk-[A-Za-z0-9_-]{16,}/ },
|
|
6395
6396
|
{ id: "aws-access-key", pattern: /AKIA[0-9A-Z]{16}/ },
|
|
6396
6397
|
{ id: "github-token", pattern: /gh[opsu]_[A-Za-z0-9_]{20,}/ },
|
|
6397
|
-
|
|
6398
|
+
// Keep in sync with packages/redact/src/key-value-secret.ts (KEY_VALUE_SECRET_PATTERN_SOURCE).
|
|
6399
|
+
{
|
|
6400
|
+
id: "key-value-secret",
|
|
6401
|
+
pattern: /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=([^\s"'\\]{8,})/i
|
|
6402
|
+
}
|
|
6398
6403
|
];
|
|
6399
6404
|
function compareStrings(a, b) {
|
|
6400
6405
|
return (a ?? "").localeCompare(b ?? "");
|
|
@@ -11415,5 +11420,5 @@ function renderGateReport(result, options = {}) {
|
|
|
11415
11420
|
}
|
|
11416
11421
|
|
|
11417
11422
|
export { COHORT_METRIC_IDS, DEFAULT_SUITE_ARTIFACTS_DIR, EVIDENCE_FORMAT_VERSION, EVIDENCE_HTML_FILENAME, EVIDENCE_MANIFEST_FILENAME, Redactor, TraceDirectory, TraceReadError, TreeBuilder, aggregateBundleSafeStatus, aggregateSessionCheckResults, analyzeCohort, applyProfileMetadataCaps, assertBundlePathContained, assertEvidenceRelativePath, buildActivitySummary, buildBundleMetadata, buildBundleSummaryMarkdown, buildEvidenceCausalFailureViewHtml, buildEvidenceCiPackage, buildEvidenceCircuitViewHtml, buildEvidenceContractsViewHtml, buildEvidenceDiffViewHtml, buildEvidenceHtmlShell, buildEvidenceManifest, buildEvidenceOutcomesViewHtml, buildEvidenceProvenanceViewHtml, buildEvidenceSafetyViewHtml, buildEvidenceTimelineViewHtml, buildEvidenceToolsLlmViewHtml, buildEvidenceTreeViewHtml, buildLocalExplanation, buildPlaceholderArtifact, buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildSessionIndex, buildTraceStats, buildZipArchive, bundleFailsOnSafety, bundleRunAssetRelativePath, collectTraceSchemaVersions, compactAttributes, createBaselineRegressionRule, createLlmUsageRule, createMaxStepDurationRule, createObservedOutcomeRule, createRequireCompletedRule, createRunDepthRule, createRunDurationRule, createRunStatusRule, createSafetyOversizedAttributeRule, createSafetyRawContentRule, createSafetyRedactionRule, createSafetySecretPatternRule, createStallDetectionRule, createStructureCycleRule, createStructureOrphanRule, createStructureParallelWidthRule, createStructureRelationshipRule, createToolUsageRule, defaultBundleOutputPath, defaultSuiteConfigTemplate, diffRuns, diffTraceEvents, enrichSessionRunRecord, escapeHtml, escapeMarkdown, extractMetadata, extractOutcomesFromTraceEvents, filterMetasBySessionScope, filterTraces, flattenTree, formatDuration2 as formatDuration, formatStepLabel, formatTimestamp, gateHasThresholds, getIndent, getTraceFilePath, inferEvidenceFileRole, isAgentInspectTrace, isPersistedInspectEvent, loadSessionRunRecords, loadSuiteConfig, loadTraceMetadataList, manualTraceEventsToComparableRun, nanoid, normalizeBundleOutputPath, openTrace, parseCohortMetricList, parseDuration, parseDurationFilter, parseGateList, parseTraceJsonl, persistedInspectEventsToTraceEvents, renderActivitySummaryHuman, renderCohortReport, renderErrorLine, renderGateReport, renderObservedOutcomesHtml, renderObservedOutcomesMarkdown, renderRunDiff, renderRunWhat, renderStepLine, renderSuiteReport, renderTimeline, renderTraceStats, resolveBundleRunIds, resolveRedactionProfile, resolveSuiteTemplate, resolveTraceDir, runGate, runSuite, runTraceChecks, safeString, sanitizeBundleRunId, searchTraces, serializeEvidenceManifest, sha256Hex, stableJson, summarizeObservedOutcomes, summarizeSemanticParity, traceEventToPersistedInspectEvent, truncateName, truncateStringForProfile, validateEvent, validateSuiteConfig, verifyEvidenceDirectory, zeroKinds };
|
|
11418
|
-
//# sourceMappingURL=chunk-
|
|
11419
|
-
//# sourceMappingURL=chunk-
|
|
11423
|
+
//# sourceMappingURL=chunk-25LUDS4T.mjs.map
|
|
11424
|
+
//# sourceMappingURL=chunk-25LUDS4T.mjs.map
|