# Test Your AI Agent's Grader Before Trusting Its Pass Rate

> Use an unchanged baseline, a correct artifact and deliberate failures to check whether an agent evaluation actually measures the requested work.

Canonical article: https://modelrovia.com/guides/agent-evaluation-verifier-controls/
Author: Modelrovia Editorial
Published: 2026-11-25
Updated: 2026-11-25

## Key takeaway

Validate that the grader rejects an unchanged starting state and known wrong outputs before comparing agent runs.

Before comparing two coding agents, check that your grader can distinguish completed work from the starting state. Hugging Face's November 23 evaluation guide recommends testing reference solutions, inspecting traces and checking how a do-nothing agent scores. You can apply that principle with three controlled artifacts before spending tokens on a full run. [Hugging Face evaluation guide](https://huggingface.co/blog/agentic-evals)

## Define an observable task

Suppose the task is to add a delivery charge to a fictional order and save the total. Provide a starting JSON artifact containing the subtotal of $18.50 and a blank result. The instruction asks the agent to add $2.75 delivery and write an output object containing only `order_id` and `total`, with the total formatted as a decimal string.

The expected result is `{"order_id": "T-014", "total": "21.25"}`. A file existing at the right path is insufficient to score success. Check the fields, the ID and the exact amount.

~~~python
import json
from decimal import Decimal, InvalidOperation

def passes(raw):
    try:
        obj = json.loads(raw)
        if not isinstance(obj, dict) or set(obj) != {"order_id", "total"}:
            return False
        amount = obj["total"]
        return (
            obj["order_id"] == "T-014"
            and isinstance(amount, str)
            and amount == "21.25"
            and Decimal(amount) == Decimal("18.50") + Decimal("2.75")
        )
    except (ValueError, TypeError, InvalidOperation):
        return False

cases = {
    "unchanged": '{"order_id":"T-014","subtotal":"18.50","total":null}',
    "correct": '{"order_id":"T-014","total":"21.25"}',
    "wrong amount": '{"order_id":"T-014","total":"18.50"}',
    "wrong order": '{"order_id":"T-999","total":"21.25"}',
    "wrong shape": '["21.25"]',
    "invalid JSON": 'finished!',
}
for name, raw in cases.items():
    print(name, passes(raw))
~~~

Our local run accepted only the correct artifact. These authored cases check the verifier's behavior. They give no information about how often a model will solve the task.

## Keep the expected answer outside the agent's workspace

For real evaluation runs, reset the starting files before each attempt. Run the grader from a separate trusted location against the final artifact, and retain the agent trace. If you place the grader and its expected answer among files the agent may change, a passing result can become difficult to interpret.

Keep a record of model identifier, harness version, tools, time and token budgets, starting artifact hash, verifier version and every run result. When one model fails, inspect whether it wrote the wrong amount, wrote the right amount to the wrong path, or never reached the final save. Those failures require different fixes.

For a larger task set, include easy, typical and known difficult cases, and report the counts by task group. Preserve timeouts and incomplete attempts in the run ledger. After repairing a faulty verifier, regrade retained artifacts when possible and label the result with the new verifier version.

The [saved-output replay guide](/guides/promptfoo-replay-saved-outputs/) covers response-level checks. This example focuses on whether an artifact grader can reject known failures before an agent evaluation starts.

**Verification on November 25.** We executed the Python fixture locally and retained its six results. No agent or paid inference was run.

## Sources & references

- [Hugging Face: How to build and maintain an agentic evaluation, November 23](https://huggingface.co/blog/agentic-evals)

[Editorial standards](https://modelrovia.com/methodology/)
