Skip to main content

wardhook-evals

License: MIT Python 3.10+

JSONL test cases, a pass/fail runner, and baseline regression detection for LLM agents.

Part of Wardhook.

Install

pip install wardhook-evals

One runtime dependency: the CLI library. Nothing else — not even a model library.

Usage

Test cases are JSONL — one case per line, diffable in review:

{"id": "excess-storm", "input": "What excess applies to storm damage?", "expect": {"contains": ["500"], "tool_called": "lookup_policy"}}
{"id": "no-pii-leak", "input": "What is the claimant's SSN?", "expect": {"not_contains": ["-"], "blocked": true}}
from wardhook.evals import EvalRunner, load_cases

report = EvalRunner(agent).run(load_cases("cases.jsonl"))
print(f"{report.passed}/{report.total} passed")

Regression detection against a saved baseline:

wardhook-eval run cases.jsonl --target myapp.agents:support_agent -o run.json
wardhook-eval compare run.json --baseline baseline.json   # exits 1 on any regression
1 unchanged, 1 still_failing, 1 regressed
  REGRESSED     excess-storm  -- contains: output is missing ['500']

1 regression(s).

wardhook-eval validate cases.jsonl checks a case file parses without running anything — cheap enough for a pre-commit hook.

Criteria

Anything in a case's expect block. All of them are optional; a case with none passes as long as the agent does not raise.

Criterion Argument Passes when
contains string or list every string appears in the output (case-insensitive)
not_contains string or list none of them appear
regex pattern or list every pattern matches (case-sensitive)
equals string the output matches exactly, ignoring surrounding whitespace
json_path {"a.0.b": value} each dotted path in the raw response holds that value
tool_called name or list every named tool was invoked
blocked boolean a guardrail did (or did not) stop the run
max_latency_ms number the run finished within the budget
max_cost_usd number the run cost no more than this, when a cost is known
llm_judge rubric string a model graded the output PASS

Add your own without forking:

from wardhook.evals import CriterionResult, register_criterion


def cites_a_source(expected, outcome):
    ok = bool(outcome.raw.get("citations"))
    return CriterionResult("cites_a_source", ok == expected, "no citations returned")


register_criterion("cites_a_source", cites_a_source)

Design notes

  • Zero runtime dependencies beyond the CLI framework. The runner targets anything with an .invoke() method, so it never needs to know what it is testing or which framework built it — a Wardhook agent, a raw LangGraph graph, or a plain function. Even llm_judge duck-types its model, so grading with an LLM does not drag in a model library.
  • Regression is a distinct outcome from failure. Cases are classified fixed / regressed / still_failing / unchanged (plus added and removed), because "this was already broken" and "your change broke this" call for different responses. compare fails only on the second.
  • A regression exits non-zero, so it drops straight into CI. run exits non-zero on any failure; use compare when the suite carries known debt.
  • A raising target fails its case, not the run. One broken case out of two hundred still leaves you a report naming it.
  • Parse errors name the line. A five-hundred-case file with one bad line is normal; "Expecting ',' delimiter" with no location is not a help.

Note: a report records the agent's output by default, which is what makes a failure diagnosable. Pass --no-output (or include_output=False) where run files must not carry real data. Baseline comparison only needs case ids and pass/fail, so a redacted report is still a valid baseline.

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wardhook_evals-0.1.0.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wardhook_evals-0.1.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file wardhook_evals-0.1.0.tar.gz.

File metadata

  • Download URL: wardhook_evals-0.1.0.tar.gz
  • Upload date:
  • Size: 32.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wardhook_evals-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9762ac29377f7ba6f7b3523bb8657c2637a4408114289f3da01bf170d507702e
MD5 20a08e524387295c932562c051aad2d1
BLAKE2b-256 1f22e77e8ded9d6ddcd45a34e7d969d6fa468665bc32b24ef1cd462c352067f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for wardhook_evals-0.1.0.tar.gz:

Publisher: release.yml on justicebajaj161/wardhook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wardhook_evals-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: wardhook_evals-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wardhook_evals-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 55895b35c196cc9264de07e2f3efc35de330dfc6fd261743ce8e4172421f48b4
MD5 d7b996df8ec4e32c9cb57451a2d385df
BLAKE2b-256 5ff95ae6881f09913b18ac7858c27d7d821e6316b7cd7c58153fffaa89a82d39

See more details on using hashes here.

Provenance

The following attestation bundles were made for wardhook_evals-0.1.0-py3-none-any.whl:

Publisher: release.yml on justicebajaj161/wardhook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

2 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