npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nexus-eval-atbench

v0.1.4

Published

Atbench (agent-trajectory safety benchmark) evaluation harness for nexus-agents

Readme

nexus-eval-atbench

Atbench (agent-trajectory safety) evaluation harness for nexus-agents — implements the BenchmarkAdapter contract from nexus-agents ≥ 2.33.1.

Source: extracted from in-tree packages/nexus-agents/src/benchmarks/atbench/ per the nexus-agents harness-extraction policy (epic #2514, originally #1960).

What this benchmark measures

Atbench evaluates an agent's trajectory safety — given a recorded session of (user request → tool calls → outputs), can a scorer correctly classify whether the trajectory was safe or unsafe? The benchmark surfaces:

  • Confusion matrix (TP/TN/FP/FN) over a labelled trajectory set
  • Precision / recall / F1 for the unsafe class
  • Two harness variants: claw (default — for ClawGuard-style trajectory analysis) and codex (the upstream Codex-style scorer)

Install

npm install nexus-eval-atbench nexus-agents

nexus-agents is a peer dependency.

Quick start

# Run against the bundled fixture
npx nexus-eval-atbench --fixture ./fixtures/sample.jsonl

# Run against the HuggingFace dataset (when available)
npx nexus-eval-atbench --variant claw --limit 10

# JSON summary
npx nexus-eval-atbench --json --fixture ./fixtures/sample.jsonl > run.json

Library usage

import { runBenchmark } from 'nexus-agents';
import { ATBenchAdapter } from 'nexus-eval-atbench';

const adapter = new ATBenchAdapter({ variant: 'claw' });
const summary = await runBenchmark(adapter, { fixturePath: './fixtures/sample.jsonl' });
console.log(`F1: ${summary.metadata.f1}, precision: ${summary.metadata.precision}`);

LLM-scored trajectories

The default runInstance uses a heuristic stub scorer. Pass a real IModelAdapter to score with an LLM:

const adapter = new ATBenchAdapter({
  variant: 'claw',
  scorerAdapter: myModelAdapter,
  scorerTimeoutMs: 5000,
});

What this harness does

  • Loads ATBench instances from a local JSONL fixture or the HuggingFace dataset.
  • Runs each trajectory through the configured scorer (stub heuristic or LLM).
  • Compares the scorer's predicted label (safe / unsafe) against ground truth.
  • Aggregates into a confusion matrix + precision/recall/F1.

Migration note (for nexus-agents users)

Prior to this extraction, atbench shipped as nexus-agents atbench CLI subcommand and as import('nexus-agents/benchmarks/atbench'). Both are now deprecated. Migration:

- npx nexus-agents atbench --fixture ./fixture.jsonl
+ npx nexus-eval-atbench --fixture ./fixture.jsonl

- import { ATBenchAdapter } from 'nexus-agents/benchmarks/atbench';
+ import { ATBenchAdapter } from 'nexus-eval-atbench';

The in-tree code will be removed from nexus-agents after this package is published. See nexus-agents #2516 for tracking.

The contract

BenchmarkAdapter from nexus-agents:

interface BenchmarkAdapter<TInstance, TPrediction, TEvalResult> {
  readonly name: string;
  readonly variant?: string;
  loadInstances(config): Promise<readonly TInstance[]>;
  runInstance(instance, ctx): Promise<TPrediction>;
  evaluate(instance, prediction): Promise<TEvalResult>;
  isPass(result): boolean;
  summarize(results, runTimeMs): BenchmarkRunSummary;
}

The orchestrator (runBenchmark in nexus-agents) handles concurrency, timeouts, progress, and partial failure.

License

MIT.