Skip to main content

AgentVerity

Your agent test passed. Would it pass again?

PyPI Python 3.10+ CI Coverage: 90%+ License: Apache-2.0

An agent can pass a test and choose a different route on its next run. That makes one passing output a noisy regression reference for later releases. AgentVerity is a local Python library and CLI that checks whether repeated agent decisions are repeatable enough to save as a baseline. It also flags missing routes and evidence too small to support a conclusion.

The 60-second problem

A payment router sends disputes to six queues. Promptfoo repeats six reviewed cases 26 times: 156/156 assertions pass. One case accepts either of two valid fraud queues. AgentVerity reads the same export and finds:

route              cases  pairs  flips  95% CI            result
card_security          1     13      8  [0.355, 0.823]    stochastic
cash_withdrawal        1     13      0  [0.000, 0.228]    undecided
duplicate_charge       1     13      0  [0.000, 0.228]    undecided

flip pairs:
  card_security <-> merchant_dispute  x8

Every answer is allowed, but the changing queue would make a regression check noisy. The five quiet routes need more evidence to qualify separately. A flip is a pairwise disagreement: two reruns of the same case returned different decisions. This evidence is refused as a regression reference. Observations form non-overlapping pairs in collection order.

Try it without model calls

git clone --depth 1 https://github.com/mrwersa/agentverity.git
cd agentverity
python -m venv .venv
. .venv/bin/activate
python -m pip install .
agentverity assess \
  --promptfoo examples/promptfoo_bridge/results.json \
  --suite examples/payment_decisions.json

This reads recorded decisions and makes no model or provider calls. Assessment exit 0 means the report completed, not that a baseline was admitted. See imported evidence for Promptfoo, precomputed DeepEval cases, JSONL, and ordering requirements.

Plain Python callables need no extra dependency:

from agentverity import from_callable, run


def route(text):
    return "billing" if "charge" in text.lower() else "cash_withdrawal"


agent = from_callable(lambda text: {"verdict": route(text)})
result = run(agent, inputs=["duplicate charge", "cash withdrawal"])
print(result.summary())

For stateful agents, use a fresh instance or session for each trial. The integration guide covers Strands, LangGraph, remote agents, and isolation declarations. Optional extras are agentverity[strands] and agentverity[langgraph]. The callable example reports unknown isolation because the adapter does not verify how the function manages state.

Two gates, not one

A regression reference needs two separate yeses: AgentVerity qualifies repeatability, while a human or quality evaluator checks whether the expected behaviour is acceptable. A person then approves saving the reference.

The repeatability meter has three public machine outcomes:

  • deterministic: repeatability qualified at the declared tolerance
  • stochastic: repeatability rejected at that tolerance
  • undecided: inconclusive, supporting neither direction

deterministic does not mean zero randomness. Missing coverage, failed calls, and isolation caveats also matter to admission. A pooled qualification does not certify every route separately.

The offline coverage example shows another reason to refuse a baseline:

python examples/payment_dispute_gate.py
Probe set Exact-match Verdict repeatability Declared coverage Reference
Narrow, 6 duplicate-charge cases ✅ 6/6 ✅ verdict-deterministic ❌ 1/6 required routes ❌ REFUSED
Repaired, 6 dispute categories ✅ 6/6 ✅ verdict-deterministic ✅ 6/6 required routes ✅ ADMITTED

Both sets score 6/6, and both pooled meters qualify. Missing coverage blocks the narrow reference. The repaired reference is admitted at pooled level; its individual route intervals remain inconclusive.

Where it fits

Layer Question
Quality evaluator or reviewed assertions Was the answer acceptable?
AgentVerity Is the repeated decision evidence strong enough to save as a regression reference?
Tracing and monitoring What happened during the run and in production?

Use it for named routes, approvals, tool choices, handoffs, or a reviewed finite tool path. Use another evaluator for open-ended chat, RAG quality, or generated content. Choose the decision layer before collecting evidence: a tool-name check cannot detect changed arguments.

Command Purpose
agentverity plan Budget evidence before calling an agent
agentverity run Collect and assess repeated decisions
agentverity assess Assess recorded evidence without new target calls
agentverity snapshot Collect live evidence and admit an approved regression reference when evidence permits
agentverity inspect Read the stored reference without calling anything
agentverity check Recheck admission and compare current decisions with the reference
agentverity compare-evidence Compare repeatability structure and provenance across evidence windows

compare-evidence can report NO CHANGE even when stable output labels differ. Use check when the reviewed decisions themselves must match. To save imported evidence, Python callers use create_snapshot(result, approved=True); CLI snapshot collects a new live run.

Stop when more runs cannot help

Repeat-run variation is often called flakiness. With no flips, a fixed 95% Wilson interval needs 73 independent pairs to qualify below a 5% tolerance. This is a best-case minimum, not a guarantee of qualification.

plan prices that evidence. Live --curtail stops when qualification becomes impossible within the fixed budget and never admits early. assess --replay-curtailment is post-hoc and counterfactual: it never changes the observed endpoint classification. See the method guide and workshop calculations for planning, stopping rules, and evidence.

Qualification concerns the supplied cases in one evaluation period. It does not prove correctness, safety, independent provider calls, or reliability across deployments and time. Never repeat live customer requests. Use reviewed synthetic cases with equivalent starting state.

Documentation and community

Development

pip install -e ".[dev]"
python -m pytest -q
ruff check .

Core runtime dependencies: none. CI covers Python 3.10–3.14 and at least 90% statement coverage.

Alpha. Pin agentverity~=0.25.0 for compatible patch updates. Apache-2.0.

Metadata

Release files for agentverity 0.25.4

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

Source distribution (sdist)

Source distribution for agentverity 0.25.4
File Size Uploaded
agentverity-0.25.4.tar.gz 1.4 MB Details

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / agentverity-0.25.4.tar.gz

Download URL agentverity-0.25.4.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
6f7cd11cf6ae4b610e0bf9c3d5e2dab66186793f935b518ad94e1fd3c37eadc5
BLAKE2b-256 checksum
How to use checksums
244f654a0de427eb5fd478e371e3de5771774f7b169f49fd1f9c0dc498974f55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release files / agentverity-0.25.4-py3-none-any.whl

Download URL agentverity-0.25.4-py3-none-any.whl
Size 120.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6336f1610a5ad2d91c8c750c48a50108148f605429b0a803e24eae05940565eb
BLAKE2b-256 checksum
How to use checksums
79f43e46c1945d9052b1c9885003401d2b2d33898a2ca65c5e98447a60bf3976
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

0.25.5

2 release files

This release

0.25.4 This release

2 release files

0.25.3

2 release files

0.25.2

2 release files

0.25.1

2 release files

0.25.0

2 release files

0.24.1

2 release files

0.24.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.14.0

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

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