Background and Problem Definition of Harness Adapter
Large language models (LLMs) are trained to achieve high performance on general benchmarks. However, in real deployment environments, they operate on specific agent harnesses such as Pi, OpenCode, and Hermes Agent. The Hugging Face research team pointed out that "the model is not fully optimized for all harnesses and tasks," stating that simply combining a general model with a specific harness is "leaving performance and efficiency on the table."
To address this issue, the Harness Adapter has been proposed. It involves performing reinforcement learning (RL) within the target harness to train a LoRA adapter specialized for the specific harness-task combination. The researchers previously validated the concepts of multi-harness RL and harness adapters in data analysis and code build tasks, and this time expanded the scope to 27B scale models, more challenging real software engineering tasks, and three different harnesses.
"Through RL, you can train a customized harness adapter that squeezes everything from the model tailored to your harness and task combination."
Key Experimental Results: Simultaneous Improvement in Performance and Efficiency on Qwen3.8-27B
The researchers used the base model Qwen3.8-27B and measured the Terminal-Bench 2.1 benchmark on the Pi harness. The base model recorded a Pass@1 of 39% and an average token usage of 2.9K. By adding a customized RL-trained LoRA adapter while keeping the weights fixed, Pass@1 improved to 55% and average tokens reduced to 1.5K.
| Metric | Base Model (Qwen3.8-27B) | After Applying Harness Adapter | Improvement Rate |
|---|---|---|---|
| Pass@1 (Terminal-Bench 2.1, Pi Harness) | 39% | 55% | +16%p |
| Average Token Usage per Task | 2.9K | 1.5K | -48% |
| Base Model | 39 |
| Harness Adapter | 55 |
The researchers identified "the model inferring less, calling fewer tools, and performing better on the first attempt" as key factors for the performance improvement. This leads to a significant reduction in inference overhead, resulting in cost savings.
Customized LoRA Training and Super Adapter Construction for Three Harnesses
Experiments were conducted on three representative agent harnesses:
- Pi 1.5.2
- OpenCode 2.2.7
- Hermes Agent v0.22.6
Separate LoRA adapters were trained using RL for each harness, and all three adapters showed superiority in both performance and efficiency compared to the base model on their respective harnesses. Furthermore, the three LoRAs were merged into a single super adapter. This super adapter operates seamlessly across all three harnesses without additional training, maintaining performance close to that of the dedicated adapters for each harness. The researchers stated, "We shared a fully reusable recipe so that you can reproduce it with your own task, harness, and model combination." All artifacts (adapters, GGUF, RL tasks, SafeAgent plugins) can be found in the Hugging Face collection.
RL Learning Pipeline Inside Agent Harness
Existing RL frameworks typically reimplement the agent loop. Notable examples include the agent loop of Verl, the SkyRL-Gym environment, the agent and environment classes of rLLM, the custom rollout functions of Slime, and the clients of ART. In contrast, this approach allows the "harness to run as it is deployed, with the trainer learning from the exact tokens recorded by the proxy between the harness and vLLM."
- Prepare Docker Image
- Harbor Integration
- OpenEnv Proxy Recording
- AsyncGRPOTrainer Learning
- Save Adapter
Specifically, Hugging Face's Harbor integration was utilized with OpenEnv and TRL's OpenEnv guide. The final Docker image has the target harnesses pre-installed. The TRL's AsyncGRPOTrainer was used for more efficient GRPO training. Recently, Agent Lightning v1.0 adopted "Harnessed Agentic RL" to maintain the deployment-time harness in the loop through proxies, and SkyRL's Harbor integration is also converging in a similar direction by learning during Harbor trials and converting chat history into tokens to supply to the trainer.
Building High-Quality RL Task Datasets and Validation Process
RL training requires tasks for the agent to attempt, a verifier to score the attempts, and evidence that the verifier is correct. "A verifier that accepts incorrect answers teaches incorrect behavior, and tasks that can already be solved teach nothing to the model." The researchers built a single data pipeline by combining the Hugging Face Hub, OpenEnv, and Repo2RLEnv (Tasksmith).
Three Task Sources
1. SWE-Smith (Python/Go): Injects bugs into real repositories (e.g., LLM rewrite or operator inversion) and creates tasks to catch them. Contributes to volume acquisition. 2. SWE-Gym (TaskTrove Packaging): Converts fixes merged with actual GitHub issues into tasks. Provides real bug coverage. 3. Tasksmith: Generates tasks from merged pull requests (PRs). LLM agents write instructions and tests, and Tasksmith validates (reference and alternative pass, unmodified and incorrect fail). Used for targeting technical gaps.
The researchers mapped the techniques tested by Terminal-Bench 2.1, SWE-bench Pro hard subsets, and DeepSWE, then selected 30 PRs dealing with HTTP streaming, filesystem operations, serialization, etc. Tasksmith produced 24 tasks from 10 Python repositories (1st pass), and 17 passed in the 2nd execution. This does not replace self-validation, so the entire pipeline goes through the same process.
Strict Semantic Validation with openenv validate
After a metadata screen (training split, allowed licenses, duplicate removal, exclusion of 253 benchmark tasks and related repositories), semantic checks of openenv validate were performed as new trials on all tasks.
- semantic.oracle_max: Reference solution achieves maximum reward
- semantic.floor_gap: Doing nothing has a clearly low score
- semantic.canary_floor: Canary solution is not higher than doing nothing
- runtime.episode_determinism: Same reward on reference re-execution
Each trial was executed as a separate Hugging Face job, validating dozens of tasks in parallel. Out of 1,127 hub candidate tasks, 858 passed. During the negative control process, a Tasksmith task was found to accept a flaw with incomplete implementation, and a flaw was detected in the Terminal-Bench 2.1 verifier (regex-log) that accepted incorrect answers.
Implications and Future Challenges
This research demonstrated that RL adapters tailored to specific harness-task distributions can break through the performance and efficiency bottlenecks of general models in a 27B scale, real coding task, and multi-harness environment. The achievement of multi-harness compatibility through super adapter merging is also significant from a practical deployment perspective. The researchers left the question of "what the model actually learned" open, hinting at future directions for interpretability and generalization research. All code, data, and models are publicly available on the Hugging Face Hub for immediate reproduction and expansion.