A grader deserves a few deliberately bad answers before it gets to judge a good agent.

I built a small check around a temperature-conversion artifact. The interesting failure is a result with the right total and wrong individual rows. A total-only check accepts it. The row-level check below rejects it while accepting a valid result in a different order.

Hugging Face's new agentic-evaluation guide makes a related point with a scientific task: test the verifier using a reference solution, a do-nothing attempt and an incomplete shortcut. Its shortcut produced the requested ratio without doing the required fitting. [1] My example uses invented temperatures and no model calls; it is a runnable grader exercise.

A verdict grid for ten deliberately constructed artifacts. The reference and reordered result pass. Missing, empty, wrong rows with the same total, wrong units, duplicate IDs, boolean values, malformed JSON and nonfinite values fail.

Executed checks on synthetic artifacts, not agent success rates. Original figure by the author.

Write down the artifact contract

The input has three IDs: a, b and c, with Celsius readings of 0, 10 and 20. Each output row must keep its ID, convert to Kelvin by adding 273.15, and declare unit K.

I allow an absolute error of 0.001 K for each value. Row order is irrelevant. Missing IDs, repeated IDs, extra fields, strings in numeric fields and nonfinite numbers fail.

The expected values live with the evaluator. The submitted artifact does not get to supply its own answer key. In an actual harness, keep the trusted inputs and verifier outside the agent's writable workspace.

Now consider the bad output: reduce a by one kelvin and increase b by one. The total stays the same. So does the mean. Neither aggregate establishes that every conversion is correct.

This is a useful negative control because the defect is known in advance. A failure here tells me something about the grader, without needing an unreliable agent to happen upon the mistake.

Run the check against files

Save the following as grade.py and run python3 grade.py. It uses only Python's standard library; I ran it with Python 3.14.7. Each case is written to a temporary JSON file and read back by the grader.

import json from decimal import Decimal, InvalidOperation from pathlib import Path from tempfile import TemporaryDirectory # Synthetic inputs held by the evaluator, outside the submitted artifact. source = {'a': Decimal('0'), 'b': Decimal('10'), 'c': Decimal('20')} expected = {key: value + Decimal('273.15') for key, value in source.items()} def reject_constant(value): raise ValueError(f'nonstandard JSON constant: {value}') def grade(path): try: rows = json.loads(Path(path).read_text(), parse_float=Decimal, parse_int=Decimal, parse_constant=reject_constant) if not isinstance(rows, list) or len(rows) != len(expected): return False seen = set() for row in rows: if not isinstance(row, dict) or set(row) != {'id', 'kelvin', 'unit'}: return False key, value = row['id'], row['kelvin'] if not isinstance(key, str) or key not in expected or key in seen: return False if row['unit'] != 'K' or not isinstance(value, Decimal): return False if not value.is_finite() or abs(value - expected[key]) > Decimal('0.001'): return False seen.add(key) return seen == set(expected) except (OSError, ValueError, TypeError, InvalidOperation): return False good = [{'id': key, 'kelvin': float(value), 'unit': 'K'} for key, value in expected.items()] wrong_rows = json.loads(json.dumps(good)) wrong_rows[0]['kelvin'] -= 1 wrong_rows[1]['kelvin'] += 1 wrong_unit = [dict(row, unit='C') for row in good] duplicate = [good[0], good[0], good[2]] cases = {'reference': good, 'reordered': good[::-1], 'empty': [], 'same_total_wrong_rows': wrong_rows, 'wrong_unit': wrong_unit, 'duplicate_id': duplicate, 'boolean_value': [dict(good[0], kelvin=True), *good[1:]]} assert sum(row['kelvin'] for row in good) == sum(row['kelvin'] for row in wrong_rows) with TemporaryDirectory() as folder: path = Path(folder) / 'result.json' print(f'missing_file: {grade(path)}') assert not grade(path) for name, artifact in cases.items(): path.write_text(json.dumps(artifact)) passed = grade(path) assert passed == (name in {'reference', 'reordered'}) print(f'{name}: {passed}') for name, text in [('malformed', '{'), ('nonfinite', '[{"id":"a","kelvin":NaN,"unit":"K"}]')]: path.write_text(text) assert not grade(path) print(f'{name}: {grade(path)}') 

The output is:

missing_file: False reference: True reordered: True empty: False same_total_wrong_rows: False wrong_unit: False duplicate_id: False boolean_value: False malformed: False nonfinite: False 

JSON booleans need an explicit rejection here. A value such as true should not sneak into a numeric result just because some language-level numeric checks accept booleans. Parsing real JSON numbers as Decimal gives this grader a direct way to keep those types apart.

I also checked the tolerance boundary separately: a difference of exactly 0.001 K passes; 0.0011 K fails. All six permutations of the valid rows pass. An independent fraction calculation agrees with the conversion values.

What this verdict establishes

A pass means the file meets this small output contract. It does not prove how the file was produced. An agent could use a formula, a lookup or another valid route. For this task, that flexibility is fine.

If the intended capability were fitting a physical model, checking converted values would be the wrong task. If the requirement included obtaining permission before an action, final-state checks would need separate evidence about the action sequence.

Bharad's The Eval Pyramid, Part I makes that outcome-versus-trajectory distinction explicit. [2] A deterministic grader and repeated agent trials also answer different questions: repeatability of the verdict does not establish repeatability of the agent.

This script exercises the verifier only. It does not run an agent, isolate hostile submissions, or establish a production reliability percentage. Before counting model passes, I want this smaller question settled: do the outputs I already know are wrong actually fail?

References

  1. Avijit Ghosh, Ben Burtenshaw and Irene Solaiman, How to build and maintain an agentic evaluation.
  2. Bharad, The Eval Pyramid, Part I: Testing Systems That Don't Behave the Same Way Twice.

Asset credits

Original verdict diagram from the executed synthetic cases. No benchmark figure or third-party image was reused.

AI disclosure

AI was used to draft the article.