labs.csvpatient_idcreatinineunitPT002150µmol/Lwith the unit column32.5 mL/mincorrectwithout it0.4 mL/minkidneys ‘failed’, drug withheldSame row. Two readings.

Renal dose check: a ward chart with ten ways to be wrong

All work

Sample benchmark task · AI evaluation

What an agent benchmark is

An agent benchmark hands an AI model a job in a real environment, here a Linux terminal with a few files in it, and grades what it produces with automated tests. The model can run commands, write code and check its own work. What it can't do is talk its way past the tests: they read the output file and nothing else.

This one gives the agent a small ward chart: 15 synthetic adults, their creatinine results and their medication orders, recorded in mixed units. For each patient it has to work out kidney function as creatinine clearance (CrCl, by the Cockcroft-Gault formula), then flag every active order whose daily dose is over the limit for that kidney function.

The instruction states the formula, the constants and the dosing rules. So the task doesn't test medical knowledge. It tests whether the agent reads the chart the way a careful pharmacist would: which unit a number is in, whether an order is still running, how often a dose is given, and which result is the latest.

patients.csvlabs.csvmeds.csvrules.jsonagentin a terminaldose_check.jsonl32 testspass / failthe chartone line per patient
The tests read only the answer file. A confident explanation earns nothing; a number outside 1% or one wrong order id fails.

The traps

Each trap changes one patient's answer, or a small group built for the same trap, and no patient carries two. So when a patient fails, it points at one mistake. Open one to see the patient's rows and both readings of them.

Valid look-alikes

These two patients are legitimate. They're there to punish shortcuts, the blanket rules that guess a unit from the size of a number instead of reading the unit column.

The evidence

A benchmark is only as good as its grading. Two things have to hold: the answer key is right, and the tests pass right answers and fail wrong ones.

The reference passes

The answer key comes from the reference solution, so the first thing to prove is that the key is right. A second implementation, written in SQL against the instruction alone and sharing no code with the reference, agrees on all 15 patients: the same CrCl at 0.1 mL/min and the same flagged orders.

$ pytest tests/test_outputs.py  # solve.py's output
32 passed

A grader can also be too strict. These defensible choices a careful agent might make all pass, which shows the 1% tolerance and the set comparison leave room for honest variation:

  • simulator with no mistakes · passes
  • µmol/L→mg/dL factor 88.42 instead of 88.4 · passes
  • lb→kg as ÷2.2 · passes
  • lb→kg as ÷2.2046 · passes
  • round kg to 0.1 and SCr to 0.01 mg/dL before CG · passes
  • choose band from CrCl rounded to 0.1 · passes
  • flagged ids emitted in file order, not sorted · passes
47.1 reference±1% acceptedband edge 50
The tightest case, PT005: 5.8% from the nearest band edge. The task requires at least 2% for every patient, twice the tolerance, so any answer the test accepts still lands in the right band.

Which mistake fails which test

One simulated agent runs with each mistake switched on alone, and the real test file grades it. Every mistake fails, and only on the patients built for it.

Simulated mistakeResultTests that fail
Creatinine in µmol/L read as mg/dLcr_umol_as_mgdlfails8 of 32
  • CrCl within 1% · PT001
  • CrCl within 1% · PT002
  • CrCl within 1% · PT003
  • CrCl within 1% · PT004
  • Flagged set exact · PT001
  • Flagged set exact · PT002
  • Flagged set exact · PT003
  • Flagged set exact · PT004
Weight in lb read as kgweight_lb_as_kgfails6 of 32
  • CrCl within 1% · PT005
  • CrCl within 1% · PT006
  • CrCl within 1% · PT014
  • Flagged set exact · PT005
  • Flagged set exact · PT006
  • Flagged set exact · PT014
A stopped order counted as activecount_discontinuedfails1 of 32
  • Flagged set exact · PT008
q8h read as eight doses a dayfreq_qNh_as_countfails1 of 32
  • Flagged set exact · PT009
BD read as once a dayfreq_bd_as_oncefails1 of 32
  • Flagged set exact · PT010
TDS read as twice a dayfreq_tds_as_twicefails1 of 32
  • Flagged set exact · PT011
The last row, not the latest resultlab_last_row_winsfails2 of 32
  • CrCl within 1% · PT012
  • Flagged set exact · PT012
A dose exactly at the limitflag_at_limitfails1 of 32
  • Flagged set exact · PT013
A low creatinine that really is µmol/Lcr_unit_by_magnitudefails2 of 32
  • CrCl within 1% · PT004
  • Flagged set exact · PT004
A genuine 150 kg patientweight_unit_by_magnitudefails2 of 32
  • CrCl within 1% · PT007
  • Flagged set exact · PT007
Output file never writtenno_output_file · malformed outputfailsall 32
  • Every patient once
  • Row schema
  • CrCl within 1% · PT001
  • and 29 more
Output file exists but is emptyempty_output · malformed outputfails31 of 32
  • Every patient once
  • CrCl within 1% · PT001
  • CrCl within 1% · PT002
  • and 28 more
One patient's line missingdrop_one_patient · malformed outputfails3 of 32
  • Every patient once
  • CrCl within 1% · PT001
  • Flagged set exact · PT001
One patient written twiceduplicate_patient · malformed outputfailsall 32
  • Every patient once
  • Row schema
  • CrCl within 1% · PT001
  • and 29 more
A patient id that is not in the chartextra_patient · malformed outputfails1 of 32
  • Every patient once
CrCl written with full float precisioncrcl_unrounded · malformed outputfails1 of 32
  • Row schema
CrCl written as a JSON stringcrcl_as_string · malformed outputfails2 of 32
  • Row schema
  • CrCl within 1% · PT001

Graded with the task's own pytest suite when this page was built from commit ba39b9c (2026-11-07). The run matched the evidence committed in the repository, which reports no problems.