Agent Eval

io.github.RudrenduPaul由 GitHub 帳號 RudrenduPaul 發布v0.1.8更新於 Oct 24, 2026

Statistical regression testing for LLM agents: p-value, effect size, and CI on behavior change.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理對 LLM 代理人的兩個版本行為做統計迴歸檢定。

可以做什麼
從兩個 JSON 分數檔對代理人的兩個版本做統計比較,以解析後的 JSON 回傳結論、p 值、效應量與信賴區間,並可設定指標名稱、顯著性門檻、最小效應量與重取樣次數。
適用情境
適用於修改了 LLM 代理人的提示詞、模型或相依套件後,需要判斷行為是否真的改變、或只是每次執行間的雜訊,尤其在發布前或接入 CI 閘門時。
執行需求
透過 stdio 在本機執行,用戶端以 uvx 從 agent-regress-cli 套件啟動,需安裝 MCP 附加元件,並需要 Python 工具鏈。未宣告帳號、API 金鑰或環境變數。
安裝前請注意
此工具會以你提供的參數呼叫 agent-regress 命令列,因此助理可在你的機器上執行該命令。它只讀取你指定的分數檔,本身不呼叫任何 LLM。未加 fail-on-regression 旗標時,無論結論為何命令都以成功狀態結束。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Agent Eval,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[Agent-Eval: Measure LLM Drift - Statistical regression testing for LLM agents | Product Hunt]

Agent Evaluation

[PyPI] [npm] [License: Apache 2.0] [CI] [OpenSSF Scorecard]

Statistical regression testing for LLM agents: run version A and version B 50x each and get a p-value, an effect size, and a 95% confidence interval on whether behavior actually shifted.

[agent-eval running the basic-comparison example and reporting a REGRESSED verdict with p-value, Cohen's d, and a 95% confidence interval]

bash
pip install agent-regress-cli

(uv add and the npm/npx wrapper are covered in Install below.)

The test that every eval framework skips

You changed a prompt. Your evals still pass. But your agent's tool accuracy dropped from 84% to 70%.

Is that a real regression? Or is it LLM run-to-run noise?

Threshold testing cannot answer that question. agent-eval can.

Run your agent 50x on version A, 50x on version B. Get a p-value, an effect size, and a 95% confidence interval on whether behavior actually shifted.

p=0.003, Cohen's d=-0.61 -> REGRESSED (deploy blocked)p=0.410, Cohen's d=0.021 -> STABLE (safe to ship)

[!NOTE] Promptfoo, one of the most widely used open-source LLM eval frameworks, was acquired by OpenAI in March 2026, staying open source but folding its team into OpenAI's Frontier platform. agent-eval is Apache 2.0-licensed, self-hostable, and has no commercial dependency. The statistical core (Mann-Whitney U, bootstrap CI, Cohen's d) will never be paywalled.


Install

bash
pip install agent-regress-cli# oruv add agent-regress-cli# or, from Node/npx (thin wrapper around the same Python CLI)npx agent-regress-cli

Quickstart

In 30 seconds (CLI)

Already have per-run scores from your own harness? Point the CLI at two JSON arrays of scores, one per version:

bash
pip install agent-regress-cli
agent-regress compare \  --version-a-results v1_scores.json \  --version-b-results v2_scores.json \  --metric tool_accuracy
# ============================================================# agent-regress Report -- tool_accuracy# ============================================================# Verdict:    REGRESSED# p-value:    0.0000# Cohen's d:  -2.193# 95% CI:     [-0.213, -0.148]## Version A:  0.8470 +/- 0.0525  (n=50)# Version B:  0.6685 +/- 0.1025  (n=50)# Delta:      -0.1786# ============================================================

Add --json --fail-on-regression to get clean, parseable output and a non-zero exit code on REGRESSED, for wiring straight into CI.

[agent-regress compare run from the CLI end to end, from install through a REGRESSED verdict]

All agent-regress compare flags:

FlagDefaultDescription
--version-a-results PATH(required)Path to a JSON array of per-run scores for version A (baseline).
--version-b-results PATH(required)Path to a JSON array of per-run scores for version B (candidate).
--metric NAMEaccuracyName of the metric being compared, shown in the report.
--p-threshold P0.05Significance threshold for the Mann-Whitney U p-value.
--min-effect D0.2Minimum |Cohen's d| to call a statistically significant difference REGRESSED/IMPROVED rather than STABLE.
--n-resamples N1000Number of bootstrap resamples used for the confidence interval (minimum: 100).
--jsonoffPrint the report as a single JSON object to stdout instead of the human-readable format. Warnings still go to stderr, so stdout stays clean, parseable JSON.
--fail-on-regressionoffExit with status 1 if the verdict is REGRESSED (useful for CI). Without this flag, the command exits 0 regardless of verdict.

The top-level agent-regress --version flag prints the installed version and exits.

Exit codes:

CodeMeaning
0Ran successfully. Verdict may be REGRESSED, STABLE, IMPROVED, or INSUFFICIENT_DATA — without --fail-on-regression, the exit code doesn't reflect the verdict.
1--fail-on-regression was passed and the verdict is REGRESSED.
2Usage or data error: invalid/missing arguments, no subcommand given, a --version-*-results file that doesn't exist or isn't valid JSON, an empty/non-numeric scores array, or an out-of-range value for --p-threshold (must be in (0, 1)), --min-effect (must be >= 0), or --n-resamples (must be >= 100).

In your code (Python API)

Driving the agent yourself instead of pre-computing scores? Use the Python API:

python
from agent_regress import compare
# Any callable that takes a test case dict and returns a score 0.0-1.0def agent_v1(test_case: dict) -> float:    ...  # your existing agent
def agent_v2(test_case: dict) -> float:    ...  # your updated agent
test_suite = [    {"query": "find SKU for order 8823", "expected": "SKU-4492"},    # ... more test cases]
report = compare(    version_a=agent_v1,    version_b=agent_v2,    test_suite=test_suite,    n_runs=50,    metric="tool_accuracy",  # use any name except "accuracy" when agents return floats)
print(report)           # structured output with p-value, CI, effect sizereport.assert_stable()  # raises AssertionError if behavior regressed

Agent returns text? Pass a scorer or use the built-ins:

python
from agent_regress import compare, exact_match_scorer, f1_scorer
# exact_match_scorer: 1.0 if str(output).strip() == str(expected).strip()# f1_scorer: token-level F1 (multiset — handles repeated tokens correctly)report = compare(    version_a=agent_v1,    version_b=agent_v2,    test_suite=test_suite,    n_runs=50,    scorer=exact_match_scorer,  # test_case must have an "expected" key)

Or write your own:

python
def my_scorer(output: str, test_case: dict) -> float:    return 1.0 if output.strip() == test_case["expected"] else 0.0
report = compare(..., scorer=my_scorer)

MCP Server

agent-eval ships a Model Context Protocol server so an AI agent (Claude, Cursor, or any MCP-compatible client) can run statistical regression tests directly, without a human invoking the CLI by hand.

Install the extra:

bash
pip install "agent-regress-cli[mcp]"

Add it to your MCP client's config (for Claude Desktop, claude_desktop_config.json):

json
{  "mcpServers": {    "agent-eval": {      "command": "uvx",      "args": ["--from", "agent-regress-cli", "agent-regress-mcp"]    }  }}

The server exposes one tool, run, that shells out to the agent-regress CLI with the given subcommand and arguments plus --json, and returns the parsed JSON result:

run(["compare", "--version-a-results", "a.json", "--version-b-results", "b.json", "--metric", "accuracy"])

Transport is stdio, so there is nothing to host: the MCP client spawns the server as a local subprocess. Source: src/agent_regress/mcp_server.py.


Why not DeepEval, Promptfoo, or Braintrust?

CapabilityAgent EvaluationDeepEvalBraintrustPromptfoo
Statistical version comparison (p-values)YesNoNoNo
Effect size reporting (Cohen's d)YesNoNoNo
Bootstrap 95% confidence intervalsYesNoNoNo
Distributional shift detectionYesNoNoNo
Tau-bench pass^k harness (k=1,4,8)YesNoNoNo
GAIA Level 1-3 split harnessYesNoNoNo
SWE-bench scaffold score harnessYesNoNoNo
Self-hostable, zero SaaS requiredYesPartialNoYes
Sample size warningsYesNoNoNo
Core licenseApache 2.0MITProprietaryMIT†
Requires cloud accountNoOptionalYesNo
Test typeDistributionalThresholdThresholdThreshold

†Promptfoo acquired by OpenAI, March 2026; remains open source under its current license.

DeepEval tests whether an individual agent response clears a quality bar. Agent Evaluation tests whether behavior changed significantly between two agent versions, a different statistical question that threshold testing cannot answer. The scipy Mann-Whitney U call at the core is one line, so any SaaS eval platform can add it. What accumulates over time through production use is version-specific regression history and a community-maintained benchmark leaderboard with independent result verification.


Real regressions statistical testing catches that threshold testing misses

LangGraph

  • #5243: a new typed context= API replaced untyped config['configurable']. A single run on either invocation style still clears a threshold check; only a version-A-vs-B comparison shows whether the switch changed measured behavior.
  • #4486: node/task-level result caching can silently mask repeated-sampling variance. Threshold checks don't care whether a result came from cache; a statistical comparison depends on genuinely independent samples, so agent-eval added cache-busting to protect that assumption.

OpenAI Agents SDK

  • #2463: agent-as-tool calls were silently dropping the parent run's RunConfig. The nested call still returns a normal-looking response, so a single-response check clears; only inspecting config propagation across runs reveals the regression.
  • #2214: image/audio/file tool outputs were silently downgraded to text-only. A text-only threshold scorer has no way to notice a dropped attachment.

CrewAI

  • #6134: a security fix for file tools leaking absolute filesystem paths in responses. A quality scorer checks whether the answer is correct, not whether it also leaks a path, so the leak clears the bar.
  • #6236: tools gained an optional Pydantic output_schema, moving from unstructured str() output to structured JSON. Both the old and new format can look "reasonable" to a threshold scorer even though the schema changed underneath.

These are the regressions that motivated this project. Full detail on all 14 individually-documented PRs (drawn from a 29-PR, 239-row validation campaign across LangGraph, CrewAI, and the OpenAI Agents SDK) is in docs/pr-analysis.md.


The problem this solves

You changed a prompt. Or switched from GPT-4o to GPT-4o-mini to cut costs. Or a dependency updated silently. Your evals still pass, because they test individual responses against fixed thresholds. They don't detect whether behavior shifted across the whole distribution.

A 3-point drop in accuracy might be noise from LLM variance. Or it might be a real regression. Without statistical testing you cannot tell which. Teams either ignore small drops and miss real problems, or escalate everything and drown in false alarms.

Agent Evaluation answers the distributional question with a p-value and effect size:

============================================================agent-regress Report -- tool_accuracy============================================================Verdict:    REGRESSEDp-value:    0.0031Cohen's d:  -0.61095% CI:     [-0.221, -0.067]
Version A:  0.8400 +/- 0.0601  (n=50)Version B:  0.7000 +/- 0.0903  (n=50)Delta:      -0.1400============================================================

When CI fails, the assertion error gives the deploy-blocking message:

AssertionError: REGRESSED: tool_accuracy dropped 16.7%(p=0.003, Cohen's d=-0.61, 95% CI [-0.22, -0.07])Version A: 0.840 +/- 0.060  (n=50)Version B: 0.700 +/- 0.090  (n=50)

When nothing changed:

Verdict:    STABLEp-value:    0.4100Cohen's d:  0.021

DeepEval, Promptfoo, and Braintrust test whether individual responses meet thresholds. None of them answer whether a version's behavior distribution shifted significantly from the last. Agent Evaluation addresses that specific statistical question, which threshold testing cannot answer.


Add to CI: fail the build on regression

Two patterns. Pick one.

report.assert_stable() — inline, after you've already called compare():

python
# test_regression.py -- add to your existing test suitefrom agent_regress import compare
def test_no_regression():    report = compare(        version_a=production_agent,        version_b=staging_agent,        test_suite=load_test_suite(),        n_runs=50,    )    report.assert_stable(        p_threshold=0.05,  # act on changes at p < 0.05        min_effect=0.2,    # Cohen's d threshold -- ignore noise below 0.2    )

RegressionGate — reusable gate object, useful when you run multiple comparisons with the same thresholds:

python
from agent_regress import compare, RegressionGate
gate = RegressionGate(p_threshold=0.05, min_effect=0.2)
def test_tool_accuracy():    report = compare(version_a=prod, version_b=staging, test_suite=suite, n_runs=50)    gate.check(report)  # raises AssertionError on regression; warns if n < 30
def test_routing_accuracy():    report = compare(version_a=prod, version_b=staging, test_suite=routing_suite, n_runs=50)    gate.check(report)

[agent-regress catching a P0 regression in CI and failing the build with a deploy-blocking AssertionError]

Both patterns: warn (not fail) when n < 30 per version, and treat n < 10 as insufficient data and skip the gate. This CI-gate threshold (30) is intentionally lower than compare()'s own general low-power warning (n < 50, see FAQ) — it exists to stop a genuinely too-small sample from silently gating a build, not to guarantee 80% statistical power the way the 50-run recommendation does.

bash
uv run pytest test_regression.py

Statistical methods

Agent Evaluation uses three statistical tests, applied in combination:

Mann-Whitney U compares two score distributions without assuming normality. LLM scores are not Gaussian. The U test is distribution-free and robust to the long tails and bimodal distributions that appear in real agent outputs.

Bootstrap confidence intervals (1,000 resamples, seed=42) give a 95% CI on the mean score delta. The CI tells you how large the shift was: a CI of [-0.22, -0.07] means you can be 95% confident the true per-run accuracy drop is between 7 and 22 percentage points.

Cohen's d (pooled standard deviation) separates statistical significance from operational significance. A shift at p=0.001 with d=0.04 is real but meaningless. A shift at p=0.06 with d=0.5 is operationally large but requires more data to confirm. The default CI gate acts only when both p < 0.05 and d >= 0.2.

See docs/statistical-methods.md for the full methodology.


Benchmarks

Statistical test overhead is the time to run the comparison itself, not the agent calls. Agent calls are the bottleneck; the statistics are not.

Measured on Apple M3 Pro, Python 3.14, scipy 1.15, numpy 2.2:

Operationn=50 per versionn=1,000 per version
Mann-Whitney U0.34ms0.47ms
Bootstrap CI (1,000 resamples)26ms31ms
Full compare() statistical overhead~27ms~32ms

See docs/benchmarks.md to reproduce.


Integration matrix

FrameworkStatusInstall
LangGraphShipped (v0.1)pip install agent-regress-cli[langgraph]
OpenAI Agents SDKShipped (v0.1)pip install agent-regress-cli[openai-agents]
CrewAIShipped (v0.1)pip install agent-regress-cli[crewai]
LangChain LCELShipped (v0.1)pip install agent-regress-cli[langchain]
AutoGenPlanned (v0.3)
Vercel AI SDK (TypeScript)Planned (v0.4)

Comparing two installed versions of the same framework (rather than two in-process configurations)? See docs/cross-version-comparison.md for the subprocess_runner() pattern.

[!WARNING] The [crewai] extra: CrewAI's own memory/knowledge/RAG backend can pull in ChromaDB, which currently has an unpatched critical CVE (GHSA-f4j7-r4q5-qw2c) affecting any ChromaDB server run with trust_remote_code=True and exposed to the network. agent-eval never starts, configures, or exposes a ChromaDB server itself, so this only matters if your own Crew does — don't run a network-exposed ChromaDB instance with trust_remote_code=True until a fix ships.


Standard benchmarks

Agent Evaluation ships harnesses for the three standard agent benchmarks:

Tau-bench pass^k measures reliability across k independent attempts. Single-run benchmarks miss degradation: an agent that succeeds 60% of the time at k=1 reaches 99.93% at k=8. The k=1 vs k=8 curve is the signal.

python
from agent_regress.benchmarks.tau_bench import TauBenchHarness
harness = TauBenchHarness(agent=my_agent, dataset=tau_bench_dataset)results = harness.evaluate(k_values=[1, 4, 8])

GAIA Level 1-3 split stratifies by task difficulty. Overall accuracy hides per-difficulty regressions: a prompt change that helps Level 1 often hurts Level 3.

python
from agent_regress.benchmarks.gaia import GAIAHarness
harness = GAIAHarness(agent=my_agent, dataset=gaia_dataset)results = harness.evaluate()  # returns list[GAIALevelResult], one per levelfor r in results:    print(f"Level {r.level}: {r.accuracy:.3f}  ({r.n_correct}/{r.n_questions})")

SWE-bench scaffold score isolates framework contribution from model contribution.

python
from agent_regress.benchmarks.swebench import SWEBenchHarness
harness = SWEBenchHarness(agent=my_agent, dataset=swe_dataset)result = harness.evaluate()print(f"scaffold pass rate: {result.scaffold_pass_rate:.3f}  ({result.n_resolved}/{result.n_instances})")

See leaderboard/README.md to submit results.


Try it in Docker

bash
git clone https://github.com/RudrenduPaul/agent-evalcd agent-evaldocker compose up

Starts two services:

  • web (http://localhost:8080) — leaderboard UI served by web/serve.py, reading leaderboard/results/*.json
  • example — runs examples/01-basic-comparison/example.py and prints the comparison report to stdout

Good for verifying the install works and seeing the leaderboard UI before wiring agent-regress into your own agent.


Security

  • Supply chain: Releases are built and published from a GitHub Actions workflow, signed with Sigstore, and ship with a CycloneDX SBOM attached to every GitHub Release. (No SLSA provenance attestation is generated yet — that would require adopting slsa-framework/slsa-github-generator.)
  • Vulnerability scanning: Trivy scans on every CI run (HIGH/CRITICAL only, exit on unfixed). CodeQL static analysis on every push.
  • Dependency pinning: Dependabot keeps all GitHub Actions and Python dependencies current.
  • Disclosure: SECURITY.md — report vulnerabilities privately via GitHub Security Advisories.

Leaderboard

The leaderboard/ directory version-controls Tau-bench pass^k, GAIA, and SWE-bench results across models and frameworks. Submit by opening a PR with a JSON file matching leaderboard/schema.json. Results are independently reproduced before merging.

See leaderboard/README.md.


FAQ

What is agent-eval, and what makes it different from a normal LLM eval framework?

Agent Evaluation is a statistics library for detecting whether an agent's behavior actually changed between two versions. Run the same test suite 50 times on version A and 50 times on version B, and it reports a p-value (Mann-Whitney U), an effect size (Cohen's d), and a bootstrap 95% confidence interval on the score delta. Most eval frameworks check whether a single response clears a fixed quality threshold. Agent Evaluation instead answers a distributional question: did the score distribution shift significantly, or is a change just LLM-run-to-run noise.

How do I install it, and which platforms does it support?

pip install agent-regress-cli or uv add agent-regress-cli. It requires Python 3.10 through 3.13 (per the classifiers in pyproject.toml) and has no OS-specific code, so it runs anywhere those Python versions run. A Node/npx wrapper (npx agent-regress-cli, also published as agent-regress-cli on npm) is also available -- it shells out to this same Python package, so a Python toolchain (or uv/pipx, which can run it ephemerally without a manual pip install step) still needs to be available; it prints an actionable error if neither is found.

How does it compare to DeepEval, Promptfoo, or Braintrust?

The full breakdown is in the comparison table above. In short: DeepEval, Promptfoo, and Braintrust all test whether an individual response clears a fixed quality bar. None of the three report a p-value, an effect size, or a bootstrap confidence interval on whether behavior shifted between two versions, which is the specific statistical question agent-eval is built to answer.

I ran a comparison and got a warning about insufficient statistical power, or a verdict of INSUFFICIENT_DATA. What does that mean?

The library warns (but does not fail) when either version has fewer than 50 runs, since that is the sample size needed for reliable detection of a moderate effect (Cohen's d of 0.2) at 80% power. Below 10 runs per version, it returns INSUFFICIENT_DATA instead of a REGRESSED/STABLE/IMPROVED verdict, since the sample is too small to trust any statistical conclusion. Re-run with n_runs=50 or higher for a verdict you can act on.

Does agent-eval call my LLM or manage API keys for me?

No. compare() takes two callables you provide, version_a and version_b, and runs your existing agent code against your test suite. Agent Evaluation never makes a model call itself, and the stats module (src/agent_regress/stats/) is required to stay pure Python and scipy with no LLM calls, so the statistical core has no network dependency and nothing to configure credentials for.

Which agent frameworks does it integrate with today?

LangGraph, the OpenAI Agents SDK, CrewAI, and LangChain LCEL are shipped as of v0.1 (see the integration matrix above), each installable as an extra, e.g. pip install agent-regress-cli[langgraph]. AutoGen and a Vercel AI SDK (TypeScript) integration are planned but not yet shipped.

Can I use agent-eval commercially, and what license is it under?

Yes. It is licensed under Apache License 2.0, which permits commercial use, modification, and distribution, and includes an explicit patent grant. You need to preserve the copyright and license notices and state any changes you make; there is no warranty. See LICENSE for the full text.


Contributing

  • Read CONTRIBUTING.md before opening a PR
  • Good first issues are labeled in GitHub
  • Stats module (src/agent_regress/stats/) must stay pure Python + scipy — no LLM calls, ever
  • All PRs require 95% coverage on stats/, 80% overall

GitHub Discussions for design questions.

Apache 2.0. Contributions welcome.


Cite this work

If you use Agent Evaluation in research, please cite:

bibtex
@software{paul2026agenteval,  author = {Paul, Rudrendu and Nandy, Sourav},  title = {Agent Evaluation: Statistical Regression Testing for LLM Agents},  year = {2026},  url = {https://github.com/RudrenduPaul/agent-eval},  license = {Apache-2.0}}

Built by Rudrendu Paul and Sourav Nandy

來源:README.md,提交 4daba32

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.8最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分