TL;DR
Building AI agents for medicine usually means hand-crafting a fragile web of tools, prompts, and safety rules for every single task. Sage-Med-Harness automates this by pairing an audited library of over 10,000 medical tools and paper-derived runtime controls with a "harness composer" that assembles, tests, and refines task-specific agents on demand. The resulting agents not only handle complex multi-omics and clinical diagnostics, but also beat 74 specialized nucleotide foundation models on viral genome classification (85.8% vs. 76.0% Macro-F1).
What Problem Does This Paper Address?
AI "co-scientists" and "co-clinicians" are getting better at reading literature and running analyses, but scaling them across healthcare and biomedical research hits a wall: manual harness configuration. An agent's reliability depends heavily on its surrounding harness—the domain tools it invokes and the runtime rules governing orchestration, memory, permissions, and verification.
Today, scaling these agents is stuck on three bottlenecks:
- Fragmented resources and controls: Domain tools are scattered across GitHub and registries, while clever runtime controls (like how an agent checks its own work) stay buried in academic papers.
- No safety or quality auditing: Third-party tools run with the agent's permissions. Without vetting, broken installs or undisclosed behaviors—like silent external API calls or credential reads—pose real operational and privacy risks.
- Rigid, one-off designs: General-purpose agents force every task into one fixed harness, while specialist agents lock custom tools into a single application.
Methods
Sage-Med-Harness models a medical agent as LLM + Base Harness + Medical Components. It splits components into Domain Resources ($\mathcal{R}$)—declarative Skills, MCP tools, and CLIs—and Runtime Controls ($\mathcal{C}$)—Harness Plugins for orchestration, context/memory, permissions, and evaluation.
The framework operates through two tightly coupled engines:
- A Unified, Audited Component Ecosystem: The authors collected 10,425 open-source components from 229 repositories and used an automated pipeline (Paper2Plugin) to extract 432 runtime controls from 150 published agent papers, totaling 10,857 components across 14 domains. Every component undergoes static code scans, sandbox installation checks, and a read-only LLM review to generate an audit card. All components are then wired into a Component Relation Graph ($\mathcal{G}$) with 75,182 nodes and 139,016 edges capturing dependencies, compatibility, and vetted alternatives.
- A Co-Evolving Harness Composer: When a new task arrives, the composer queries $\mathcal{G}$ and audit cards to assemble a minimal, compatible agent just in time. The agent runs in an isolated sandbox and is graded by a frozen, independent evaluator ($\Phi$) to prevent self-evaluation bias or data leakage. Guided by this feedback, the composer swaps failing tools, tunes controls, or synthesizes missing components on the fly. Once verified, the winning configuration returns to the ecosystem for future reuse.
Datasets
Rather than relying on synthetic toy benchmarks, the authors tested Sage-Med-Harness on five end-to-end, real-world case studies:
- Lung Cancer Target Prioritization: Single-cell RNA-seq (LUAD and SCLC), E-MTAB-13530 Visium spatial transcriptomics (12 LUAD sections), 477 TCGA LUAD patient records, and Open Targets data.
- Ulcerative Colitis Trial Failure: The phase II MOONGLOW trial registry (NCT06137183, $n=79$), the TAURUS single-cell atlas (435,857 QC'd cells; 89,795 stromal cells), and four infliximab-treated GEO cohorts ($n=23\text{--}32$).
- Viral Genome Taxonomy: ViroBench
ALL-taxon-genus(58,314 viral genomes; 46,651 train / 5,831 val / 5,832 holdout). - Staged Clinical Diagnosis: A four-round published case of dual cardiac amyloidosis (78-year-old woman), paired with European Society of Cardiology guidance and ClinVar records.
- Digital Pathology: 12 pyramidal immunohistochemistry whole-slide images (2.09 GiB) spanning four cancer types and three antibody clones, with pathologist-scored PD-L1 benchmarks.
Key Insights and Ideas
- Open-source medical tools need a bouncer: Across all 10,857 components, the audit flagged potential risks in 35.1% of them (14.2% Not recommended for default use, 20.9% Needs confirmation), largely due to poorly documented external service calls, credential use, or code execution.
- Error-free execution $\neq$ valid science: Even when code runs without crashing, agents can hallucinate invalid combinations or skip checks. Pairing domain Skills with strict runtime controls—like lineage-constrained decoding in virology or evidence-grounding rules in clinical diagnosis—was essential to getting scientifically sound answers.
- Generalist capability via a growing library: Instead of betting on one monolithic agent loop to rule them all, Sage-Med-Harness shows how generalist medical AI can emerge from a version-pinned, model-agnostic library of verified, task-specific agents.
Key Results
- Viral Genomics: On ViroBench, the assembled agent hit 85.80% five-rank mean Macro-F1 across 5,832 holdout genomes, outperforming the per-rank best of 74 nucleotide foundation models (76.03%) at every taxonomic rank. Joint lineage decoding alone boosted validation Macro-F1 from 68.3% to 83.3%.
- Digital Pathology: The pathology agent reproduced automated PD-L1 Tumor Proportion Scoring across 12 multi-tissue slides with an intraclass correlation ($\text{ICC}(3,k)$) of 0.930 against pathologist scores (interval MAE 7.59 percentage points) and an exact 4.8-minute cold-start replay.
- Cancer Target Prioritization: A multi-omic agent linked fibroblast-enriched B7-H3 (CD276) upregulation to worse adjusted survival across 477 TCGA patients (overall survival HR 1.62; disease-free survival HR 2.06).
- Clinical Trial Analysis: The agent attributed OSMR$\beta$ trial futility to receptor redundancy across 89,795 stromal cells and showed a fixed 10-gene gp130-axis score beat OSMR alone in all four anti-TNF cohorts (AUC 0.834–0.914 vs. 0.651–0.788).
- Clinical Diagnosis: Coupling a differential-diagnosis Skill with paper-derived orchestration and evidence-grounding controls met every prespecified criterion across all four consultation rounds, suspecting coexisting AL and ATTRv amyloidosis before confirmatory pathology was disclosed.
Limitations and Future Work
Audit cards separate code risk verdicts from installation runnability, meaning they do not guarantee runtime security or live execution. While the five case studies demonstrate end-to-end utility, controlled multi-task benchmarks are still needed to isolate the exact contributions of graph-guided selection, runtime controls, and component synthesis. Furthermore, retrospective datasets leave interactive test ordering (under cost and risk constraints) and prospective clinical outcomes untested, and initial harness assembly adds compute overhead before reuse.
Looking ahead, the authors envision these verified, permission-scoped agent specifications enabling multi-agent collaboration between clinical and research teams, as well as serving as a scalable source of verifiable environments for post-training and reinforcement learning.
Summary updated