Agent Evaluation Harness
An agent without an eval harness is a demo, not a system.
You cannot ship, refactor, or compare agents responsibly without one. Every prompt tweak that "feels better" is a coin flip until you have a number to back it.
When to use this skill
- The user is about to merge a prompt or graph change.
- The user is choosing between two models, two patterns, or two providers.
- The user is debugging a regression and has no way to reproduce it.
- The user is asking "is this good enough to ship?"
- The user mentions LLM-as-judge, golden set, eval suite, or regression test.
What an eval harness actually is
Three pieces. If any is missing, you don't have one.
- A frozen input set. ≥20 representative tasks, labelled with the expected outcome shape (not necessarily exact text). Curated, not sampled — covers the long tail, not the average.
- A scoring function. Deterministic where possible (exact match, schema validation, tool-call correctness). LLM-as-judge only for free-form outputs, and only with a rubric and anchors.
- A regression gate. The score is compared against the last known-good run. A drop fails CI or blocks merge.
Decision flow
- Does the task have a checkable answer? → deterministic scorer (regex, JSON-schema, tool-call match). Cheapest and most reliable.
- Is the output a structured artefact (code, SQL, JSON)? → run the artefact. Did it execute? Did it produce the expected effect?
- Is the output free-form (summary, reply, plan)? → rubric-based LLM-as-judge with explicit criteria and 3–5 anchored examples per score level. Never freeform "rate 1–10".
- Is the task multi-step (agent loop)? → score the trace, not just the final answer. Did it call the right tools, in the right order, within budget?
Anti-patterns to flag immediately
- Vibe checks. "It looks better." This is not signal.
- LLM-as-judge without anchors. A judge that has never seen what a "5" looks like is a random number generator.
- Single-example tweaking. Iterating against one failing input always overfits. Add it to the set, run the whole set.
- Eval set that grows with every change. That's a training set, not a held-out one. Freeze one, grow another.
- Scoring only the final answer for agent loops. A right answer via the wrong trace is a future regression.
- Re-rolling the judge until it agrees. If you sample N times and pick the best, you're not evaluating, you're cherry-picking.
What to log per eval run
- Inputs (verbatim) and ground-truth labels.
- Full trace: every model call, every tool call, every retry.
- Scores per criterion, not just the aggregate.
- Wall-clock latency and total token cost — quality is not the only axis.
- Model version, prompt version, graph version. Pin everything.
Questions to ask the user
- What does success look like for one task — concretely, in one sentence?
- What does the failure distribution look like — wrong answer, no answer, unsafe answer, slow answer?
- How many representative inputs can the user provide today (not aspirationally)?
- Who decides what "correct" means when humans disagree?
- Where will the eval run — locally, in CI, on a schedule?
- What's the budget per eval run? Token cost decides cadence.
If the answer to any of these is "I don't know," that's the first task — not the harness.
The hard line
No golden set, no merge. No exceptions for "small" prompt changes — small changes are exactly where regressions hide.
Why this exists
Most agent failures in production trace back to a prompt change that nobody could quantify at the time. Teams ship on intuition, regress silently, and discover it when a user complains. The harness flips the loop: change something, see a number, decide. See [link to article on agent evaluation].
References
references/scoring.md — deterministic vs rubric vs LLM-as-judge, with examples.
references/golden-sets.md — how to curate and grow an input set without overfitting.
references/ci.md — wiring the harness into CI and PR gates.
Related skills
- Traces are the eval substrate — [[agent-observability]].
- Pattern changes invalidate the eval — [[agent-architecture-patterns]].
- Tool schema regressions surface here first — [[tool-use-schema-design]].
- Adversarial set lives next to the golden set — [[guardrails-and-safety]].
- Eval catches cost regressions, not just quality — [[agent-cost-modeling]].
1---2name: agent-evaluation-harness3description: Design an evaluation harness for an LLM agent before shipping it. Use when the user is building or rewriting an agent, deciding ship/no-ship, debugging regressions, or mentions golden sets, eval suites, regression tests, trace-level evals, LLM-as-judge, scoring rubrics, or asks "how do I test this agent?" / "how do I know if my agent got better?".4---56# Agent Evaluation Harness78An agent without an eval harness is a demo, not a system.910You cannot ship, refactor, or compare agents responsibly without one. Every prompt tweak that "feels better" is a coin flip until you have a number to back it.1112## When to use this skill1314- The user is about to merge a prompt or graph change.15- The user is choosing between two models, two patterns, or two providers.16- The user is debugging a regression and has no way to reproduce it.17- The user is asking "is this good enough to ship?"18- The user mentions LLM-as-judge, golden set, eval suite, or regression test.1920## What an eval harness actually is2122Three pieces. If any is missing, you don't have one.23241. **A frozen input set.** ≥20 representative tasks, labelled with the expected outcome shape (not necessarily exact text). Curated, not sampled — covers the long tail, not the average.252. **A scoring function.** Deterministic where possible (exact match, schema validation, tool-call correctness). LLM-as-judge only for free-form outputs, and *only* with a rubric and anchors.263. **A regression gate.** The score is compared against the last known-good run. A drop fails CI or blocks merge.2728## Decision flow29301. **Does the task have a checkable answer?** → deterministic scorer (regex, JSON-schema, tool-call match). Cheapest and most reliable.312. **Is the output a structured artefact (code, SQL, JSON)?** → run the artefact. Did it execute? Did it produce the expected effect?323. **Is the output free-form (summary, reply, plan)?** → rubric-based LLM-as-judge with explicit criteria *and* 3–5 anchored examples per score level. Never freeform "rate 1–10".334. **Is the task multi-step (agent loop)?** → score the trace, not just the final answer. Did it call the right tools, in the right order, within budget?3435## Anti-patterns to flag immediately3637- **Vibe checks.** "It looks better." This is not signal.38- **LLM-as-judge without anchors.** A judge that has never seen what a "5" looks like is a random number generator.39- **Single-example tweaking.** Iterating against one failing input always overfits. Add it to the set, run the whole set.40- **Eval set that grows with every change.** That's a training set, not a held-out one. Freeze one, grow another.41- **Scoring only the final answer for agent loops.** A right answer via the wrong trace is a future regression.42- **Re-rolling the judge until it agrees.** If you sample N times and pick the best, you're not evaluating, you're cherry-picking.4344## What to log per eval run4546- Inputs (verbatim) and ground-truth labels.47- Full trace: every model call, every tool call, every retry.48- Scores per criterion, not just the aggregate.49- Wall-clock latency and total token cost — quality is not the only axis.50- Model version, prompt version, graph version. Pin everything.5152## Questions to ask the user53541. What does **success** look like for one task — concretely, in one sentence?552. What does the **failure** distribution look like — wrong answer, no answer, unsafe answer, slow answer?563. How many representative inputs can the user **provide today** (not aspirationally)?574. Who decides what "correct" means when humans disagree?585. Where will the eval **run** — locally, in CI, on a schedule?596. What's the **budget** per eval run? Token cost decides cadence.6061If the answer to any of these is "I don't know," that's the first task — not the harness.6263## The hard line6465**No golden set, no merge.** No exceptions for "small" prompt changes — small changes are exactly where regressions hide.6667## Why this exists6869Most agent failures in production trace back to a prompt change that nobody could quantify at the time. Teams ship on intuition, regress silently, and discover it when a user complains. The harness flips the loop: change something, see a number, decide. See [link to article on agent evaluation].7071## References7273- `references/scoring.md` — deterministic vs rubric vs LLM-as-judge, with examples.74- `references/golden-sets.md` — how to curate and grow an input set without overfitting.75- `references/ci.md` — wiring the harness into CI and PR gates.7677## Related skills7879- Traces are the eval substrate — [[agent-observability]].80- Pattern changes invalidate the eval — [[agent-architecture-patterns]].81- Tool schema regressions surface here first — [[tool-use-schema-design]].82- Adversarial set lives next to the golden set — [[guardrails-and-safety]].83- Eval catches cost regressions, not just quality — [[agent-cost-modeling]].