Skip to main content

Culprit

git bisect for AI agent behaviour. When your agent's eval suite gets worse, Culprit finds the commit that did it. Evals are noisy, so it runs each step several times, decides with 95% confidence intervals, and resamples when the answer is unclear. It then reads why the change was made, finds the responsible lines, and writes a fix that it verifies on held-out tasks.

You bring your own model key. Culprit runs on your machine and only creates git worktrees under .culprit/; it never edits your checkout.

Install

pip install culprit-cli

Needs Python 3.12+ and git. Culprit brings its own copy of uv, which it uses to install your agent at each commit. Prefer an isolated install? uv tool install culprit-cli or pipx install culprit-cli. Run culprit help to see the commands in the order you use them.

What your agent's repo needs

  • A git history with a known-good ref (a tag or commit) and a worse one.

  • A uv project with a committed uv.lock. Each commit is installed with uv sync --locked; a commit that won't install is skipped, as git bisect skip does.

  • An eval suite: one file per task in a directory (default evals/).

  • An eval module that runs one task and prints one JSON line:

    python -m myagent.eval --task refund_small_order --seed 0
    # {"passed": true}          optional: "cost", "latency_ms", "tokens", "error"
    

Set up and run

cd my-agent
culprit init                                       # your keys (once), eval module and suite
culprit run --good v1.0 --bad HEAD --budget-usd 3  # find the commit
culprit fix <run_id>                               # localise the lines and verify a fix
culprit report <run_id>                            # markdown and HTML report

Keys

culprit init asks once for an Anthropic or OpenRouter key, and optionally a neatlogs key for tracing. It saves them in ~/.config/culprit/credentials.env, readable only by you, so every repo you set up uses them. Run culprit init --keys to change them.

To override a saved key, set it in your repo's .env (for that repo only) or in your shell. The shell wins, then the repo's .env, then the saved setup. The settings Culprit reads are ANTHROPIC_API_KEY, OPENROUTER_API_KEY, NEATLOGS_API_KEY, VICTIM_MODEL and CULPRIT_MODEL. It ignores everything else in a repo's .env, but your agent's own runs get the whole file. When a repo's .env supplies one of these settings, Culprit prints which ones, so a cloned repo can't switch your keys silently.

With an Anthropic key, Claude Sonnet 5.5 is used; otherwise GLM 5.3 via OpenRouter. Set VICTIM_MODEL or CULPRIT_MODEL to choose other models from the same provider.

Run Culprit only on repos you trust. It runs the repo's code at every commit it tests, just as running its test suite would.

Other commands

Command What it answers
culprit ci --base main --head HEAD Is this pull request a regression? Exit 0 clean, 1 regression (writes a PR comment), 2 undecided
culprit drift --ref v1.0 Did the model change underneath us? Re-runs a recorded good ref with the same seeds
culprit audit --ref HEAD Which realistic regressions would our suite miss? Mutation testing for agents
culprit resume <run_id> Continue a stopped run, for example after it hit --budget-usd

Cost

You pay your model provider for your agent's runs and Culprit's own model calls. On our test agent (26 tasks, 3 runs each) a bisect cost between $0.04 and $1.74 depending on the model. --budget-usd is a hard cap; a run stops there and can be resumed.

Documentation: https://culprit-site.vercel.app/docs/

Licensed under the Apache License, Version 2.0.

Metadata

Release files for culprit-cli 0.1.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 culprit-cli 0.1.2
File Size Uploaded Provenance Actions
culprit_cli-0.1.2.tar.gz 87.1 kB Without provenance Details for culprit_cli-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for culprit-cli 0.1.2
File Interpreter ABI Platform Actions
culprit_cli-0.1.2-py3-none-any.whl Python 3 none any Details for culprit_cli-0.1.2-py3-none-any.whl

Total release size: 191.1 kB

Release files / culprit_cli-0.1.2.tar.gz

Download URL culprit_cli-0.1.2.tar.gz
Size 87.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e3c8dbf2eb5c5e2631d8a79ccef1cf6d79f31f694143f3da00cb51e8fa7bcd38
BLAKE2b-256 checksum
How to use checksums
2290172946474d211483fc773e13955d82d90b0c27e2c815013dcd07c8686116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / culprit_cli-0.1.2-py3-none-any.whl

Download URL culprit_cli-0.1.2-py3-none-any.whl
Size 104.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80f75b36ce7c028a0fa46bb63053d6ec2d1d4c0c8a8c483c19dfb0a2c231f7f3
BLAKE2b-256 checksum
How to use checksums
b50a3023fdd0698aa01a5107b3d4a998b44ed55985836c1bef92db1ec7779c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for culprit-cli 0.1.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.

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