agent-inspect 2.0.0 → 2.1.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1e5e889: Release v2.1.0 with deterministic local eval and redaction utilities.
8
+
9
+ Adds the public optional `@agent-inspect/redact` and `@agent-inspect/eval` packages, root CLI redaction and eval workflows, shared redaction profiles/findings, deterministic local eval checks, and adoption recipes for local eval, share-safe traces, and CI artifacts.
10
+
3
11
  ## 2.0.0
4
12
 
5
13
  ### Major Changes
package/README.md CHANGED
@@ -22,7 +22,7 @@ agent-inspect gives those runs **structure**: an **execution tree** you can read
22
22
 
23
23
  ## Install
24
24
 
25
- Current npm release line: **1.9.x** for the existing public packages. The v2 contract work on `main` is unreleased until the release-readiness gate completes. `@agent-inspect/openai-agents` v1.9 publication recovery is a separate maintainer npm setup item and is not retried by the v2 train.
25
+ Current npm release line: **2.0.x** for the existing public packages. v2.0.0 is the stable trace-contract release: small root API, schema 1.0 persisted writer path, v0.1/v0.2/v1.0 read compatibility, and explicit non-destructive migration workflow.
26
26
 
27
27
  ```bash
28
28
  npm install agent-inspect
@@ -235,7 +235,9 @@ AGENT_INSPECT=1 node eval-runner.mjs
235
235
  - **Use an isolated inspector** with `createInspector()` and explicit local writers for tests/adapters.
236
236
  - **Correlate runs** with optional `correlationId`, `requestId`, `decisionId`, and `groupId` on `run_started` metadata.
237
237
  - **Redact before disk** with default key-based redaction, or choose `redactionProfile`: `local`, `share`, or `strict`.
238
- - **Inspect from the CLI** — `list`, `view`, `clean`, `logs`, `tail`, `export`, `open`, `migrate`, `diff`, `timeline`, `stats`, `search`, `what`, `report`.
238
+ - **Inspect from the CLI** — `list`, `view`, `clean`, `logs`, `tail`, `export`, `open`, `migrate`, `eval`, `redact`, `diff`, `timeline`, `stats`, `search`, `what`, `report`.
239
+ - **Run local evals** with `agent-inspect eval` or `@agent-inspect/eval`; built-in checks are deterministic heuristics over local traces, not model judges.
240
+ - **Redact local files** with `agent-inspect redact` or `@agent-inspect/redact` before creating shareable copies.
239
241
  - **Migrate explicitly** with `agent-inspect migrate <trace.jsonl> --to 1.0 --dry-run` or `--output <file>`; originals are never overwritten by default.
240
242
  - **Export share-safe copies** — `export --redaction-profile share` (or `strict`) writes local Markdown/HTML/OpenInference/OTLP JSON only.
241
243
  - **Parse structured logs** you already emit (JSON first-class; log4js best-effort).
@@ -296,6 +298,8 @@ More detail: [docs/LOGS.md](docs/LOGS.md) · [docs/LOG-TO-TREE-QUICKSTART.md](do
296
298
  | `export` | Write Markdown / HTML / OpenInference-compatible JSON / OTLP JSON **locally** |
297
299
  | `open` | Read AgentInspect JSONL, OpenInference JSON, or OTLP JSON locally |
298
300
  | `migrate` | Convert a local AgentInspect JSONL file to schema 1.0 with dry-run or explicit output |
301
+ | `eval` | Deterministic local evals over existing traces |
302
+ | `redact` | Redact a local JSON/JSONL file or trace copy |
299
303
  | `diff` | Compare two local runs (read-only) |
300
304
  | `timeline` | Chronological view of one run |
301
305
  | `stats` | Local aggregates over a trace directory |
@@ -316,6 +320,8 @@ Full flags and behavior: [docs/CLI.md](docs/CLI.md).
316
320
  - Debug a **failed tool call** or thrown error in a support or ops agent.
317
321
  - See **which step dominated latency** in a multi-step planner or RAG pipeline.
318
322
  - **Diff two runs** after a prompt, model, or routing change (see [diff examples](docs/DIFF.md)).
323
+ - Run **local eval checks** over a trace before sharing or creating CI artifacts.
324
+ - **Redact** a local trace/file before attaching it to a PR, issue, or support thread.
319
325
  - Point **`logs`** / **`tail`** at existing job or service logs to get a **local execution view** without shipping data upstream.
320
326
  - **Export** a run to Markdown for a PR, postmortem, or internal thread — use `--redaction-profile share` for share-safe copies, then review before sharing.
321
327
  - Keep traces **on disk** while still using enterprise observability elsewhere.
@@ -332,6 +338,10 @@ AgentInspect is the **local-first trace workbench** for TypeScript AI agents:
332
338
 
333
339
  Pass `enabled: false` to `inspectRun` for a no-trace passthrough. Use `maybeInspectRun` with `AGENT_INSPECT=1` to toggle tracing in eval or CI — see [docs/API.md](docs/API.md).
334
340
 
341
+ **Shipped in 2.0.0:** stable root API contract, schema 1.0 persisted writer path, v0.1/v0.2/v1.0 read compatibility, and explicit trace migration workflow. Linked release aligns `agent-inspect`, `@agent-inspect/ai-sdk`, `@agent-inspect/langchain`, `@agent-inspect/tui`, and `@agent-inspect/openai-agents` at **2.0.0**.
342
+
343
+ **Shipped in 1.9.0:** private harness workspace foundation, explain dry-run/local analysis, promoted adapter adoption paths, and the v2 root API slimming plan.
344
+
335
345
  **Shipped in 1.8.0:** experimental deterministic checks (`agent-inspect/checks` and `agent-inspect check`), safe-sharing workflows (`scan`, `verify-safe`, safe artifacts), and first public `@agent-inspect/openai-agents` package. Linked release aligns `agent-inspect`, `@agent-inspect/ai-sdk`, `@agent-inspect/langchain`, `@agent-inspect/tui`, and `@agent-inspect/openai-agents` at **1.8.0**.
336
346
 
337
347
  **Shipped in 1.7.0:** experimental `@agent-inspect/ai-sdk` telemetry integration for AI SDK v6 with a local no-network [ai-sdk-local-telemetry recipe](examples/recipes/ai-sdk-local-telemetry/), adapter conformance fixtures, OpenAI Agents/LangGraph support decisions, and local-first adapter docs. Examples keep `recordInputs: false`, `recordOutputs: false`, metadata-only capture, and no upload behavior. Linked release aligns `agent-inspect`, `@agent-inspect/ai-sdk`, `@agent-inspect/langchain`, and `@agent-inspect/tui` at **1.7.0**.
@@ -340,7 +350,7 @@ Pass `enabled: false` to `inspectRun` for a no-trace passthrough. Use `maybeInsp
340
350
 
341
351
  **Shipped in 1.5.0:** non-breaking subpath exports; `what` and `report` CLI; dual-format read path (v0.1 + v0.2 JSONL); [what-report-inspect recipe](examples/recipes/what-report-inspect/). Linked release aligns all three npm packages at **1.5.0**.
342
352
 
343
- **Roadmap beyond current release work:** future work continues from the local runtime, universal ingestion, and optional adapter foundations. See [ROADMAP.md](ROADMAP.md).
353
+ **Roadmap beyond current release work:** v2.1 starts the eval/redact utility triangle, followed by reporters/CI, adapter hardening, sessions/MCP telemetry, guardrails, optional viewer/IDE surfaces, and conditional v3 extensibility. See [ROADMAP.md](ROADMAP.md).
344
354
 
345
355
  **Shipped in 1.4.0:** CI artifact recipe ([docs/CI-ARTIFACTS.md](docs/CI-ARTIFACTS.md)); `timeline`, `stats`, and `search` CLI; core helpers `buildRunTimeline`, `buildTraceStats`, `searchTraces`. Linked release aligns all three npm packages at **1.4.0**.
346
356
 
@@ -418,6 +428,9 @@ The TUI is available as a separate optional package; its programmatic API is exp
418
428
  | [examples/recipes/parallel-tools](examples/recipes/parallel-tools) | Parallel tools |
419
429
  | [examples/recipes/github-actions-artifact](examples/recipes/github-actions-artifact) | CI trace artifacts |
420
430
  | [examples/recipes/deterministic-ci-checks](examples/recipes/deterministic-ci-checks) | v1.8 checks, baseline, and safe CI artifacts |
431
+ | [examples/recipes/eval-local-checks](examples/recipes/eval-local-checks) | v2.1 deterministic local eval checks |
432
+ | [examples/recipes/redact-share-safe-file](examples/recipes/redact-share-safe-file) | v2.1 share-safe local redaction copy |
433
+ | [examples/recipes/eval-ci-artifacts](examples/recipes/eval-ci-artifacts) | v2.1 eval before safe CI artifacts |
421
434
  | [examples/recipes/test-reporter-artifacts](examples/recipes/test-reporter-artifacts) | v1.8 Vitest/Jest reporter artifact patterns |
422
435
  | [examples/recipes/what-report-inspect](examples/recipes/what-report-inspect/) | `what` + `report` inspection |
423
436
  | [examples/recipes/runtime-and-ingestion](examples/recipes/runtime-and-ingestion/) | v1.6 runtime writers + universal ingestion |
package/docs/ADAPTERS.md CHANGED
@@ -128,8 +128,12 @@ await agent.invoke(input, { callbacks: [callback] });
128
128
  npx agent-inspect list --dir ./.agent-inspect
129
129
  npx agent-inspect view <run-id> --dir ./.agent-inspect
130
130
  npx agent-inspect export <run-id> --format markdown --redaction-profile share
131
+ npx agent-inspect eval <run-id> --dir ./.agent-inspect --require-success --json
132
+ npx agent-inspect redact ./.agent-inspect/<trace-file>.jsonl --profile share --json
131
133
  ```
132
134
 
135
+ `eval` and `redact` read local adapter traces only. They do not call model providers, upload traces, or loosen the adapter metadata-only capture defaults.
136
+
133
137
  ![LangChain callback with persist true writing inspectable JSONL](../assets/demos/langchain-persistence.gif)
134
138
 
135
139
  *Synthetic demo — [examples/08-langchain-adapter](../../examples/08-langchain-adapter/README.md).*
package/docs/API.md CHANGED
@@ -497,7 +497,47 @@ The checks API is experimental in v1.x. The `agent-inspect check` CLI uses this
497
497
 
498
498
  Recipes: [deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/README.md) for check/baseline/artifact workflows, and [test-reporter-artifacts](../examples/recipes/test-reporter-artifacts/README.md) for Vitest/Jest reporter configuration patterns.
499
499
 
500
- ## 22. Experimental local explain APIs (v1.9)
500
+ ## 22. Experimental `@agent-inspect/eval` APIs (v2.1)
501
+
502
+ `@agent-inspect/eval` is an optional package for deterministic local evals over existing traces. It consumes normalized reader output or local trace paths, returns stable JSON-compatible results, and does not call model providers, upload traces, replay agents, or create hosted datasets.
503
+
504
+ Import from `@agent-inspect/eval`:
505
+
506
+ ```ts
507
+ import { checks, evalRun, renderEvalMarkdown } from "@agent-inspect/eval";
508
+ ```
509
+
510
+ - **`evalRun(input, options?)`**: runs selected eval rules over a local trace path or `TraceReadResult`.
511
+ - **`checks`**: built-in deterministic rule factories for run status, tool usage, duration, depth, retries, token totals, failed steps, retrieval-before-generation, decision metadata, context overlap, quote overlap, citation presence, required source IDs, answer length bounds, and banned unsupported phrases.
512
+ - **`renderEvalMarkdown(result)`**: renders a deterministic Markdown summary suitable for local CI logs, PR text, or artifact files after review.
513
+ - Result types include **`EvalRunResult`**, **`EvalFinding`**, **`EvalDiagnostic`**, and **`EvalRule`**.
514
+
515
+ Findings are designed for CI output: they include rule IDs, expected/actual structural summaries, and evidence paths. They should not include raw prompt, answer, context, request/response, header, API key, secret, or full tool payload values.
516
+
517
+ CLI wrapper: `agent-inspect eval <trace-path-or-run-id> --require-success --json`.
518
+
519
+ Recipes: [eval-local-checks](../examples/recipes/eval-local-checks/README.md) and [eval-ci-artifacts](../examples/recipes/eval-ci-artifacts/README.md).
520
+
521
+ ## 23. Experimental `@agent-inspect/redact` APIs (v2.1)
522
+
523
+ `@agent-inspect/redact` is an optional package for reusable local redaction. It powers the root CLI `redact` workflow and shared trace-safety integrations. Redaction operates on local values/files and returns a redacted copy; it does not mutate the source object, upload content, or claim compliance-grade DLP.
524
+
525
+ Import from `@agent-inspect/redact`:
526
+
527
+ ```ts
528
+ import { createRedactor, redact } from "@agent-inspect/redact";
529
+ ```
530
+
531
+ - **`redact(value, options?)`**: returns `{ value, findings, redacted, profile }` for a redacted copy.
532
+ - **`createRedactor(options?)`**: creates a reusable redactor with profile, custom detectors, and custom rules.
533
+ - **Profiles**: `local`, `share`, and `strict`.
534
+ - **Findings**: detector id, path, action, severity, and bounded preview metadata where applicable.
535
+
536
+ CLI wrapper: `agent-inspect redact <trace-or-file> --profile share --json`.
537
+
538
+ Recipe: [redact-share-safe-file](../examples/recipes/redact-share-safe-file/README.md).
539
+
540
+ ## 24. Experimental local explain APIs (v1.9)
501
541
 
502
542
  `buildLocalExplanation()` creates a deterministic local explanation payload from a reader-selected `InspectRunTree`. It performs no network I/O, does not call model providers, and separates observed facts from deterministic inference labels.
503
543
 
@@ -522,7 +562,7 @@ Provider design gate:
522
562
  - Provider prompts must use redacted facts only, label inferred claims, and must not request raw chain-of-thought.
523
563
  - Provider packages or SDKs must not become root/core runtime dependencies.
524
564
 
525
- ## 23. Experimental `@agent-inspect/harness` APIs
565
+ ## 25. Experimental `@agent-inspect/harness` APIs
526
566
 
527
567
  `@agent-inspect/harness` is a private experimental workspace package during the v1.9 release train. It provides a no-framework fixture runner for local targets and recipes; first public package publication remains a manual maintainer gate.
528
568
 
@@ -548,23 +588,23 @@ The harness package does not add root/core dependencies, does not upload traces,
548
588
 
549
589
  Recipes: [harness-basic](../examples/recipes/harness-basic/README.md) and [harness-adapter-local](../examples/recipes/harness-adapter-local/README.md).
550
590
 
551
- ## 24. Deprecated APIs
591
+ ## 26. Deprecated APIs
552
592
 
553
593
  No deprecated APIs are declared as of 1.4.0.
554
594
 
555
- ## 25. Removal / deprecation policy
595
+ ## 27. Removal / deprecation policy
556
596
 
557
597
  - Stable APIs are not removed within the current major version.
558
598
  - If removal is necessary, the API should be **deprecated** first, documented, and kept for a reasonable window (target: at least one minor line) unless security requires faster action.
559
599
 
560
- ## 26. Backward compatibility policy
600
+ ## 28. Backward compatibility policy
561
601
 
562
602
  - Manual trace JSONL (`schemaVersion: "0.1"`) remains readable.
563
603
  - Additive schema changes are allowed in minor versions.
564
604
  - Breaking changes require a major version.
565
605
  - Unknown fields should be ignored where safe.
566
606
 
567
- ## 25. Examples
607
+ ## 29. Examples
568
608
 
569
609
  ### Minimal manual trace
570
610
 
package/docs/CLI.md CHANGED
@@ -28,6 +28,8 @@ Core commands:
28
28
  - `open` — read supported local trace files, directories, or stdin through the canonical reader pipeline
29
29
  - `migrate` — convert one local AgentInspect JSONL file to schema 1.0 with dry-run or explicit output
30
30
  - `check` — run deterministic local trace checks with stable JSON and exit codes
31
+ - `eval` — run deterministic local evals over existing traces
32
+ - `redact` — redact a local JSON/JSONL file or trace copy
31
33
  - `scan` — best-effort local safety scan for trace capture risks
32
34
  - `verify-safe` — best-effort local trace safety verification
33
35
  - `artifacts` — create safe local CI trace artifact bundles and optional step summaries
@@ -58,6 +60,12 @@ Exception: `check` uses CI-oriented semantic exit codes:
58
60
  - **3**: trace input could not be read
59
61
  - **4**: unsupported or ambiguous trace format
60
62
 
63
+ Exception: `eval` uses local eval semantic exit codes:
64
+
65
+ - **0**: all selected eval rules passed
66
+ - **1**: eval ran and at least one error-severity rule failed
67
+ - **2**: invalid arguments, invalid config, unreadable input, unsupported input, ambiguous input, or run-selection errors
68
+
61
69
  Exception: `scan` and `verify-safe` use local safety status exit codes:
62
70
 
63
71
  - **0**: status is SAFE or SAFE WITH WARNINGS
@@ -79,6 +87,8 @@ Many commands support `--json` for scripting. JSON output is intended to be:
79
87
  - Log-derived output includes **confidence** labels and avoids inventing parent-child relationships.
80
88
  - Redaction defaults are conservative (e.g. `authorization`, `cookie`, `token`, `apiKey`, `password`, `secret`, `email`).
81
89
  - Exported payloads are **redacted by default** unless explicitly configured otherwise.
90
+ - `eval` is deterministic and local-only. It does not replay agents, call model providers, upload traces, or create hosted datasets.
91
+ - `redact` writes or prints a redacted copy. It does not mutate source trace files.
82
92
  - `scan` and `verify-safe` are best-effort local checks, not compliance, privacy, security, or regulatory certifications.
83
93
  - `artifacts` renders structural summaries and check evidence only; it does not include raw prompt/output bodies, request/response bodies, headers, API keys, secrets, or full tool payloads.
84
94
 
@@ -322,7 +332,85 @@ npx agent-inspect check trace.jsonl --max-duration-ms 30000 --required-tool sear
322
332
 
323
333
  Recipe: [examples/recipes/deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/README.md)
324
334
 
325
- ### 6.10 `scan` and `verify-safe`
335
+ ### 6.10 `eval`
336
+
337
+ Run deterministic local evals against an existing trace. This command reads through the same local reader pipeline as `open` and `check`; it does not rerun agents, call models, upload traces, mutate inputs, or create a hosted dataset.
338
+
339
+ ```bash
340
+ agent-inspect eval <trace-path-or-run-id> [options]
341
+ ```
342
+
343
+ Options:
344
+
345
+ - `--dir <path>`: trace directory for run-id lookup
346
+ - `--format <agent-inspect-jsonl|openinference-json|otlp-json>`: explicit trace input format
347
+ - `--run <run-id>`: select a run when input contains multiple runs
348
+ - `--config <path>`: eval config (`.json`, `.js`, `.mjs`, or `.cjs`); TypeScript configs are rejected until an explicit loader is approved
349
+ - `--json`: print deterministic JSON eval result
350
+ - `--markdown`: print deterministic Markdown eval summary
351
+ - `--require-success`: require the selected run to complete successfully
352
+ - `--required-tool <name>`: require a tool name (repeatable)
353
+ - `--forbid-tool <name>` / `--forbidden-tool <name>`: forbid a tool name (repeatable)
354
+ - `--max-duration-ms <number>`, `--max-depth <number>`, `--max-retries <number>`, `--max-total-tokens <number>`
355
+ - `--require-retrieval-before-generation`
356
+ - `--required-decision-metadata <key>`: require decision metadata (repeatable)
357
+ - `--context-overlap`, `--min-context-overlap <number>`, `--min-shared-terms <number>`
358
+ - `--quote-overlap`
359
+ - `--citation-presence`
360
+ - `--required-source-id <id>`: require a source id in context or citations (repeatable)
361
+ - `--min-answer-characters <number>`, `--max-answer-characters <number>`, `--min-answer-words <number>`, `--max-answer-words <number>`
362
+ - `--banned-phrase <text>`: ban unsupported-answer phrasing (repeatable)
363
+
364
+ Example config:
365
+
366
+ ```json
367
+ {
368
+ "eval": {
369
+ "requireSuccess": true,
370
+ "requiredTools": ["searchDocs"],
371
+ "forbiddenTools": ["deleteAccount"],
372
+ "citationPresence": true,
373
+ "contextOverlap": { "minOverlap": 0.2 },
374
+ "requiredSourceIds": ["policy-30-day"]
375
+ }
376
+ }
377
+ ```
378
+
379
+ Examples:
380
+
381
+ ```bash
382
+ npx agent-inspect eval fixtures/traces-v0.2/manual-basic.jsonl --require-success --json
383
+ npx agent-inspect eval trace.jsonl --forbid-tool deleteAccount --markdown
384
+ npx agent-inspect eval trace.jsonl --config agent-inspect.eval.json --json
385
+ ```
386
+
387
+ Recipes: [eval-local-checks](../examples/recipes/eval-local-checks/README.md) and [eval-ci-artifacts](../examples/recipes/eval-ci-artifacts/README.md).
388
+
389
+ ### 6.11 `redact`
390
+
391
+ Redact a local JSON or JSONL trace/file. The command prints or writes a redacted copy and reports bounded findings; it does not mutate the source file or upload content.
392
+
393
+ ```bash
394
+ agent-inspect redact <trace-or-file> [options]
395
+ ```
396
+
397
+ Options:
398
+
399
+ - `--dir <path>`: trace directory for run-id lookup
400
+ - `--profile <local|share|strict>`: redaction profile (default `share`)
401
+ - `-o, --output <path>`: write redacted content to a file
402
+ - `--json`: print deterministic JSON wrapper with findings
403
+
404
+ Examples:
405
+
406
+ ```bash
407
+ npx agent-inspect redact trace.jsonl --profile share --json
408
+ npx agent-inspect redact trace.jsonl --profile strict -o trace.share.jsonl
409
+ ```
410
+
411
+ Recipe: [redact-share-safe-file](../examples/recipes/redact-share-safe-file/README.md).
412
+
413
+ ### 6.12 `scan` and `verify-safe`
326
414
 
327
415
  Run best-effort local safety verification for supported trace inputs. These commands are local and read-only: they do not rerun agents, call models, upload traces, mutate input files, or certify compliance.
328
416
 
@@ -361,7 +449,7 @@ npx agent-inspect verify-safe minimal-success --dir fixtures/traces
361
449
  npx agent-inspect verify-safe trace.jsonl --max-string-length 8192 --json
362
450
  ```
363
451
 
364
- ### 6.11 `artifacts`
452
+ ### 6.13 `artifacts`
365
453
 
366
454
  Create deterministic local CI artifacts for supported trace inputs. This command is local and read-only for trace inputs: it does not rerun agents, call models, upload files, use GitHub APIs, or mutate repository state. It writes only to `--output-dir` and, when requested, a local step-summary file.
367
455
 
@@ -401,7 +489,7 @@ npx agent-inspect artifacts candidate.jsonl --baseline baseline.jsonl --output-d
401
489
 
402
490
  Recipe and sample workflow: [examples/recipes/deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/README.md)
403
491
 
404
- ### 6.12 `diff`
492
+ ### 6.14 `diff`
405
493
 
406
494
  Compare two manual trace runs. Diff is **local** and **read-only** (does not rerun agents).
407
495
 
@@ -465,7 +553,7 @@ Differences:
465
553
 
466
554
  More examples, including timing-only and structure-only diffs, are in `docs/DIFF.md`.
467
555
 
468
- ### 6.13 `timeline`
556
+ ### 6.15 `timeline`
469
557
 
470
558
  Chronological step list for one manual trace. Read-only; does not mutate JSONL files.
471
559
 
@@ -481,7 +569,7 @@ Options:
481
569
 
482
570
  ![Timeline with slow-step focus](../assets/demos/timeline.gif)
483
571
 
484
- ### 6.14 `stats`
572
+ ### 6.16 `stats`
485
573
 
486
574
  Local aggregate statistics over trace files in a directory. Read-only.
487
575
 
@@ -501,7 +589,7 @@ Options:
501
589
 
502
590
  Use `--correlation-id` or `--group-id` to filter runs by `run_started` metadata (see [API.md](./API.md)).
503
591
 
504
- ### 6.15 `search`
592
+ ### 6.17 `search`
505
593
 
506
594
  Deterministic search over local traces (substring / exact filters). No semantic search.
507
595
 
@@ -531,7 +619,7 @@ npx agent-inspect search --duration ">100ms" --json
531
619
 
532
620
  ![Search traces by status error](../assets/demos/search.gif)
533
621
 
534
- ### 6.16 `what`
622
+ ### 6.18 `what`
535
623
 
536
624
  Concise human-readable summary of one local trace run. Read-only; accepts v0.1 manual JSONL and v0.2 persisted-event JSONL through the shared dual-format normalization path. Vocabulary: [TRACE-VOCABULARY-V1.5.md](./proposals/TRACE-VOCABULARY-V1.5.md).
537
625
 
@@ -560,7 +648,7 @@ Outcome: Completed successfully.
560
648
  Slowest: plan (100ms, logic)
561
649
  ```
562
650
 
563
- ### 6.17 `report`
651
+ ### 6.19 `report`
564
652
 
565
653
  Generate a local inspection report combining **what happened**, **timeline**, and **execution tree** sections. The command reads local v0.1 manual JSONL and v0.2 persisted-event JSONL through the shared dual-format normalization path without mutating them. Distinct from `export` (which targets shareable tree snapshots and standards formats).
566
654
 
@@ -585,7 +673,7 @@ Example:
585
673
  npx agent-inspect report minimal-success --dir fixtures/traces --format html -o report.html
586
674
  ```
587
675
 
588
- ### 6.18 `explain`
676
+ ### 6.20 `explain`
589
677
 
590
678
  Explain a local trace using deterministic facts and local inference labels. This command reads through the same local reader pipeline as `open` / `check`; it does not call a model provider, upload traces, replay agents, or mutate input files.
591
679
 
package/docs/COMPARE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Compare AgentInspect
2
2
 
3
- AgentInspect is a local-first execution-tree debugger for TypeScript AI agents. It’s designed for inner-loop debugging and quick inspection — not as a replacement for hosted observability, evaluation, or production monitoring platforms.
3
+ AgentInspect is a local-first execution-tree debugger for TypeScript AI agents. It’s designed for inner-loop debugging, deterministic local eval heuristics, redaction, and quick inspection — not as a replacement for hosted observability, dataset evaluation, or production monitoring platforms.
4
4
 
5
5
  ## AgentInspect vs console.log
6
6
 
@@ -16,7 +16,7 @@ LangSmith is a hosted/platform workflow for tracing, evaluation, and observabili
16
16
  AgentInspect is local-first CLI debugging:
17
17
 
18
18
  - Use AgentInspect to debug locally before/alongside LangSmith when iterating on agent logic.
19
- - AgentInspect does not provide hosted dashboards, dataset/eval workflows, or production tracing pipelines.
19
+ - AgentInspect does not provide hosted dashboards, dataset/eval management workflows, or production tracing pipelines.
20
20
 
21
21
  ## AgentInspect vs Langfuse
22
22
 
@@ -33,7 +33,7 @@ Braintrust is strong for evals, regressions, datasets, and production AI quality
33
33
 
34
34
  AgentInspect is lighter and local-first:
35
35
 
36
- - Use AgentInspect to understand a single run locally.
36
+ - Use AgentInspect to understand a single run locally and run deterministic trace checks/eval heuristics before sharing artifacts.
37
37
  - Use Braintrust when you want repeatable evals, comparisons at scale, and production quality workflows.
38
38
 
39
39
  ## AgentInspect vs Phoenix / OpenInference
@@ -61,9 +61,10 @@ AgentInspect avoids SDK/collector setup for local debugging:
61
61
  | --- | --- |
62
62
  | Local agent debugging | Strong fit |
63
63
  | No-account CLI tracing | Strong fit |
64
+ | Deterministic local eval heuristics | Good fit |
65
+ | Share-safe local redaction copy | Good fit |
64
66
  | Production dashboards | Not the goal |
65
67
  | Hosted eval datasets | Not the goal |
66
68
  | Prompt management | Not the goal |
67
69
  | Standards-aligned local export | Partial (compatibility-oriented) |
68
70
  | Full observability platform | Use a dedicated platform |
69
-
@@ -204,17 +204,34 @@ agent-inspect search --dir ./.agent-inspect --status error --limit 10
204
204
 
205
205
  For CI artifact workflows, see [CI-ARTIFACTS.md](./CI-ARTIFACTS.md) and [github-actions-artifact recipe](../examples/recipes/github-actions-artifact/).
206
206
 
207
- ## 10. Diff two runs
207
+ ## 10. Run local evals and redact share copies
208
+
209
+ After a trace exists, run deterministic eval checks without replaying the agent or calling a model provider:
210
+
211
+ ```bash
212
+ agent-inspect eval minimal-success --dir fixtures/traces --require-success --json
213
+ agent-inspect eval trace.jsonl --forbid-tool deleteAccount --citation-presence --json
214
+ ```
215
+
216
+ Before attaching a trace or JSON artifact to a PR, issue, or support thread, create a redacted local copy:
217
+
218
+ ```bash
219
+ agent-inspect redact trace.jsonl --profile share --json
220
+ ```
221
+
222
+ Recipes: [eval-local-checks](../examples/recipes/eval-local-checks/), [redact-share-safe-file](../examples/recipes/redact-share-safe-file/), and [eval-ci-artifacts](../examples/recipes/eval-ci-artifacts/).
223
+
224
+ ## 11. Diff two runs
208
225
 
209
226
  ```bash
210
227
  agent-inspect diff minimal-success minimal-error --dir fixtures/traces
211
228
  ```
212
229
 
213
- ## 11. Try recipes
230
+ ## 12. Try recipes
214
231
 
215
232
  See `examples/recipes/README.md`.
216
233
 
217
- ## 12. Optional framework adapters
234
+ ## 13. Optional framework adapters
218
235
 
219
236
  See [ADAPTERS.md](./ADAPTERS.md) for AI SDK local telemetry, OpenAI Agents local-only processing, and LangChain callbacks.
220
237
 
@@ -228,7 +245,7 @@ pnpm add @agent-inspect/langchain
228
245
 
229
246
  See [examples/08-langchain-adapter](../examples/08-langchain-adapter/README.md) and [docs/ADAPTERS.md](./ADAPTERS.md).
230
247
 
231
- ## 13. Optional TUI
248
+ ## 14. Optional TUI
232
249
 
233
250
  `@agent-inspect/tui` is optional and **experimental**. The CLI can invoke it with:
234
251
 
@@ -236,16 +253,17 @@ See [examples/08-langchain-adapter](../examples/08-langchain-adapter/README.md)
236
253
  agent-inspect view <runId> --tui
237
254
  ```
238
255
 
239
- ## 14. Safety notes
256
+ ## 15. Safety notes
240
257
 
241
258
  - Nothing uploads by default; core tracing, readers, checks, and exports are local-first.
259
+ - Eval and redaction commands read local inputs and do not call provider APIs or hosted services.
242
260
  - Redaction is on by default for log-derived attributes, **manual trace metadata (before disk)**, and exports. Pass `redact: false` to opt out of manual metadata redaction.
243
261
  - Export redaction shapes a local copy and does not mutate the source trace; review exported files before sharing.
244
262
  - Persisted events are size-bounded by default (see `docs/API.md`).
245
263
  - Confidence labels are required to keep attribution honest.
246
264
  - AgentInspect is for local debugging, not production monitoring.
247
265
 
248
- ## 15. Next docs
266
+ ## 16. Next docs
249
267
 
250
268
  - [docs/API.md](./API.md)
251
269
  - [docs/CLI.md](./CLI.md)
@@ -12,6 +12,12 @@ AgentInspect is **local-first** and **CLI-first**. These behaviors are intention
12
12
  - **OpenInference** and **OTLP JSON** exports are **compatibility-oriented** and **experimental**. Validate against your target collector or backend before relying on them.
13
13
  - Exports generate **strings/files locally** only—there is **no** automatic upload.
14
14
 
15
+ ## Eval and redaction
16
+
17
+ - **`agent-inspect eval` is deterministic local eval, not hosted evaluation.** Built-in rules are structural checks and grounding heuristics over existing traces. They do not call model providers, manage datasets, replay agents, or perform semantic LLM judging.
18
+ - **TypeScript eval configs are not loaded by default.** Use `.json`, `.js`, `.mjs`, or `.cjs` until an explicit loader path is approved.
19
+ - **`agent-inspect redact` creates a local redacted copy.** It does not mutate source traces, encrypt files, or guarantee compliance-grade detection. Review the exact output before sharing.
20
+
15
21
  ## Readers and `open`
16
22
 
17
23
  - **OpenInference** and **OTLP JSON** readers are **compatibility-oriented** and **experimental**. They normalize local JSON payloads into AgentInspect inspection trees and may warn on unsupported semantic fields.
@@ -103,6 +109,7 @@ pnpm compat:smoke
103
109
 
104
110
  - `agent-inspect artifacts --github-summary` writes a local step-summary file only. It does not call GitHub APIs, open PR comments, upload artifacts, or mutate repository state.
105
111
  - Baseline checks compare normalized structural facts from explicit candidate and baseline inputs. They are useful for CI regression evidence, not replay or semantic eval scoring.
112
+ - v2.1 eval/redact adoption recipes are local and deterministic: [eval-local-checks](../examples/recipes/eval-local-checks/), [redact-share-safe-file](../examples/recipes/redact-share-safe-file/), and [eval-ci-artifacts](../examples/recipes/eval-ci-artifacts/).
106
113
 
107
114
  ### What to include in a bug report
108
115
 
@@ -50,6 +50,7 @@ This document states what AgentInspect **does not** provide today. It complement
50
50
  ## Trace safety bounds
51
51
 
52
52
  - **Redaction profiles** (`local`, `share`, `strict`) are key-based presets — not compliance-grade PII detection. Review exports before sharing even with `--redaction-profile strict`.
53
+ - **`@agent-inspect/redact` and `agent-inspect redact` create redacted copies.** They do not encrypt source traces, mutate originals, certify compliance, or guarantee every sensitive value is detected.
53
54
  - **Default metadata redaction** covers common sensitive keys only (exact key match, case-insensitive). Custom secret field names are not redacted unless you add rules via `redact: { rules: [...] }`.
54
55
  - **Metadata truncation** applies to string values and nested structures; very large metadata may be replaced with a truncation marker when `maxEventBytes` is exceeded (default 64 KiB per JSONL line).
55
56
  - **Redaction is not encryption.** Local trace files remain readable on disk; treat `.agent-inspect-runs/` like any developer artifact that may contain operational data.
@@ -57,6 +58,7 @@ This document states what AgentInspect **does not** provide today. It complement
57
58
  ## Checks, artifacts, and test reporters
58
59
 
59
60
  - **Checks are deterministic local rules, not compliance certification.** `check`, `scan`, and `verify-safe` surface bounded findings and diagnostics over supported local inputs; they do not prove a trace is safe for every sharing context.
61
+ - **Eval is deterministic local heuristics.** `@agent-inspect/eval` and `agent-inspect eval` do not provide LLM-as-judge scoring, hosted datasets, replay, semantic grading, or production quality analytics.
60
62
  - **Safe CI artifacts are structural summaries.** They avoid raw prompt/output/request/response/header/tool payload content by default, but teams should still review generated files before sharing.
61
63
  - **Vitest/Jest reporters are optional package surfaces.** Recipes document config patterns and explicit associations; package publication is controlled by release readiness and maintainer authorization.
62
64
 
@@ -64,7 +66,7 @@ This document states what AgentInspect **does not** provide today. It complement
64
66
 
65
67
  - **No replay / fork** of past runs from traces alone.
66
68
  - **No time-travel debugging** across arbitrary runtime state.
67
- - **No multi-run statistical evaluation** built into core.
69
+ - **No multi-run statistical evaluation** built into core. v2.1 eval checks are per selected trace/run unless user code aggregates results.
68
70
 
69
71
  ## Economics
70
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local-first execution-tree debugger for TypeScript AI agents",
@@ -168,7 +168,7 @@
168
168
  },
169
169
  "scripts": {
170
170
  "clean": "pnpm -r exec -- rm -rf dist",
171
- "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.vitest.config.ts && pnpm exec tsup --config tsup.jest.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts && pnpm exec tsup --config tsup.harness.config.ts",
171
+ "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.vitest.config.ts && pnpm exec tsup --config tsup.jest.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts && pnpm exec tsup --config tsup.harness.config.ts && pnpm exec tsup --config tsup.redact.config.ts && pnpm exec tsup --config tsup.eval.config.ts",
172
172
  "typecheck": "tsc --noEmit",
173
173
  "test": "vitest run",
174
174
  "test:watch": "vitest",