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.1.tar.gz (34.9 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.1-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wardhook_evals-0.1.1.tar.gz
  • Upload date:
  • Size: 34.9 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.1.tar.gz
Algorithm Hash digest
SHA256 1df8e5dec5eb9555deb5ca2b66fedc2ed19cd78d49dfee3ba8c4e5130b0166e7
MD5 2f593f5cc69cf5d130408a28bc918e94
BLAKE2b-256 5fd5f4339673a0b6d650ef89361ed06413b7989b92f748cd357156eda54d7f89

See more details on using hashes here.

Provenance

The following attestation bundles were made for wardhook_evals-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: wardhook_evals-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 749d5be467007d9ef505562b1e9d472b641386f9ce7c2fe585b98101971b3ab5
MD5 f16deb12f9232cb769ce8a22bfed0fdd
BLAKE2b-256 6f907dbad4202df5e939761c8735e488c13ff3cb2e1f0b06a58b0c8f4d9b2fa5

See more details on using hashes here.

Provenance

The following attestation bundles were made for wardhook_evals-0.1.1-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

This release

0.1.1 This release

2 files

0.1.0

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