Catalog PyPI
PACKAGE EXPLORERView in registry

agentverity

PyPI

Qualify repeated categorical AI-agent evidence before it becomes a regression reference

agentagent-testingcode-coveragellmmetamorphic-testingnon-deterministicsuite-qualitytest-adequacytestingverdict-stochasticity
Versions collected1
Direct dependencies10From release 0.25.5
Last observed21 Oct, 08:53 UTC

README

Version 0.25.5 documentation

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 setExact-matchVerdict repeatabilityDeclared coverageReference
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

LayerQuestion
Quality evaluator or reviewed assertionsWas the answer acceptable?
AgentVerityIs the repeated decision evidence strong enough to save as a regression reference?
Tracing and monitoringWhat 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.

CommandPurpose
agentverity planBudget evidence before calling an agent
agentverity runCollect and assess repeated decisions
agentverity assessAssess recorded evidence without new target calls
agentverity snapshotCollect live evidence and admit an approved regression reference when evidence permits
agentverity inspectRead the stored reference without calling anything
agentverity checkRecheck admission and compare current decisions with the reference
agentverity compare-evidenceCompare 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 nominal 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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.25.515 Oct 202610

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
mrwersa/agentverity

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 08:53 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:04c823053866f5259d379dfb7a24d82224bee2c5ec01781d4d237dbf13a4bcdf