name: agent-eval-harness
description: Builds a small, honest evaluation harness for an agent or prompt: a labelled task set, deterministic graders where possible, a calibrated model judge where not, and a regression report with cost and latency. Use when changing a prompt or model and needing to know whether it got better, or when an agent works in demos but fails in production.
license: MIT
metadata:
author: community-list
version: "1.0.0"
created: "2026-11-22"
Agent Eval Harness
Small, specific, and re-runnable beats large and unmaintained. The goal is a number you can
trust enough to block a merge.
When to use
- Changing a prompt, model, tool schema, or retrieval strategy.
- Deciding between two models.
- An agent performs well in demos and badly on real inputs.
- Adding a regression gate to CI.
Workflow
1. Define the decision the eval supports
Write one sentence: "This eval decides whether change X ships." If no decision depends on the
result, do not build the eval.
2. Collect tasks from reality
Sources, in order of value:
- Real failed production inputs (highest value).
- Real successful inputs, sampled across the distribution.
- Inputs written by someone other than the prompt author.
- Synthetic edge cases (lowest value; use to cover known gaps).
Target 30–100 tasks for a first harness. Cover: typical, edge, adversarial, and "should
refuse" cases. Record provenance for each task.
3. Define success per task
Every task needs an expected outcome that a third party could check:
| Task type |
Grading method |
| Structured output (JSON, SQL, code) |
Exact match, schema validation, or executable test |
| Extraction |
Field-level precision/recall against gold labels |
| Classification |
Label match; report per-class confusion |
| Free text |
Rubric with 3–5 binary criteria, scored by a judge |
| Agent trajectory |
Required tool calls present, forbidden calls absent, final state correct |
Prefer executable checks. A grader that runs the produced code or validates the produced
schema is worth ten rubric judgements.
4. Build the judge carefully (only where needed)
If a model judge is unavoidable:
- Give it the rubric as binary questions, not a 1–10 scale.
- Include 2–3 worked examples of pass and fail.
- Hide which system produced the output; randomise order.
- Calibrate against 20 human-labelled outputs; report agreement. Below ~80% agreement,
the judge is not usable as a gate.
- Record the judge model and version — it is part of the measurement instrument.
5. Run and report
For each run, record:
- pass rate overall and per task category;
- cost per task and total;
- p50/p95 latency;
- for every failure, the task ID, input, expected, actual, and grader reasoning.
Never report a single aggregate number without the per-category breakdown; averages hide
regressions in a small but important category.
6. Make it a gate
- Store the baseline results as a file in the repo.
- Fail CI when pass rate drops by more than the noise floor (measure it by running the same
system twice).
- Allow explicit, reviewed baseline updates — never auto-accept a new baseline.
7. Guard against overfitting
- Keep a held-out set the prompt author has not seen.
- Rotate in new real failures each cycle.
- If pass rate is near 100%, the set is too easy: add harder real cases.
Rules
- Every task has a provenance note and an owner.
- No task may be scored by string similarity alone unless the output is genuinely free-form.
- Do not tune on the held-out set; if you look at it, it is no longer held out.
- Report cost and latency with quality. A 2% quality gain for 10× cost is a decision, not a win.
- Do not claim improvement without a baseline measured on the same task set.
Output format
evals/
├── tasks.jsonl # id, input, expected, category, provenance
├── graders/ # executable graders where possible
├── run.mjs # runner: system under test, model, concurrency, retries
├── baselines/<date>.json
└── REPORT.md # pass rate, per-category, cost, latency, failure appendix
Error handling
| Condition |
Action |
| Fewer than 20 real tasks available |
Report that the eval is directional only; do not gate on it |
| Judge agreement below 80% |
Replace with executable checks or human labelling |
| Non-deterministic outputs |
Run each task 3× and report pass@1 and pass@3 |
| Provider rate limits |
Cache responses keyed by task+system version; report cache hit rate |
Example
Input: support-triage agent, prompt rewrite proposed.
Output: 64 tasks from 5 weeks of tickets, 41 executable label checks, 23 rubric checks
with 86% human agreement, baseline pass 0.71 → 0.79, cost +12%, p95 latency +300ms, and
three tasks that regressed (listed with inputs).
1---2name: agent-eval-harness3description: "Builds a small, honest evaluation harness for an agent or prompt: a labelled task set, deterministic graders where possible, a calibrated model judge where not,"4---5---6name: agent-eval-harness7description: Builds a small, honest evaluation harness for an agent or prompt: a labelled task set, deterministic graders where possible, a calibrated model judge where not, and a regression report with cost and latency. Use when changing a prompt or model and needing to know whether it got better, or when an agent works in demos but fails in production.8license: MIT9metadata:10 author: community-list11 version: "1.0.0"12 created: "2026-11-22"13---1415# Agent Eval Harness1617Small, specific, and re-runnable beats large and unmaintained. The goal is a number you can18trust enough to block a merge.1920## When to use2122- Changing a prompt, model, tool schema, or retrieval strategy.23- Deciding between two models.24- An agent performs well in demos and badly on real inputs.25- Adding a regression gate to CI.2627## Workflow2829### 1. Define the decision the eval supports3031Write one sentence: "This eval decides whether change X ships." If no decision depends on the32result, do not build the eval.3334### 2. Collect tasks from reality3536Sources, in order of value:37381. Real failed production inputs (highest value).392. Real successful inputs, sampled across the distribution.403. Inputs written by someone other than the prompt author.414. Synthetic edge cases (lowest value; use to cover known gaps).4243Target 30–100 tasks for a first harness. Cover: typical, edge, adversarial, and "should44refuse" cases. Record provenance for each task.4546### 3. Define success per task4748Every task needs an expected outcome that a third party could check:4950| Task type | Grading method |51|-----------|----------------|52| Structured output (JSON, SQL, code) | Exact match, schema validation, or executable test |53| Extraction | Field-level precision/recall against gold labels |54| Classification | Label match; report per-class confusion |55| Free text | Rubric with 3–5 binary criteria, scored by a judge |56| Agent trajectory | Required tool calls present, forbidden calls absent, final state correct |5758Prefer executable checks. A grader that runs the produced code or validates the produced59schema is worth ten rubric judgements.6061### 4. Build the judge carefully (only where needed)6263If a model judge is unavoidable:6465- Give it the rubric as binary questions, not a 1–10 scale.66- Include 2–3 worked examples of pass and fail.67- Hide which system produced the output; randomise order.68- Calibrate against 20 human-labelled outputs; report agreement. Below ~80% agreement,69 the judge is not usable as a gate.70- Record the judge model and version — it is part of the measurement instrument.7172### 5. Run and report7374For each run, record:7576- pass rate overall and per task category;77- cost per task and total;78- p50/p95 latency;79- for every failure, the task ID, input, expected, actual, and grader reasoning.8081Never report a single aggregate number without the per-category breakdown; averages hide82regressions in a small but important category.8384### 6. Make it a gate8586- Store the baseline results as a file in the repo.87- Fail CI when pass rate drops by more than the noise floor (measure it by running the same88 system twice).89- Allow explicit, reviewed baseline updates — never auto-accept a new baseline.9091### 7. Guard against overfitting9293- Keep a held-out set the prompt author has not seen.94- Rotate in new real failures each cycle.95- If pass rate is near 100%, the set is too easy: add harder real cases.9697## Rules9899- Every task has a provenance note and an owner.100- No task may be scored by string similarity alone unless the output is genuinely free-form.101- Do not tune on the held-out set; if you look at it, it is no longer held out.102- Report cost and latency with quality. A 2% quality gain for 10× cost is a decision, not a win.103- Do not claim improvement without a baseline measured on the same task set.104105## Output format106107```108evals/109├── tasks.jsonl # id, input, expected, category, provenance110├── graders/ # executable graders where possible111├── run.mjs # runner: system under test, model, concurrency, retries112├── baselines/<date>.json113└── REPORT.md # pass rate, per-category, cost, latency, failure appendix114```115116## Error handling117118| Condition | Action |119|-----------|--------|120| Fewer than 20 real tasks available | Report that the eval is directional only; do not gate on it |121| Judge agreement below 80% | Replace with executable checks or human labelling |122| Non-deterministic outputs | Run each task 3× and report pass@1 and pass@3 |123| Provider rate limits | Cache responses keyed by task+system version; report cache hit rate |124125## Example126127**Input:** support-triage agent, prompt rewrite proposed.128**Output:** 64 tasks from 5 weeks of tickets, 41 executable label checks, 23 rubric checks129with 86% human agreement, baseline pass 0.71 → 0.79, cost +12%, p95 latency +300ms, and130three tasks that regressed (listed with inputs).