Skip to main content

toolbench

toolbench is a platform and CLI for building benchmarks for agentic tools and harnesses. Compose a benchmark (a task + a grading rubric) with a harness (the agent runtime), a loadout (the tools the agent is given), and a variant (the prompt + sandbox), run N trials per cell against a model, and get reach / pass@k / pass^k metrics with plots.

It is the benchmarking sibling of toolbase — the package manager and runtime for agent tools. toolbase serves the tools; toolbench measures how well an agent uses them. Together they close the loop for agentic tool and harness development.

Install

pip install toolbench                 # core framework
pip install 'toolbench[toolbase]'     # + resolve tools from toolbase profiles

Requires Python ≥ 3.12. The CLI is available as both toolbench and the short alias tbe.

Quickstart

The example geometry benchmark (Euclidean distance + midpoint between two 2-D points) is a self-contained, dependency-free example that exercises the whole framework.

# Validate the wiring with no LLM calls or cost:
toolbench run --benchmark examples/geometry --model stub \
    --loadouts full_local --n 1 --max-cost-usd 0 --dry-run

# A real run (a few cheap trials):
toolbench run --benchmark examples/geometry --model claude-haiku-4-5 \
    --loadouts core_only,full_local --n 3 --max-cost-usd 0.50

Each run writes a directory under runs/<run_id>/ with a manifest.json, per-trial transcripts and artifacts, an aggregated summary.json / summary.txt, and headline plots (k-sweep, parallel-coordinates, per-stage breakdown).

Concepts

A benchmark lives in examples/<name>/ and is composed from four declarative axes — vary any of them on the command line to run an ablation:

Concept What it is Where it lives
Benchmark The task + grading rubric + ground truth. benchmark.yaml
Harness The agent runtime (orchestral, claude_code, codex), provider, core tools, and loop policy. harnesses/*.yaml
Loadout The domain tools the agent gets (beyond the harness core). loadouts/*.yaml
Variant The prompt + sandbox seed (scaffolding axis), orthogonal to tools. variants/<name>/
Rubric Ordered, weighted stages of checks; trial score = weighted reach. inside benchmark.yaml

A loadout source is one of:

  • python: — import a module exposing TOOLS / make_tools() (the no-dependency escape hatch),

  • toolbase: — resolve tools from a toolbase profile, in-process (requires toolbench[toolbase]); served toolkit versions are recorded in the run manifest as reproducibility provenance, or

  • mcp: — serve any MCP server's tools, stdio or HTTP (requires toolbench[mcp]):

    tools:
      sources:
        - toolbase: { profile: my-profile }
          select: [calculator__add]          # optional: ablate within the profile
        - mcp: { url: "https://host/mcp", headers: { Authorization: "Bearer ${TOK}" } }
    

Metrics

For each (model × condition) cell over k trials:

  • $\overline{\text{reach}}_k$ — mean rubric-weighted reach: how far through the task the agent gets, on average.
  • $\text{pass@}k$ — probability that at least one of $k$ trials passes (best-of-$k$).
  • $\text{pass}^{k}$ — probability that all $k$ trials pass (worst-of-$k$).

with bootstrap 95% confidence intervals and a metric-correlation matrix. A trial passes when it clears the rubric's pass criterion — every stage by default, or reach ≥ a pass_threshold once the rubric uses partial-credit stages. See Metrics for the exact estimators.

Commands

Command What it does
toolbench run Run a benchmark across the harness × loadout × variant × model grid.
toolbench resume Resume an interrupted run; run only the seeds not yet completed.
toolbench regrade Re-judge a finished run's preserved artifacts after a rubric change.

Run toolbench --help (or tbe --help) for the full reference.

Also

  • Runtimes — besides the API-driven orchestral runtime, toolbench drives the claude_code and codex CLIs directly (subscription auth, no API key), with per-turn token accounting and a filesystem sandbox. Copy-paste starting points live in harness_templates/.
  • Judges — grade with the deterministic rule judge (default) or add an LLM second opinion (--judge rule+llm); the rule grade always stays authoritative. Any judge can be applied after the fact with toolbench regrade --judge ….
  • Safeguards — trials that read the ground-truth answer key are quarantined (INTEGRITY_LEAK, scored 0) so a leak can't inflate the headline; every trial also gets a readable audit.txt of its full trajectory.

License

MIT

Release files for toolbench 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toolbench 0.3.0
File Size Uploaded
toolbench-0.3.0.tar.gz 257.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for toolbench 0.3.0
File Interpreter ABI Platform
toolbench-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 438.5 kB

Release files / toolbench-0.3.0.tar.gz

Download URL toolbench-0.3.0.tar.gz
Size 257.1 kB
Tags Source
SHA-256 checksum
How to use checksums
40ee0b23177c9657e95f534b2ebae4bc79b6af42385062547b5a3163b55209d6
BLAKE2b-256 checksum
How to use checksums
e541b8142fc1c57bd421b3274f27718d30acb4b14075d06ed4b4709e1eaf6d7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / toolbench-0.3.0-py3-none-any.whl

Download URL toolbench-0.3.0-py3-none-any.whl
Size 181.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1460751dbe67a3b37bf46c14dc5e33d13c8214b5396d030b3ad5fb2183d04d1
BLAKE2b-256 checksum
How to use checksums
33583be8efd6f69216b4e3d64a1a402ffbfd4f39773ca86dbf5d158a238efdc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

0.8.1

2 release files

0.8.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page