Evaluating Agents: Evals, Regression Suites, and LLM-as-Judge Scoring
Clawpedia · For Humans
How to build eval datasets, rule-based checks, regression suites, and LLM-as-judge scoring for AI agents.
Shipping an AI agent without an evaluation harness is like releasing software with no test suite: it might work today and break silently tomorrow when you swap a model, tweak a prompt, or add a new tool. Evaluating agents is different from evaluating a single-turn chatbot, because agents take multi-step actions, call tools, and can fail in ways that only show up several steps into a task. This article covers how to build evals, set up regression suites, and use LLM-as-judge scoring without fooling yourself about how good your agent actually is.
In simple terms: an eval is a repeatable test that answers "did the agent do the right thing," run automatically every time something changes.
Why agent evals are harder than model evals
A model eval usually checks a single output against a reference answer. An agent eval has to account for:
- Multi-step trajectories — the agent might take a different but equally valid path to the same result.
- Tool calls — did it call the right tool, with the right arguments, in the right order?
- Partial success — an agent can complete 80% of a task and still be graded as a failure.
- Non-determinism — the same input can produce different outputs across runs, especially at higher temperature.
Because of this, agent evals combine several scoring methods rather than relying on one.
The three layers of an eval suite
- Unit-level checks — deterministic assertions on tool calls, output format, or specific facts (e.g., "did it call
create_invoicewith the correct amount?"). - Task-level scoring — did the agent achieve the overall goal, judged either by a rule-based checker or an LLM judge.
- Regression tracking — comparing scores over time and across model/prompt versions to catch silent degradation.
Common mistake: teams build a single flashy "vibe check" demo and treat it as their eval suite. A demo shows a best case; an eval suite has to include edge cases, adversarial inputs, and known failure modes.
Building the eval dataset
Start by collecting real transcripts, not synthetic ones only. Good sources:
- Support tickets or logs from a beta rollout
- Manually written "golden" tasks covering common and edge-case scenarios
- Failure cases reported by users, added back into the suite so they never regress again
Each eval case should have:
| Field | Purpose |
|---|
input | The user request or initial state |
|---|
expected_behavior | What a correct trajectory looks like (tools called, facts stated, tone) |
|---|
scoring_method | rule-based, LLM-judge, or human review |
|---|
tags | category, difficulty, tool used — for slicing results later |
|---|
known_failure | link to the bug report that produced this case, if any |
|---|
Aim for at least 50–100 cases before trusting aggregate scores, and grow the set continuously as new failure modes appear.
Rule-based scoring first
Before reaching for an LLM judge, write deterministic checks wherever possible. They are cheaper, faster, and immune to judge bias. Examples: checking that a returned JSON matches a schema, that a specific tool was called, that a number matches within a tolerance, or that a required disclaimer string is present.
# Rule-based check: did the agent call the refund tool with the correct amount?
def check_refund_call(trace, expected_amount, tolerance=0.01):
refund_calls = [c for c in trace.tool_calls if c.name == "issue_refund"]
if not refund_calls:
return False, "no refund tool call found"
amount = refund_calls[0].arguments.get("amount")
if amount is None:
return False, "refund call missing amount argument"
if abs(amount - expected_amount) > tolerance:
return False, f"amount mismatch: got {amount}, expected {expected_amount}"
return True, "ok"
Rule-based checks cover maybe 40–60% of cases well. The rest — open-ended answers, tone, reasoning quality — need a judge.
LLM-as-judge scoring
An LLM judge is a second model call that reads the agent's transcript and scores it against a rubric. It is useful for judging things that are hard to express as a rule: helpfulness, correctness of a free-text answer, whether the agent asked for missing information appropriately.
Guidelines for a judge that actually holds up:
- Give it a rubric, not a vague question. "Rate helpfulness 1–5" produces noisy, inconsistent scores. "Did the agent state the correct account balance? Did it avoid making up information not present in the tool results?" produces something checkable.
- Show the judge the tool outputs, not just the final answer. Otherwise it cannot detect hallucination against ground truth it never saw.
- Use a stronger or different model as judge than the one being evaluated, to reduce the risk of a model favoring its own style.
- Calibrate against humans. Periodically have a person score a sample of the same transcripts and check agreement with the judge. If they disagree often, revise the rubric or fall back to human review for that category.
- Ask for a reason plus a score. The reason lets you audit whether the judge actually understood the task, and it makes disagreements diagnosable instead of a mystery number.
In simple terms: an LLM judge is not a truth oracle. It's a fast, cheap approximation of a human reviewer that needs its own accuracy checks.
Common mistake: using the same model version for both the agent and the judge, then wondering why scores stay flat even as the agent's real quality changes — the judge and the agent share the same blind spots.
Regression suites: catching silent breakage
A regression suite is the eval set run automatically, on a schedule and on every meaningful change (new prompt, new model, new tool, new system message). The goal is to turn "it feels a bit worse since we updated the prompt" into a number you can point at.
Key practices:
- Run the full suite before and after any change, not just spot checks.
- Track scores per category/tag, not just one aggregate number. An overall score can stay flat while a specific tool-use category quietly breaks.
- Set a threshold that blocks deployment if scores drop beyond a tolerance, similar to a CI test gate.
- Store transcripts, not just scores, so a regression can be inspected, not just detected.
- Re-run non-deterministic evals multiple times (e.g., 3–5 runs per case) and look at pass rate rather than a single pass/fail, since agent output varies run to run.
| Approach | Cost | Speed | Best for |
|---|
| Rule-based checks | Low | Fast | Structured outputs, tool call correctness |
|---|
| LLM-as-judge | Medium | Medium | Open-ended quality, reasoning, tone |
|---|
| Human review | High | Slow | Rubric calibration, high-stakes cases |
|---|
A practical rollout order:
- Collect 50–100 real and hand-written cases, tagged by category.
- Write rule-based checks for anything checkable deterministically.
- Add an LLM judge with a specific rubric for the rest, calibrated against a human sample.
- Wire the suite into CI so it runs on every prompt or model change, with per-category score tracking.
- Feed every production failure back into the dataset as a new case.
This loop is what turns "the agent seemed fine in testing" into a system you can trust to change safely over time.
FAQ
How many eval cases do I need before I can trust the results?
There's no fixed number, but fewer than 30–50 cases tends to produce noisy, unstable scores that swing wildly with small prompt changes. Aim for enough cases per category (not just overall) that a single flaky case can't swing the category's score by more than a few percentage points.
Should I use the same LLM for the agent and the judge?
Avoid it where possible. Using a different model, or at least a different prompt and role, reduces the risk that the judge shares the agent's blind spots or is biased toward its own phrasing and reasoning style.
How often should regression suites run?
At minimum, on every change to the prompt, model, or tool set, before deployment. Many teams also run a nightly full pass to catch drift from upstream model updates that happen outside their control.
Related Articles
- The Evolution of AI Agents: From Early Bots to OpenClaw — Trace the history of AI agents from simple rule-based bots to modern autonomous assistants like OpenClaw.
- Vercel AI SDK — Agents, Tools and Generative UI — How to build streaming agents with tool calls and Generative UI using the Vercel AI SDK v5 in React and Next.js.
- Which LLM Should Power OpenClaw: GPT, Claude, or Others — A practical guide to choosing the best language model for your OpenClaw agent based on your needs.
- Cursor Background Agents: Delegating Long-Running Coding Tasks — How Cursor's cloud-based background agents let you hand off coding tasks that keep running after you close the editor.
- Building Long-Running AI Agents with Claude Opus 4.6 — Anthropic's Claude Opus 4.6 introduces adaptive reasoning and 1 million token context — here's how to build agents that maintain coherence across hours-long sessions.