Skip to main content

BenchFlow

Run AI agents on benchmark tasks in sandboxes, and score them.

PyPI package GitHub stars Discord members

BenchFlow runs AI agents on tasks in sandboxes and scores them. Point it at a benchmark's tasks and pick an agent: Claude Code, Codex, Gemini CLI, OpenHands and more, over ACP. Each run records its reward, cost and full trajectory.

Tasks run on Docker (local or remote), Daytona, Modal or AgentCore. The same runtime serves evaluation and RL training.

Quick start

You need Docker running and uv. Steps 1 and 2 need no model and no API key.

1. Install BenchFlow and check this machine.

uv tool install --python 3.12 benchflow
bench doctor    # needs 0.8 or newer; checks Docker, agent logins and network, with a fix for each problem

The examples use bench; the installed benchflow command is the same CLI.

Before you log in to an agent, bench doctor reports that no agent can run. That is expected: step 2 needs no login.

2. Run a task with the oracle. The oracle runs the task's own reference solution. It tests the sandbox, the task and its verifier with no model:

bench run --source-repo benchflow-ai/skillsbench --source-path tasks/citation-check \
  --agent oracle --sandbox docker --jobs-dir jobs/oracle

BenchFlow downloads only that task from SkillsBench, builds its image, runs its solution and verifier, and prints Score: 1/1. A cold-cache first run took 6 minutes 12 seconds, including the verifier's package downloads; allow longer on a slow connection.

3. Run an agent on your Claude subscription. No API key is needed. claude setup-token comes with Claude Code and prints a login token that lasts a year:

claude setup-token
export CLAUDE_CODE_OAUTH_TOKEN='<token>'
bench run --source-repo benchflow-ai/skillsbench --source-path tasks/citation-check \
  --agent claude --model claude-haiku-4-5-20251001 --sandbox docker --jobs-dir jobs/claude

The agent may pass or fail. Either way, the run worked.

Billing: an exported ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN wins over the token and is billed. Unset both to use your subscription.

On a ChatGPT plan, run codex login and use --agent codex --model <model> with a model your plan offers. Auth covers API keys and the other agents.

4. Read the results.

bench results jobs/              # one row per job, named by its folder, with its score
bench eval metrics jobs/claude   # pass rate, solve rate, pass@k, tool calls and time
bench view jobs/claude           # trajectory, verifier output and score, in your browser

jobs/claude is a jobs directory; each timestamped child is one job. Copy the exact Artifacts: path printed by bench run to inspect or resume that job with bench results <job> or bench eval resume <job>. If you skipped the model run, use jobs/oracle instead.

Each run writes its rewards, token usage and trajectory under --jobs-dir. Run the same command again to resume the latest matching job: finished tasks are kept, not rerun. Add --fresh to start over.

Next steps

Documentation

To have a coding agent do the quick start for you, paste the agent quickstart prompt into Claude Code, Codex CLI or Gemini CLI.

Start and run

If you want to… Read
Run your first task, then a model Quick start
Install, upgrade or uninstall Install
Keep the Rust bench beside this one Which bench runs
Log in to an agent, or use an API key Auth
Know what a task, dataset, agent, sandbox, verifier, trial and job are Core concepts
Run any benchmark, including ones with their own task format Run any benchmark
Find out why a run failed, whose problem it is, and what to do When a run fails
Resume an interrupted job Resume a job
Run an agent from the public agents repo (goose, qwen-code, prime-agent, …) Running external agents
Run Claude Code or Codex through their own CLIs instead of their ACP adapters Native harness
Run a hosted PrimeIntellect / Verifiers environment CLI reference
Run tasks on a Docker host you control Remote Docker
Keep BenchFlow loaded between CLI calls, and prepare the next sandbox Local runtime
Cap a job's spend, sandbox time, tokens or rollouts Budgets

Several agents, several rounds, branching

If you want to… Read
Run several agents in one task: coder and reviewer, simulated user Scenes and simulated users
Give one agent hints over several rounds Progressive disclosure
Fork a run at a checkpoint into scored children Branching
Evaluate a skill rather than a workspace Skill eval
Run robots and simulators Embodied rollouts

Scores you can trust

If you want to… Read
Understand the security model Sandbox hardening
Score in a sandbox that holds only the agent's final workspace and declared artifacts Separate verifier sandboxes
Check what the agent did to the things its reward depends on (BenchShield) Reward integrity
Re-score stored runs after fixing a verifier, without running the agent again Regrade

Tasks

If you want to… Read
Write a new task Task authoring
Write a task in the native task.md format task.md authoring
Run task.md draft 2 packages task.md draft 2 packages
Run a benchmark's own task folders with no conversion Task formats

Results and training

If you want to… Read
Read, compare and export runs in Python or a notebook Analysing runs
Stream rollouts to a trainer while a job runs Streaming rollouts
Capture token ids and logprobs for training Token capture
Share a coding-agent session or trial Share a trajectory

Reference

If you want to… Read
Every command and flag CLI reference
The Python API Python API reference
Stable and preview releases Install: stable and preview releases

Runnable scripts and notebooks are in docs/examples/.

Run a benchmark from a Git repository

A run config names the repository and the folder of tasks in it, then the agent and model:

# benchmarks/harvey-lab/harvey-lab-gemini-flash-lite.yaml
source:
  repo: benchflow-ai/benchmarks
  path: datasets/harvey-lab/tasks

agent: gemini
model: gemini/gemini-3.5-flash-lite
environment: docker
concurrency: 4
# From the config, in a clone of this repository (benchmarks/ is not in the installed package)
bench run --config benchmarks/harvey-lab/harvey-lab-gemini-flash-lite.yaml

# The same source, inline
bench run benchflow-ai/benchmarks/datasets/harvey-lab/tasks \
    --agent gemini --model gemini/gemini-3.5-flash-lite --sandbox docker --concurrency 4

BenchFlow caches repositories in .cache/datasets-v2/, at the root of the Git repository you run from, or in the current folder outside one. BenchFlow writes a .gitignore there, so the cache never shows in git status. With a folder in the target, it downloads only that folder. A target with no folder, or a folder with no BenchFlow task in it, downloads the whole repository.

Write a task

A task is a folder: a task.md (YAML settings on top, the instruction below), an environment/ folder and a verifier/ folder. Four commands cover a task's life:

bench new my-task                          # scaffold tasks/my-task
bench check tasks/my-task                  # validate it (default: --level structural)
bench import legacy-task/ --remove-legacy  # convert a task.toml + instruction.md task
bench export tasks/my-task out/            # write the split layout, with a loss report

bench new leaves placeholders for the task author; bench check reports them until you fill in the instruction, oracle and verifier. The import command assumes an existing legacy-task/ folder in the split format.

BenchFlow also runs older split tasks (task.toml, instruction.md, solution/, tests/), task.md draft 2 packages, and any task format a benchmark registers. See task.md authoring and the task standard.

Contributing

For a source build, prepare the pinned bfx binaries first; see Build from a checkout. Without them, Docker uses the fallback root steps.

Open pull requests against main. CI runs ruff (lint and format), ty, the unit tests, a Docker integration tier and pip-audit. Run the same checks before you push:

uv sync --extra dev --extra sandbox-daytona --extra sandbox-modal
uv run ruff check src tests tools
uv run ruff format --check src tests tools
uv run ty check
uv run python -m pytest tests/ -k 'not cloud_metadata'

A checkout has no bfx binaries (BenchFlow's helper for root's steps on Docker; they are not in git). An editable install runs without them, as with BENCHFLOW_BFX_DELIVERY=off. To run Docker trials with bfx, or before you build a wheel, build them on Linux with rustup installed: BFX_REQUIRE_PIN=1 scripts/build_bfx.sh (or make bfx). See Try a pre-release.

Merges to main publish an internal preview once CI passes. A release tag publishes the public release. See Stable and preview releases; maintainers, see Publishing a release.

License

Apache-2.0.

Metadata

Release files for benchflow 0.9.2

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

Source distribution (sdist)

Source distribution for benchflow 0.9.2
File Size Uploaded Provenance Actions
benchflow-0.9.2.tar.gz 4.5 MB Without provenance Details for benchflow-0.9.2.tar.gz

Built distribution (wheel)

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

Total release size: 9.2 MB

Release files / benchflow-0.9.2.tar.gz

Download URL benchflow-0.9.2.tar.gz
Size 4.5 MB
Tags Source
SHA-256 checksum
How to use checksums
60023d35f9337bb6b0e540115b5d8629ed470b25ade7e654e6a5c1d2d9bff401
BLAKE2b-256 checksum
How to use checksums
f8f37286aadf18b7b1c1ea6b6bdbf40e682eece334bc6d6944c52c51b619fa9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / benchflow-0.9.2-py3-none-any.whl

Download URL benchflow-0.9.2-py3-none-any.whl
Size 4.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0ede69cab59e8c397c58e80d3c68d60240ede0722c03e495dbd2400329d9cf9e
BLAKE2b-256 checksum
How to use checksums
40a5341c7b62b6b3b2c47022e103349ac6fadbe52d99b1275d3d2d25fd2148a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for benchflow 0.9.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.2 This release

2 release files No provenance

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