metaevo-ai / harness-zero
git clone https://github.com/metaevo-ai/harness-zero.git
Harness-Zero: Harness Distillation via Agent-as-Harness
+3
stars, 24h · #8,172
+~16
stars, 7 days · #9,047
+~70
stars, 30 days · #9,329
123
★ total · +15% this week
15
forks · 0 open issues
Star history (as recorded here)
LanguagePython
LicenseApache-2.0
Created2026-09-20 (1mo ago)
Last push13d ago
Watchers1
OwnerOrganization
GitHub topics
Links
README excerpt
# Harness-Zero: Harness Distillation via Agent-as-Harness **Distill an optimized agent harness into model weights — deploy with a minimal harness, keep the gains.** Agent harnesses — the external systems that mediate model–environment interaction — can substantially improve agent performance, but their gains remain tied to the harness at deployment. **Harness-Zero** transfers the behaviors an optimized harness induces into the model itself: a *harnessing agent* reviews the student's every response during training-time rollouts and rewrites it, in the student's own action space, whenever the optimized harness would have done better. Fine-tuning on the reviewed trajectories internalizes the behavior — at deployment the harness is gone and the gains remain. The full paper is available on alphaXiv. ## Highlights - 📈 **+21.0 points macro-average** on the base model (23.3% → 44.3%) across three domains — a 90.1% relative improvement. - 🏆 The distilled model **under the minimal harness alone (44.3%) beats the base model with the optimized harness still attached (41.7%)**. - 🔁 **Agent-as-harness > code-as-harness**: the same evolved harness applied through a harnessing agent averages 81.1% vs. 78.1% for direct mounting on frontier models. - 🧠 **82.3% recovery** of 28 harness-exclusive behavior patterns (memory, skill, tool, middleware) — direct evidence the behavior moved into the weights. ## Results Distillation into Qwen3.5-9B: | Setting | SpreadsheetBench | AppWorld | USPTO | **Avg.** | |---|---|---|---|---| | mini-SWE-agent (target harness *h*) | 31.0 | 26.8 | 12.0 | 23.3 | | meta-harness (evolved harness *h\**) | 39.0 | 48.2 | **38.0** | 41.7 | | DeepAgents | 35.0 | 19.6 | 7.0 | 20.5 | | Claude Code | 31.0 | 10.7 | 6.0 | 15.9 | | **Harness-Zero (distilled, *h* only)** | **44.0** | **58.9** | 30.0 | **44.3** | ## How it works 1. **Evolve & Adapt.** A student-side harness *h\** (tools, middleware, skills, memory — the DeepAgents abstraction) is evolved on training tasks, then adapted into a private reference harness *K* (action recipes, review middleware, review guidance, failure patterns) for the harnessing agent. See `harness_bank/` for the evolved harnesses and `.agents/skills/` for the evolution skill. 2. **Agent-as-harness trajectory collection.** The student runs under a fixed, minimal mini-SWE-agent-style target harness *h* (one bash tool, fixed system prompt). Before any response is executed, the harnessing agent reviews it using *K* and either **PASS**es it unchanged or **REPLACE**s it with a complete response valid under *h*. Only the accepted response enters the student-visible trajectory; the review stays private. 3. **Train & deploy.** SFT on the reviewed trajectories (masking any reviewer-perspective reasoning). The distilled student deploys under *h* alone — no *h\**, no *K*, no harnessing agent. ## Installation [code] Requirements: Python 3.12–3.13, Docker (rollouts run in local Docker sandboxes via Harbor). **Environment variable