CLI tool
rajudandigam/agent-inspect avatar
rajudandigam/agent-inspect

agent-inspect: local JSONL traces that debug, gate CI and bundle evidence for TypeScript agents

Local evidence debugger and trajectory-test toolkit for TypeScript AI agents: inspect causal runs, catch wrong tool paths in CI, and share safe offline evidence.

213 stars56 forksTypeScriptMIT

At a glance

What is it?
agent-inspect records each TypeScript agent run as local JSONL, then reads it as an execution tree, checks it against deterministic trajectory rules and packs it into a redacted offline bundle. It is a laptop-to-PR tool, not a hosted observability service.
Who is it for?
Use agent-inspect if you build TypeScript agents and want to see the exact tool path of a run, fail CI when a required tool is skipped and hand a reviewer a redacted bundle, all without an account or collector. Do not expect it to replace hosted production observability or to judge answer quality.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • rajudandigam/agent-inspect213 ★ · -363
Star history
Repository2026-09-112026-11-25
rajudandigam/agent-inspect576213

-363 Stars in the last 75 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One local JSONL trace feeds debugging, CI checks and sharing

agent-inspect keeps a run as local JSONL and gives three jobs from that single trace. Debug reads the execution path. Prevent fails CI on a wrong trajectory. Share produces reviewable offline evidence. The pitch is that you capture once and do not re-instrument for each job.

The tool says it needs no account, no collector and no default upload, and that it is metadata-only by default. Install is a single package:

bash
npm install agent-inspect

The reasoning behind the design is that agent code rarely fails as one function call. It plans, retrieves, calls tools, invokes a model, retries and produces side effects, and flat logs show fragments. A tree built from one trace shows how those steps nested.

The consequence of keeping everything local is that you own the storage. Traces live in a directory such as .agent-inspect, and nothing is retained for you elsewhere. If a teammate needs the run, you give it to them yourself, which is exactly what the share step is for.

Debugging starts from three commands that all take a run ID and a directory

Once a trace exists, the read side is three CLI commands. Each takes a run ID and the --dir flag pointing at the trace directory:

bash
npx agent-inspect view <run-id> --dir .agent-inspect --summary
npx agent-inspect report <run-id> --dir .agent-inspect
npx agent-inspect explain <run-id> --dir .agent-inspect

The view shows nested steps, tool calls, LLM calls, model and token metadata, durations, errors and the first causal failure. Getting data into that view can be done with manual instrumentation, official adapters, supported standards files, or structured logs you already emit.

To see it without writing an agent, the generated demo is synthetic, keyless and local. npm install does not copy repository examples; init writes them into your project. The sequence is npm install agent-inspect, then npx agent-inspect init --yes, then node examples/agent-inspect-demo.mjs, then npx agent-inspect list --dir .agent-inspect to get the printed run ID. For fixed run ids named demo-good, demo-regression and demo-pii there is a keyless showcase in the broken-agent-debugging starter.

The CI check is deterministic, and it does not invent outcomes

The check command is provider-free. The same trace and the same rules produce the same result, so a failing run in CI will fail the same way on your laptop. You start with a preset and extend it:

bash
npx agent-inspect check <run-id> --dir .agent-inspect \
  --preset trajectory \
  --required-tool retrieve_policy

A passing check exits 0 and a rule failure exits 1. Invalid configuration and unreadable or unsupported inputs use separate documented exit codes, so a pipeline can tell a bad rule from a bad file.

There is a limit worth knowing. The flag --fail-on-observation failed only makes sense when the run records explicit OUTCOME events, as the broken-agent-debugging starter does. Trajectory checks do not infer outcomes from tool, LLM or run success. A run where every tool call returned fine can still be a wrong run, and this check will not call it wrong unless a rule or an OUTCOME event says so. For more than one CLI check you can reach for TraceContract, suites, cohorts, the Vitest and Jest reporters, or --evidence-on fail.

verify-safe gives four verdicts, and none of them is a certification

Sharing begins with an assessment, then writes a redacted artifact, then verifies it:

bash
npx agent-inspect verify-safe <run-id> --dir .agent-inspect
npx agent-inspect bundle <run-id> --dir .agent-inspect --profile share --out ./evidence
npx agent-inspect bundle verify ./evidence

verify-safe is a best-effort local assessment. It can report SAFE, SAFE WITH WARNINGS, UNSAFE or UNKNOWN. The bundle command writes the redacted artifact and a manifest, and bundle verify rechecks the listed file hashes offline, so a recipient can confirm nothing changed after you made the bundle.

What that does not give you is a guarantee about the content. The project states that share-checked is not compliance certification and that you should review the artifact before attaching it to a PR, incident or support handoff. The UNKNOWN verdict deserves attention in particular, since it means the assessment could not decide, and a hash check only proves the files are unchanged, not that they were free of sensitive data when you bundled them.

Each stack needs its own adapter package or its own command

Adapters are separate npm packages that sit next to the core. For LangChain and LangGraph you install agent-inspect plus @agent-inspect/langchain. For the AI SDK it is @agent-inspect/ai-sdk, and for OpenAI Agents JS it is @agent-inspect/openai-agents. Vitest and Jest CI use @agent-inspect/vitest and @agent-inspect/jest. Custom functions or classes need only agent-inspect itself.

Two routes need no adapter at all. Existing structured logs go through npx agent-inspect logs, and OpenInference or OTLP JSON goes through npx agent-inspect open.

The repository is a pnpm workspace with many tsup configs, one each for cli, core, eval, guardrails, harness, jest, langchain, mcp, mcp-server, openai-agents, redact, studio, tui, viewer, vitest and vscode, among others. For you that means the surface is wide, and the README ties it to support levels named Stable, Supported, Beta, Preview and Experimental. The top of the README labels the core as Stable, but the Dockerfile calls the read-only MCP server a Preview, so check the level of each package you pull in rather than assuming one level for all of them.

Programmatic checks use a TraceContract instead of CLI flags

When the CLI is not enough, the same idea is available as code. The example reads a trace file, defines a contract and evaluates it:

ts
import { openTraceFile } from "agent-inspect/readers";
import {
  defineTraceContract,
  evaluateTraceContractRead,
} from "agent-inspect/checks";

const read = await openTraceFile("./trace.jsonl");
const contract = defineTraceContract({
  run: { requireCompleted: true },
  tools: { required: ["retrieve_policy"] },
});

const result = evaluateTraceContractRead(read, contract);
if (result.status !== "pass") process.exitCode = 1;

This contract says two things: the run must have completed, and the tool retrieve_policy must have been called. Anything else about the run is not asserted. The exit code is set by your own script, so you decide how a non-pass status maps to a pipeline failure.

The full API also exposes TraceFacts for bounded, logical analysis of supported traces. The import paths show the layout: readers and checks are subpaths of the one agent-inspect package, and package.json also exports advanced, persisted and logs entry points.

Releases land in hours and the MCP image pins an older version

The release stream is very fast. [email protected] was published on 2026-10-31 at 06:06 UTC, 6.31.32 at 16:58 and 6.31.33 at 17:59 the same day. The last push to the repository was on 2026-11-02, and it is not archived, so it is actively maintained. A version number of 6.31.33 also means many breaking-change opportunities have already gone by, so read CHANGELOG.md before bumping.

The Dockerfile shows the cost of that pace. It builds a directory-listing image for the Preview read-only MCP server and installs @agent-inspect/[email protected] on node:20.19.5-alpine, with a comment to update the pin with each intended release. That pin is behind the main package version, so the container you run may not match the CLI on your machine.

On positioning, the project describes itself as owning the laptop-to-PR evidence loop and complementing hosted observability, production trace retention and broad eval platforms rather than replacing them. If you need production retention across many users, you still need something else beside it.

Editorial conclusion

Use agent-inspect if you build TypeScript agents and want to see the exact tool path of a run, fail CI when a required tool is skipped and hand a reviewer a redacted bundle, all without an account or collector. Do not expect it to replace hosted production observability or to judge answer quality. Before relying on the safety verdicts, read them as best-effort local assessments and review every bundle yourself.

Frequently asked questions

What is agent-inspect used for?

agent-inspect is used to debug TypeScript AI agent runs from a local JSONL trace. It shows execution trees, checks tool paths in CI and creates redacted offline evidence bundles.

What is the command to inspect a run with agent-inspect?

Use npx agent-inspect view <run-id> --dir .agent-inspect --summary to see the nested steps, tool calls, LLM calls and the first causal failure. The report and explain commands take the same run ID and directory.

Does agent-inspect upload my traces anywhere?

No default upload happens. The project states it needs no account and no collector, is metadata-only by default, and keeps traces as local JSONL.

Official sources

  1. License: MIT
  2. Project website
  3. rajudandigam/agent-inspect on GitHub
  4. README
  5. Releases
Community

Where developers are discussing it

Posts on Hacker News, dev.to and Lobsters that link to this repository, found by our scan of those communities. 6 in the last 30 days; newest first.

Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/rajudandigam-agent-inspect.svg)](https://hysenlabs.com/projects/rajudandigam-agent-inspect)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/rajudandigam-agent-inspect.svg)](https://hysenlabs.com/projects/rajudandigam-agent-inspect)

Was this useful?