arXiv:2610.05778cs.CLOct 2026

Manuscript Offprint

arXiv:2610.05778

MedicalHarness: A Controlled Evaluation of LLMs and Agent Harnesses on Medical Tasks

Ziqing Wang, Lili Zhao, Kaize Ding

ABSTRACT

LLM agents are increasingly built for medical work and scored on clinical benchmarks. Each such score, however, comes from a model running inside an agent harness, the system that controls the loop between the model and its environment. An agent's score is therefore a property of a model–harness pair. For medical agents, how much outcomes change with the harness has rarely been measured. Measuring this change, and explaining it, raises two challenges. First, a harness comparison must change nothing but the harness and be repeated across models and kinds of task. Second, comparing whole harnesses leaves their mechanisms bundled together, so it cannot show when an individual mechanism helps. To address these challenges, we present MedicalHarness, a controlled study of models and agent harnesses on medical tasks. We first build MedicalHarnessBench to evaluate agents on 107 tasks across four domains that each test a different harness capability. Using this benchmark, we run five open-weight models under five agent harnesses, changing only the harness within a comparison, and analyze both outcomes and execution traces. To study individual mechanisms, we build MH-Lab, a controlled harness that switches off context management, planning or tool exposure one at a time within a shared execution loop. We find that the harness and its interaction with the model account for about a quarter of the outcome variance, and that no single harness is best across models and tasks. Code and data are available at https://github.com/REAL-Lab-NU/MedicalHarness.

1 INTRODUCTION

LLM agents have drawn growing interest in medicine, with the promise of supporting clinical work and reducing clinicians' administrative burden (Wang et al., 2025a; Jiang et al., 2025; Wang et al., 2025c; 2026b). These applications require agents to act within clinical systems, from computing risk scores and finding facts in patient records to checking trial eligibility and resolving insurance denials across hospital portals. To assess how well agents complete such work, a growing set of benchmarks evaluates them in simulated clinical environments (Jiang et al., 2025; Schmidgall et al., 2026; Liu et al., 2026a; Bedi et al., 2026; Chen et al., 2026; Liu et al., 2026b). The resulting scores reflect both the model and the agent system that guides its interactions with the environment. Understanding these results therefore raises a basic question: how much do outcomes change when the same model runs inside a different agent system?

The system around the model is its agent harness. Harnesses such as Claude Code (Anthropic, 2026), Codex (OpenAI, 2026), OpenClaw (OpenClaw contributors, 2026) and Hermes (Nous Research, 2026) determine what the model sees, which tools it can call, how its actions are executed, how its history is managed and when execution ends (Li et al., 2026; Wang et al., 2026c). History management affects which clinical evidence remains available (Wang et al., 2026a; Zhang et al., 2026c), while stopping rules determine whether an unfinished workflow can continue. Such differences can lead the same model to different outcomes (Zhang et al., 2026b; Yao et al., 2026). An agent's score is therefore a property of a model–harness pair. In medicine, however, few studies compare harnesses under controlled conditions across models and kinds of task. Making such comparisons, and explaining the differences they reveal, raises two challenges.

Figure

Figure 1: Overview of MedicalHarness. Top: MedicalHarnessBench's four environments, each testing a different harness capability: MedTool (clinical calculation), MedMemory (long-context retrieval), MedPlanning (clinical data workflows) and MedWeb (browser interaction). Bottom left: every model runs under every harness on all 107 tasks, so each row varies only the harness and each column only the model. Bottom right: MH-Lab switches off one mechanism at a time, keeping the rest of its loop fixed: context management (summarizing old turns), planning (a plan shown every turn) or tool exposure (all tools listed instead of hidden behind search).

Challenge 1: measuring and understanding harness differences. When agent comparisons change the model, serving conditions or execution budget along with the harness, the resulting score gaps mix these effects (Zhang et al., 2026b; Yao et al., 2026). A controlled comparison must therefore run the same model on the same tasks, with the serving setup and budgets held fixed. A result from one model on one task type may not hold elsewhere, so this comparison must be repeated across models and different kinds of medical task. Even under these controls, the same low score can reflect different failures, such as a wrong answer, no answer at all or an unfinished workflow, so execution traces and task diagnostics are needed to tell them apart.

Challenge 2: understanding when individual mechanisms help. Whole-harness comparisons leave context management, planning and tool exposure bundled together, making their individual effects difficult to identify (Li et al., 2026). Whether a mechanism helps can also depend on the model and the task. Some mechanisms, such as summarization, operate only under particular conditions, so enabling them does not ensure that they are used. Studying their effects therefore requires changing one mechanism at a time within a shared execution loop, with the model, task, underlying tools and budget held fixed, and in a setting where the mechanism actually fires.

To address these challenges, we present MedicalHarness, a controlled study of models and agent harnesses on medical tasks (Figure 1). We first build MedicalHarnessBench to evaluate agents across four capability domains. Using this benchmark, we compare model–harness pairs under matched execution conditions and analyze their outcomes and execution traces. To study individual mechanisms, we build MH-Lab, which switches off context management, planning or tool exposure one at a time within a shared execution loop. We find that the harness and its interaction with the model account for a substantial share of outcome variance, and that no single harness is best across models and tasks. Harnesses also usually differ more in how often they answer than in their scores on commonly answered questions, and hiding tools behind a search interface, meant to save context, can instead cost tokens or accuracy. Our contributions are:

• Benchmark. We introduce MedicalHarnessBench, a benchmark of 107 executable medical tasks spanning clinical calculation, long-context retrieval, clinical data workflows and browser interaction, four domains that each test a different harness capability.

• Controlled comparison study. We evaluate five open-weight models under five harnesses with three seeds (8,025 episodes), changing only the harness within a comparison. We pair a model–harness variance analysis with answer-production and execution diagnostics.

• Controlled mechanism study. We build MH-Lab to test context management, planning and tool exposure through one-at-a-time interventions within a shared execution loop.

2 RELATED WORK

Medical agent benchmarks. MedAgentBench evaluates task execution in a virtual EHR (Jiang et al., 2025), and AgentClinic simulates interactive clinical decision-making (Schmidgall et al., 2026). HealthAgentBench assembles executable environments across clinical data, imaging and trial matching (Liu et al., 2026a), HealthAdminBench and χ\chi-Bench evaluate agents on healthcare administration and managed-care workflows (Bedi et al., 2026; Chen et al., 2026), MedMCP-Calc exposes medical calculators to agents through MCP (Zhu et al., 2026), and MedMemoryBench tests memory over long patient histories (Wang et al., 2026a). These benchmarks measure what an agent can do in a medical environment. HealthAgentBench and χ\chi-Bench also compare harnesses, but MedicalHarness is dedicated to this comparison and makes it more comprehensive and better controlled. It runs every model under every harness on more tasks, spanning four kinds that each test a different harness capability, serves all models locally under one setup so that only the harness changes, and adds controlled experiments on individual mechanisms.

Harnesses and their mechanisms. A harness, also called a scaffold, changes what a fixed model can do (Yang et al., 2024; Wang et al., 2025b), yet general agent benchmarks such as AgentBench and WebArena are built mainly to compare models (Liu et al., 2024; Zhou et al., 2024). Recent work evaluates the harness itself. Harness-Bench measures harness effects across models (Yao et al., 2026), Zhang et al. (2026b) model the harness as the controller of a closed loop around the model and propose disclosure standards with a variance decomposition, Li et al. (2026) organize harness components into seven families, and Fan et al. (2026) ablate components for coding agents. Controlled comparisons outside medicine find that harness effects vary with the task and the model, from large cost but small accuracy differences on terminal coding (Vats & Golev, 2026) to accuracy gaps of up to 28 points on GAIA (Starace, 2026), and Zhang et al. (2026a) show that a score reflects the model only if the harness leaves the decisions to it. MedicalHarness also separates how often agents answer from their scores on commonly answered questions, and uses MH-Lab to switch off three mechanisms that product harnesses share, context management (Packer et al., 2023), planning and tool exposure (Qin et al., 2024), one at a time within one execution loop.

References (51)