Skip to main content

promptcheckup

Know whether a prompt change actually made your AI agent better.

CI PyPI Python License: Apache-2.0

promptcheckup replays the same cases through your old and new prompt,
compares them case by case, and answers better, worse or not sure yet.

Bar chart: comparing prompts on different weeks picked the worse prompt 41.3% of the time; paired replay picked it 0% of the time.

Quick start · Evidence · Daily use · How it works · Connect your agent · FAQ

Why

Most prompt changes are judged by running the new prompt for a while and comparing its average score with the old one. That mostly measures when each prompt ran: a rising market week, an easier batch of questions, a quiet provider update. In the simulation above, that comparison picked the worse prompt 41% of the time.

promptcheckup is built on one idea: compare both prompts on identical inputs, and only claim an improvement the data can support. It works with any agent, in any language, and needs nothing beyond the Python standard library.

Who it is for

You are You use it to
An AI or agentic engineer Gate every prompt pull request, catch silent model or provider regressions every week, and check prompt changes inside the test suite you already run.
A fintech engineer Get an auditable verdict for every prompt change, with prompt hashes, call counts and a report in the pull request, and redaction before anything is stored or sent.
A quant Stop trusting lucky backtests. The skew guard refuses "better" when a few large losses hide among small gains, the trial ledger counts how many variants you've tried, and assert_no_lookahead proves an agent can't see the future.

It pays off when an agent is in real use, its prompts change, and "better" can be scored or written as clear criteria. It's the wrong tool for prompts that change every hour, for tasks with no agreed definition of a good answer, or for comparing models on general capability.

Installation

Python 3.11 or later. No runtime dependencies.

pip install promptcheckup

Quick start

promptcheckup init      # writes promptcheckup.toml, example cases and two GitHub workflows

Edit promptcheckup.toml to point at your agent (a Python function run(case, prompts), or any command that reads JSON on stdin), your prompt files and your cases. The Connect your agent guide has copy-paste adapters for plain Python, the OpenAI and Anthropic SDKs, and Node.js. Then check the wiring and gate your first change:

promptcheckup doctor    # config, prompts, cases, agent, scoring, judge and budget, one line each
promptcheckup gate --old-ref origin/main --out report.md

The gate prints the planned calls and asks before spending anything (--yes skips the question in CI). The report's first line is the verdict:

B is better: 28 of 30 cases improved (95% CI +0.78 to +0.99).
Exit code Meaning
0 better (checkup: stable)
1 worse (checkup: drift)
2 not sure yet
3 configuration or runtime error, with a one-line message

Prefer the library? The statistics alone take one call:

from promptcheckup import decide

verdict = decide([new - old for old, new in zip(old_scores, new_scores)])
print(verdict.decision, verdict.reason)

Evidence

Every number below comes from a file in this repository or a command anyone can rerun.

Without promptcheckup With promptcheckup Source
Comparing prompts run on different weeks picked the worse prompt 41.3% of the time. Paired replay picked it 0% of the time. gate benchmark
When nothing really changed, a plain statistical test on crash-skewed P&L said "better" 9–13% of the time. The gate said "better" 2.0–2.7% of the time on every noise type, against a 2.5% target. gate benchmark
In the trading example, policy B won 26 cases to 13, so a win count crowns it. The gate said not sure yet (+12.76 bp, 95% CI −11.04 to +36.57). Across all 2,085 ticker-days the true edge is +1.37 bp, which is indistinguishable from zero. trading example
A silent provider regression goes unnoticed until users complain. The weekly check-up flagged it in 87.5% of incident weeks, with about 1 false alarm per year. simulated year
A prompt merged without review starts a fresh baseline and hides a regression. The weekly check-up compares it with the previous prompt and flagged it in 98.5% of incident weeks. simulated year
An "improved" prompt that memorises its test cases ships. evolve gates every edit on held-out cases and rejects it. evolve test
An LLM judge is trusted without checking. Claude Haiku 5.5, Sonnet 5.5 and Opus 5.5 each judged the same 30 cases, and each passed the self-check at 100% order consistency before its verdict was trusted. support-bot reports

A full gate on 30 cases with Claude Haiku 5.5 as the judge took 180 judge calls (58,330 input and 40,108 output tokens).

Daily use

Gate every prompt pull request

promptcheckup init writes .github/workflows/promptcheckup-gate.yml. On every pull request that touches a prompt file, it compares the new prompts with the base branch and comments the report on the pull request. In judge mode the judge is first checked against itself, comparing the old prompt with the old prompt, so a biased judge can't produce a verdict.

A weekly check-up

promptcheckup checkup --out checkup.md --proposal-out proposal.md

Each run:

  • compares this week's answers with last week's, so a silent model, tool or provider change shows up as drift (exit code 1). If the prompt changed since the last check-up, it compares with the previous prompt instead, so an unreviewed merge is caught too;
  • groups failing cases into at most three patterns;
  • proposes one small, cited prompt edit, kept only if it passes the same paired gate.

With no cases yet, the first run generates 20 labelled synthetic starter cases. The weekly workflow posts every report to one long-running issue and opens a pull request for an edit that passed. It never merges.

Let it improve the prompt on its own

promptcheckup evolve --rounds 5 --out evolve.md

evolve repeats the proposal step: find failures, propose a small edit, gate it, keep it if it wins, and go again. It is built not to fool itself:

  • It learns and judges on different cases. Cases are split by a fixed rule on their IDs, never by results. Proposals only see the learning cases, and every edit is gated on the held-out ones.
  • The bar rises with every extra round. Each round must pass at 1 − 0.05 / rounds confidence (99% for 5 rounds), so the chance of keeping any false improvement over the whole run stays near 5%.
  • It stops at the first round that doesn't pass. It writes the final prompt files and a lineage report (each round's reasoning, cited cases, held-out statistics and diff), and never merges or deploys.

Every gated comparison is recorded in .promptcheckup/trials.jsonl. When several variants have been tried on the same cases, the report says how many, and how many false "better" verdicts that many tries would produce by chance. Set run.confidence to raise the bar everywhere.

In your test suite

from promptcheckup.testing import assert_better, assert_no_lookahead

def test_new_prompt_is_better():
    assert_better(run, cases, old_prompts, new_prompts, score=score)

def test_agent_cannot_see_the_future():
    assert_no_lookahead(build_input, history, decision_times, time_key="date")

assert_better and assert_not_worse run the same gate as the CLI. assert_no_lookahead changes every number after each decision time and fails if the agent's input changes. They raise plain AssertionError, so any test runner works.

With coding agents

Add this to your AGENTS.md or CLAUDE.md, so a coding agent proves its own prompt edits:

After editing prompts, run `promptcheckup doctor` and fix every failure.
Then run `promptcheckup gate --old-ref origin/main --yes --json result.json`.
Report the gate report's first line verbatim and its exit code: 0 better, 1 worse,
2 not sure yet, 3 configuration/runtime error. Never describe "not sure yet" as a pass.

How it works

  1. Replay. Run every case through prompt A and prompt B, back to back, so both see the same conditions.
  2. Pair. For each case, take B's score minus A's score. Anything the two runs share cancels.
  3. Decide. Compute a paired 95% t confidence interval of the mean difference, using an exact Student t quantile:
    • better if it sits entirely above zero;
    • worse if it sits entirely below zero;
    • not sure yet otherwise, with fewer than 20 cases, or when the differences are skewed toward a few large losses.

Scores come from your own score(case, output) function or from an LLM judge. The judge compares both answers in both orders and is checked against itself on every run. Agent outputs are redacted before they are cached, stored or sent, and untrusted data can't close its prompt block to inject instructions. The full architecture and every design decision are in DESIGN.md.

Examples

Example What it shows Needs a key
Planted A naive comparison picks the wrong prompt; paired replay picks the right one. No
Support bot A five-minute judge-mode quickstart, with real reports from three hosted judges. For a new judge run
Trading An LLM trader on a seeded synthetic market. Model replies are recorded, every case sees only past data (proven by a test), and cases are chosen by a fixed rule. No
Connect your agent Tested adapters for plain Python, the OpenAI and Anthropic SDKs, Node.js, and the test-suite helpers. No

Benchmarks

Seeded simulations of the shipped code, reproducible with the commands below.

False "better" verdicts when nothing changed. The target is 2.5%. A plain t-interval fails on crash-skewed P&L; the skew guard holds the rate there too.

False "better" rate by method, noise type and case count

Detection power. Being conservative has a cost: plan on about 50 cases to reliably detect a medium-sized improvement.

Detection rate by improvement size and case count

A simulated year of weekly check-ups. 200 seeded years of 52 weeks through the real checkup(), with 50 cases and five planted incidents:

Planted incident Result in the incident week
Harmful provider change (0.5 noise SD) drift flagged in 87.5% of years
Harmless provider change falsely flagged in 2.0%
Prompt regression merged without review flagged in 98.5%
Real fix proposed kept in 92.5%
Useless fix proposed rejected in 95.0%; gated 2,000 more times, it was falsely kept 2.05% of the time

Quiet weeks raised a false drift alarm 2.3% of the time, about one per year. The incidents are planted effects of known size, with plain-function model stubs.

Weekly drift flags and proposal outcomes over 200 simulated years

PYTHONPATH=src python benchmarks/run_gate_benchmark.py                    # about 40 seconds
PYTHONPATH=src python benchmarks/run_checkup_simulation.py --repeats 200  # about 30 seconds
python benchmarks/charts.py                                               # renders the charts

Known limitations

  • Small effects need many cases. "Not sure yet" usually means collect more cases; the power chart shows how many.
  • Live tools add noise. Tools such as web search can give A and B different results. Replaying both back to back limits this, and the gate falls back to "not sure yet" rather than a wrong verdict.
  • Case choice matters. Choose cases before looking at results, from recorded traffic or a fixed rule. The gate can't correct a sample picked because it flatters a change.
  • The weekly check-up finds an unreviewed regression after it is live. Run the gate on every pull request before merging.

The complete list, and what is deliberately out of scope, is in DESIGN.md.

FAQ

Why does it say "not sure yet" so often?

That is the point. A wrong "better" ships a worse agent. "Not sure yet" means the evidence can't separate the prompts yet; add cases or run again.

Which judge model should I use?

One at least as capable as your agent's own model on the task. Claude Haiku 5.5, Sonnet 5.5 and Opus 5.5 all reached the right verdict on the support-bot example with a reliable self-check. Sonnet and Opus counted all 30 cases as improved, where Haiku counted 28: a smaller judge is cheaper but less decisive, so plan on more cases. Any OpenAI-compatible endpoint works, including Anthropic's at https://api.anthropic.com/v1.

Does it work for trading agents?

Yes. The skew guard, the trial ledger and the look-ahead check come from trading: strategies that make small gains most days and take a rare large loss look great on short samples. promptcheckup is a research and engineering tool, not financial advice.

Does it send my data anywhere?

Only to the LLM endpoint you configure, for judging, grading and proposals, and only after your redact function has run. The gate in score mode makes no network calls at all. Nothing is ever sent to the authors.

Will it change my prompts on its own?

It writes proposed edits to your working tree only after they pass the gate, and the workflows open a pull request for a person to review. It never merges, deploys or pushes to your main branch.

Acknowledgements

promptcheckup builds on ideas from these papers. It implements them from the paper descriptions and copies no code:

  • MemTrial (Wu, Cai and Wang): comparing decisions on the same inputs so shared noise cancels.
  • EvolveTrade (Kim, Choi, Kang and Hwang): rewriting an agent's prompt from its own decision traces and outcomes.
  • SHARP (Chen et al.): small, attributable, validated policy edits.
  • ATLAS (Papadakis et al.) and GEPA (Agrawal et al.): prior work on feedback-driven prompt optimization.

Citation

If promptcheckup helps your work, please cite it. The metadata is in CITATION.cff, and GitHub's "Cite this repository" button formats it for you.

Contributing

Issues and pull requests are welcome. To set up a development environment:

git clone https://github.com/gael55x/promptcheckup && cd promptcheckup
python3 -m venv .venv
.venv/bin/pip install pytest==9.1.1 ruff==0.17.1
.venv/bin/pytest
.venv/bin/ruff check . && .venv/bin/ruff format --check .

Changes follow test-driven development and Conventional Commits. See the changelog for release history.

License

Licensed under the Apache License, Version 2.0.

Metadata

Release files for promptcheckup 1.0.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 promptcheckup 1.0.0
File Size Uploaded Provenance Actions
promptcheckup-1.0.0.tar.gz 231.7 kB With provenance Details for promptcheckup-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 304.9 kB

Release files / promptcheckup-1.0.0.tar.gz

Download URL promptcheckup-1.0.0.tar.gz
Size 231.7 kB
Tags Source
SHA-256 checksum
How to use checksums
abf23c6ff8ff252a8e1c639646546b9f76bd8660dcc03f56cc55b6302ddc47bd
BLAKE2b-256 checksum
How to use checksums
bf960a4dfcd7f6cd1ea7524fa4c2f6f579c52fbbe8fd8f770b1ea872fafaa38d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / promptcheckup-1.0.0-py3-none-any.whl

Download URL promptcheckup-1.0.0-py3-none-any.whl
Size 73.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52057846726efe4ffb673cb96944758e94f33149f0bdcffdb8c0cf03352cda81
BLAKE2b-256 checksum
How to use checksums
6b2d1f6482285525ee3753a5cc98ad5c0d5500b3e8e05a7c27df3ea52cb678d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for promptcheckup 1.0.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for promptcheckup-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

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