Harness Adapters: Safe RL for Efficient AI Agent Development

ArticleYounes B, Lysandre, Nathan HabibAnnouncement

Hugging Face researchers introduce Harness Adapters: compact LoRA adapters trained via reinforcement learning directly inside agent harnesses like pi, opencode, and hermes. Served from a single base model, they reduce tool calls while maintaining or improving accuracy. A proxy called safeagents blocks reward-hacking shortcuts.

Key points

  1. Rank-32 LoRA adapters are trained using AsyncGRPO inside unmodified agent harnesses (pi, opencode, hermes).
  2. A single vLLM instance serves multiple adapters concurrently for training and eval, dramatically cutting compute costs.
  3. The safeagents proxy inspects every tool call with rule-based checks, blocking attempts to hack rewards.
  4. Environments combine SmolDataEnvs with Repo2RLEnvs tasks (build, repair, extend, QA) extracted from real Hub trajectories.
  5. Tested on LiquidAI's LFM2.5-24B-A2B, LFM3-1.7B, and an experimental run with the non-agent reasoning model TwIL-8B.

Why it matters

Instead of fine-tuning entire massive models, developers can use lightweight, harness-specific LoRA adapters. This delivers lower latency, fewer tool calls, and reduced inference costs without risking reward hacking.

Analysis

AI models behave differently across various agent harnesses due to contrasting system prompts, toolsets, and execution loops. Rather than retraining full models, the harness-hub team trains lightweight LoRA adapters (rank 32 on all linear layers) specialized for each harness environment.

Asynchronous Multi-Adapter Training

Using TRL's AsyncGRPOTrainer with tree attention, training runs asynchronously over GRPO rollouts. The setup achieves notable cost efficiency via vLLM: one base model hosts multiple trainers simultaneously. Each request specifies its own adapter, and checkpoint updates are swapped without stopping running sessions. For evaluations, nine checkpoints were assessed simultaneously in an H200 instance for roughly $5, avoiding the expensive weight-merging overhead that would traditionally cost around $90.

Mitigating Reward Hacking with safeagents

Reinforcement learning frequently suffers from agents taking shortcuts or tampering with grading scripts. To mitigate this, safeagents acts as an intermediary proxy between model and harness. Tool calls attempting reward manipulation are caught by rule-based detectors, aborted, and scored zero, providing feedback that forces the agent to explore valid problem-solving paths. Additionally, an efficiency bonus rewards agents for solving tasks with fewer tool invocations.

Found in

Summary generated by AI (Gemini 3.8 Flash, 25 November 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • Link:ybelkada

    Harness-Hub: LoRA Adapters Tuned for Coding Agent Frameworks

    Harness-Hub provides small LoRA adapters trained with reinforcement learning to specialise open models for specific agent harnesses such as Pi, OpenCode, and Hermes. This enables models to achieve high benchmark scores without reasoning modes while significantly cutting token usage and tool calls. It helps developers run fast, cost-effective coding agents locally or self-hosted.

    AI & LLMs· Tool

  • Video

    Video:CURT

    Harness Adapters: LoRA Fine-Tuning for Coding Agents

    Hugging Face introduced harness-specific LoRA adapters trained via reinforcement learning for individual coding agents. Using Qwen 3.8 27B inside the Pi agent, the approach delivers massive benchmark gains with substantially lower token and step counts. The video demonstrates how training works, how reward hacking is prevented, and where the limits lie.

    AI & LLMs· Demo

  • X post:Mario Zechner

    Harness Adapters: RL Training for Agentic Tasks on LFM2.5, LFM3, and Twil-9B

    Younes announced the live launch of LoRA adapter training for LFM2.5, LFM3, and Twil-9B. By applying reinforcement learning, the models aim to achieve higher accuracy and efficiency in agentic tasks. Mario Zechner highlighted the project.

    92bookmarks9.9kviews

    AI & LLMs· Announcement

  • Link:harness-hub

    Qwen3.8-27B-pi-adapted: Efficient LoRA Adapter for Coding Agents

    A LoRA adapter trained with reinforcement learning optimises Qwen3.8-27B for the pi coding agent across software engineering and terminal tasks. Operating with thinking disabled, it approaches maximum-effort reasoning accuracy while cutting token generation by approximately 4.5×, making local agent execution significantly faster and lighter.

    AI & LLMs· Tool

  • Article:Shuai Shao, Kangning Zhang, Qingyao Li, Shijian Wang, Hao Wang, Wenxiang Jiao, Yuan Lu, Yi Guo, Weiwen Liu, Weinan Zhang

    Harness-R1: Learning to Edit Executable Runtime Harnesses from Agent Failure Trajectories

    Researchers introduce Harness-R1, a framework that trains a dedicated agent to adapt and patch the runtime harness of LLM agents based on failure logs. Using online reinforcement learning, a separate 9B model learns to generate executable patches for context handling, tool mediation, and error recovery to directly improve task completion.

    AI & LLMs· Research

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.