🔧 Harness Adapters: Small add-ons teach coding agents to use their tools
In brief
- 🔌 Hugging Face trains small model adapters for pi, OpenCode and Hermes agent environments.
- 🛡️ Tasks have executable checks, while a safety proxy blocks forbidden tool calls.
- 🧪 Held-out smoke tests show fewer tool calls with similar or improved task success.
💻 A model can write code yet waste time using its tools. Hugging Face demonstrates small adapters trained for specific coding-agent environments. They share the same underlying model while specializing how it works inside pi, OpenCode or Hermes. The reported benefit is completing test tasks with fewer tool calls.
🧰 A coding agent works inside software that exposes files, terminal commands and other tools. This environment, often called a harness, shapes how the model approaches a task. Experience with one environment does not automatically transfer to another.
🔗 Harness Adapters use LoRA: a relatively small set of trainable weights added to a shared base model. The team trains a separate adapter for each model-and-harness combination. Its experiments use unmodified pi, OpenCode and Hermes environments.
🎯 Training starts with tasks whose outcome can be checked. Repo2RLEnv turns public coding trajectories into repair, question-answering, build and feature-extension tasks with verifiers. Another collection, SmolDataEnvs, broadens the training mix. Some tasks are held back to check whether the agent learned more than its training cases.
🚧 The reward also needs protection. A proxy called safeagents examines tool calls against explicit rules. An attempt to manipulate the evaluation is blocked and receives zero reward. The agent gets an explanation of the violation so that training can favor an acceptable solution.
📊 The experiments use GRPO reinforcement learning and small adapters with several models, including LFM2.5-24B-A2B and LFM3-1.7B. In the published held-out smoke tests, adapted agents use fewer tool calls while retaining or improving completion rates, depending on the model. Those tests describe the examined tasks and harnesses rather than every software-development workload.
🔁 A shared serving system can keep the base weights loaded and expose several named adapters. Switching an agent’s specialization then avoids reloading the whole model. This is useful when many sessions share a model but work in different environments. The release includes the approach, task-generation tools and safety proxy. Teams adopting it need verifiable tasks and tool rules that reflect their own projects.