AgentRecheck

Open-source Python SDK · OpenAI + Anthropic

CI/CD for AI agents

You changed a prompt. Did the agent get worse? AgentRecheck records real agent runs, turns them into tests, and replays them on every pull request, so regressions fail the build instead of reaching your users.

$ pip install agentrecheck

pull request #218 · simplify-prompt

$ agentrecheck run

CaseResultToolsCost
order_statusPASSsame$0.00011
password_resetPASSsame$0.00012
refund_eligiblePASSchanged$0.00011
refund_outside_windowFAILchanged$0.00011
refund_with_questionPASSchanged$0.00020

✗ refund_outside_window

tools.sequence (exact): expected ['lookup_order'], got ['issue_refund']

- lookup_order

+ issue_refund

4/5 passed · 1 regression(s) detected. exit 1

Agents don't crash when they get worse. They just quietly do the wrong thing.

Every prompt edit, model swap, and tool change can alter which tools your agent calls, in what order, and at what cost. Unit tests don't see it. Manual testing can't keep up.

A prompt tweak drops a tool call

You tidy the system prompt. The agent stops verifying orders before refunding them. Nothing errors, nothing alerts.

A model upgrade doubles your cost

The new model takes six steps where the old one took three. You notice when the invoice arrives.

You test by hand, so you test five things

Pasting prompts into a playground doesn't scale past a handful of cases, and nobody reruns them on the next change.

How it works

Three steps, no new test framework to learn.

  1. 01

    Trace

    Add one decorator. AgentRecheck records the input, every LLM call, every tool call, tokens, cost, latency, and the final output.

    @trace
    def run_agent(message: str) -> str:
        ...
  2. 02

    Snapshot

    Turn any recorded run into a test case. The baseline is captured for you; add assertions in plain YAML.

    $ agentrecheck snapshot latest \
        --id refund_outside_window
  3. 03

    Run in CI

    Replay every case against the current code on each pull request. A regression exits non-zero and fails the check.

    $ agentrecheck run
    4/5 passed · 1 regression(s)

Instrument once. Assert in YAML.

Check the tool sequence, the arguments, the final answer, and the budget. LLM-as-judge is optional and runs on your own API key.

agent.py
from openai import OpenAI
from agentrecheck import trace, tool, wrap_openai

client = wrap_openai(OpenAI())   # records every LLM call

@tool                            # records every tool call
def lookup_order(order_id: str) -> dict:
    return db.orders.get(order_id)

@trace                           # records the whole run
def run_agent(message: str) -> str:
    ...
agentrecheck_cases/refund_outside_window.yaml
id: refund_outside_window
input:
  args: ["Please refund order A1003"]
assertions:
  tools:
    sequence: [lookup_order]     # must check, must not refund
    mode: exact
  output:
    contains: ["30-day"]
    not_contains: ["has been issued"]
    judge:
      rubric: Politely declines and explains the policy.
      min_score: 0.7
  budgets:
    max_cost_usd: 0.01
    max_steps: 4

Pricing

The SDK and CLI are open source and run entirely on your machine. The dashboard is optional.

Free

$0 / month

  • 1 project
  • 1,000 traces per month
  • Unlimited local test runs
  • Trace explorer and run history
Start free

Pro

coming soon

$49 / month

  • Unlimited projects
  • 50,000 traces per month
  • Team seats
  • Everything in Free

Get an email when Pro opens:

Know before you merge.

Add a decorator, snapshot a run, and wire one command into CI.