Grader bypasses and verifier gaps in KlinikeBench tasks

#2
by evanjolley-p - opened

While digging through the tasks and verifier setups, we noticed a few edge cases where an agent can accidentally (or intentionally) bypass the grading checks, as well as a couple of spots where valid solutions can get tripped up. Where a route is not proven yet, the row says so. One of these comes from a Harbor runner setting the task leaves unset; we list it separately.

We looked at the Hugging Face dataset anon-caa-neurips/klinikebench at revision 6ee071f5 (2026-10-08).

For every row below we read the task files at that version and traced the route from what the agent can touch to what the grader scores. We did not run the tasks unless a row says so.

Paths to reward without doing the work

  • coh_mocvg7e1__hpoa_gen_moe196x0: diagnosis and required-tools gates pass without a diagnosis or real tool use (partial bypass)

    The diagnosis matcher passes when either normalized string contains the other (tests/caa_gates.py:73-75). A diagnosis of a single space is non-empty when read (:231-236) but normalizes to an empty string, which every target contains; the daemon records raw arguments (environment/runtime/clinicd.py:313-329), so clinic call record_diagnosis '{"diagnosis": " "}' passes on any case. The required-tools gate only checks that each name was called (tests/caa_gates.py:252-259), and clinic tools lists exactly the required and optional tools plus the terminal ones (environment/runtime/caa_tools.py:325-367), so calling every listed tool passes it (the step cap can limit this when there are many optional tools). No task we read sets custom_tools, so the parameterized gate always passes (tests/caa_gates.py:264-268). The default score still needs the hidden must-ask topics; the diagnosis and multigate modes give 1.0 and 0.8 (tests/verify.py:51-57). Same code in all 7 tasks we read; the dataset has 333 tasks built from the same shared files (environment/Dockerfile:3-5).

    • Suggested fix: Reject an empty or very short diagnosis and match whole terms against the target and listed synonyms; credit a tool only for a successful call with valid arguments for the active patient.
  • coh_mocvg7e1__hpoa_gen_moe196x0: open network, answer keys in the public dataset (reads the hidden answer; likely, not proven yet)

    task.toml:52 gives the whole trial open internet, though the agent only talks to the local daemon (environment/runtime/clinic:24). The public dataset release contains every task folder, including environment/task.json (diagnosis, required tools, must-ask topics) and solution/solve.sh, and the instruction names the case id (instruction.md:1). An agent that finds the dataset online can copy the reference diagnosis, tool calls and must-ask questions and pass all four gates. The CAA release that tests/verify.py:9-12 points to is a second possible source. We did not test whether a search finds either. Same code in all 7 tasks we read; the dataset has 333 tasks built from the same shared files (environment/Dockerfile:3-5).

    • Suggested fix: Set [agent] network_mode = "allowlist" with only the patient-simulator host, ideally a host-side proxy that adds the key.

False-negative bugs (valid work scored down)

  • coh_mofw3n0v__mendeley_gen_mokriyee: a required tool can never be credited (unsolvable task)

    environment/task.json:1 lists a required tool whose name ends with an underscore (nucleic_acid_amplification_test_NAAT_on_endocervical_or_vaginal_). The runtime strips the underscore when it builds the tool list (environment/runtime/caa_tools.py:241-248, used at :342-376), the daemon rejects any name not on that list (environment/runtime/clinicd.py:301-311), and the gate compares the raw name (tests/caa_gates.py:252-259). The required-tools gate can never pass, so every run scores 0, including the reference solution, which calls the stripped name (solution/solve.sh:12).

    • Suggested fix: Fix the tool name in task.json, compare sanitized names in the gate, and add a build-time check that every required tool is callable and the reference solution passes.
  • coh_mocvgcu7__mendeley_gen_monuoy9c: corrupted answer key (correct answers fail)

    environment/task.json:1 sets required_diagnosis and suspected_dx to ainc, with no accepted alternatives, while the same file's reasoning steps and leak list point to a retinal artery or vein occlusion. The gate matches the recorded diagnosis against that token (tests/caa_gates.py:205-247), so a clinically correct diagnosis such as central retinal artery occlusion fails, and the reference solution passes only by recording ainc (solution/solve.sh:18). Only meaningless strings pass, such as a diagnosis of a single space.

    • Suggested fix: Restore the intended required_diagnosis with accepted synonyms, and add a check that every answer key is a recognized condition name.
  • coh_mocvgcu7__mendeley_gen_mofqyva9: instruction and answer key disagree (correct answers can fail)

    The task-specific instruction, marked highest precedence, asks for a precise diagnosis rather than a general category (instruction.md:27) and allows admit_to_hospital only if the clinician thinks admission is needed (instruction.md:28). The answer key is the category arrhythmia (alternative arrhythmic presyncope/syncope) and admit_to_hospital is a required tool (environment/task.json:1). A precise diagnosis such as atrial fibrillation does not contain the category word and fails the matcher (tests/caa_gates.py:69-81), and an agent that decides against admission fails the required-tools gate (:252-259).

    • Suggested fix: Align required_diagnosis and acceptable_diagnoses with the precision the instruction asks for, and either drop admit_to_hospital from the required tools or make admission unconditional in the instruction.
  • coh_mofw3n0v__mendeley_gen_mokriyee: examination findings graded only from spoken turns (correct work can fail)

    Two must-ask topics are examination findings, cervical motion tenderness during pelvic exam and mucopurulent cervical discharge on speculum exam (environment/task.json:1). The judge sees only spoken turns and skips tool calls and their results (tests/caa_judge.py:56-67), as does the rule-based fallback (tests/caa_gates.py:167-180), so an agent that performs the pelvic examination through the tool but does not voice these findings fails the must-ask gate. instruction.md does not say that must-ask topics exist or that findings must be spoken. This task is also unsolvable for another reason: a required tool name ends in an underscore that the runtime strips.

    • Suggested fix: Keep must-ask topics to history questions, or let the judge see examination tool calls and results when a topic is an examination finding.
  • coh_moevcoxi__primekg_gen_moo9hlm2: spends the turn budget before the required tools (reference solution scores 0)

    This case has 12 must-ask topics, 15 required tools and a 10-turn budget (environment/task.json:1, task.toml:18). solution/solve.sh:7-18 asks one question per topic before any tool call; each counts as a patient turn (environment/runtime/clinicd.py:172-178), and once 10 are used the daemon refuses further questions and every non-terminal tool (:222-227, :244-254, :290-299). The reference therefore fails the required-tools and must-ask gates and scores 0. The task stays solvable if topics are combined into fewer turns, so the defect is in the reference, not the grader. Same generated reference, so expected in every case whose must-ask topics are at least its turn budget; we checked this one.

    • Suggested fix: Have the reference combine must-ask topics into fewer turns or call tools first, and add a build-time check that the reference passes.

Harbor-related issues (runner settings the tasks leave unset)

These issues come from Harbor runner settings that the tasks leave at their defaults, not from the task logic. On current Harbor (v0.26.0), a task that sets nothing gets public internet, runs the agent as the image's default user (usually root), and runs tests/test.sh inside the agent's own container after the agent finishes, so the grader sees every file the agent changed and any process it left running. Harbor deletes old reward files before grading, but a process the agent leaves running can still write one while the grader runs, and reward.json wins over reward.txt. Upgrading Harbor does not change these defaults for existing tasks. Each row names the task.toml setting that closes it.

  • coh_mocvg7e1__hpoa_gen_moe196x0: live agent process writes reward.json (full score without doing the work)

    No environment_mode is set, so tests/test.sh runs as root (task.toml:29-31) inside the agent's container, and nothing stops the agent's processes first. The image creates /logs/verifier writable only by root (environment/Dockerfile:23), but current Harbor sets it to mode 777 at container start (harbor v0.26.0: src/harbor/environments/base.py:799-802). A background process the agent leaves running can keep renaming its own reward.json with reward 1 into that folder after Harbor clears it: tests/verify.py:199 writes the real result once, and tests/test.sh:14-15 only fills in a missing file. Harbor reads reward.json after tests/test.sh ends, so the agent's value wins. We did not run it. Same code in all 7 tasks we read; the dataset has 333 tasks built from the same shared files (environment/Dockerfile:3-5).

    • Suggested fix: Under [verifier] add environment_mode = "separate", and add a top-level artifacts = ["/var/lib/caa/transcript.json", "/var/lib/caa/meta.json"] line right after schema_version so the verifier still gets the daemon record.

Lower-impact notes

These only weaken a check and do not change a score on their own.

Lower-impact notes (1)
  • coh_mocvg7e1__primekg_gen_molbyszf (Exposes the host's model API key to the agent): task.toml:62 copies the host's model API key into [environment.env] as CAA_SIM_API_KEY, which Harbor sets in the agent's container, and the network is open (:52). The agent can read the key from its shell and call the hosted model directly, for help with the case or to send the key elsewhere; environment/runtime/llm.py:94 shows it is used as a bearer token. The comment at task.toml:57-58 and the dataset README already note this and suggest a host-side proxy, but the shipped default still forwards the key. Same code in all 7 tasks we read; the dataset has 333 tasks built from the same shared files (environment/Dockerfile:3-5). Suggested fix: Remove the key lines from [environment.env] and route the simulator through a host-side proxy that adds the key.

Sign up or log in to comment