Tech / [20]

AI Agent Harness: Why the Same Model Changes in Each One

The same model scores 23% in one AI agent harness and 52% in another. My take on Hugging Face's multi-harness RL guide and what to do about it.

Hi friends! At the end of September I published my OpenCode, Cline and Command Code benchmark, where the same model cost up to 11.64 times more depending on the AI agent harness wrapped around it. A few days later Hugging Face published a guide that looks at the same problem from the accuracy side, and I read it end to end (it’s long, grab a coffee).

The guide is called The ultimate guide to multi-harness RL. It came out on October 1 and has eight authors, seven from Hugging Face and one from Liquid AI. The thesis: the same model behaves differently in every harness, and you can train it inside the harnesses people really use so it improves in all of them.

1. So what is an AI agent harness?

The harness is the program around the model: Claude Code, Codex, OpenCode, Cline, Cursor. It runs the loop, decides which tools the model gets, builds the context the model reads and decides when to stop. Change the harness and you change what the model sees and what it’s allowed to do.

The guide has numbers that make this very concrete. On SWE-bench Pro, Joel Niklaus (one of the authors) measured GLM-5.2 at 23% in one harness and 52% in another.

There’s an even more direct example. Claude Opus 4.5 scores 45.9% on SWE-bench Pro on Scale’s leaderboard and 55.4% inside Claude Code, with the same weights.

A benchmark without the harness name is half the information.

2. Hold on, let me explain: the driving school student

Think of someone who learned to drive in one car only, the driving school’s. They can drive, but the day they borrow their brother-in-law’s car they’ll turn on the windshield wipers while trying to signal (it happens, lol). Their hand memorized that one dashboard.

Models do the same thing. A model trained inside a single harness learns that harness’s tool names, its argument format, its way of summarizing context. When it moves to another harness, it calls a tool by the old name and the call gets rejected before it ever runs.

The guide cites a case from the Orchard paper that’s hard to forget: OpenSWE-32B, moved from its home harness to Kimi-CLI, lost 58.8 points and fell to 3.6% on SWE-bench Verified, with the same model and the same tasks.

3. What Hugging Face did: train across several harnesses

The idea is to teach the driver in several cars. The big labs already train this way: the guide cites Kimi K3, Qwen3-Coder-Next and Xiaomi’s MiMo-V2.6. What was missing was an open path for anyone to do the same.

They took a small open model, Liquid AI’s LFM2.5-2.6B, and trained it with reinforcement learning (RL) inside four real harnesses: OpenCode, Claude Code, Codex and Mini-SWE-Agent. None of them was modified.

The technical trick is a proxy that sits between the harness and the model. Every call goes through it, and it records the exact tokens and the probability of each one, which is what training needs.

Then they compared it with the same model trained in OpenCode alone. The tasks are data analysis, taken from Kaggle notebooks: 1,000 for training and 250 for testing, each one run under all four harnesses.

Same model, accuracy in each harness

LFM2.5-2.6B on 250 held-out tasks, % of tasks solved (pass@1). Higher is better.

Base modelTrained in OpenCode onlyTrained in all four

OpenCode

Base model33.6%
Trained in OpenCode only58.0%
Trained in all four49.6%

Claude Code

Base model33.2%
Trained in OpenCode only42.0%
Trained in all four48.8%

Codex

Base model40.0%
Trained in OpenCode only43.2%
Trained in all four53.6%

Mini-SWE-Agent

Base model62.1%
Trained in OpenCode only66.0%
Trained in all four64.8%

Average of the four harnesses

Base model42.2%
Trained in OpenCode only52.3%
Trained in all four54.2%
First-attempt accuracy at training step 1,000, with each task run once under each harness. Source: Hugging Face multi-harness RL guide (the article’s data file).

Averaged over the four, the base model solved 42.2%. Trained in OpenCode alone it went to 52.3%, and trained in all four it went to 54.2%. Look at the shape of the chart: the model trained only in OpenCode got great at OpenCode (from 33.6% to 58%) and gained much less in the others. The model trained in all four gained in all four.

4. The detail I liked most: fewer tool calls

The team also rewarded efficiency. A correct answer is worth 1, a wrong one is worth 0, and a correct answer with fewer tool calls earns a small bonus of at most 0.1.

It sounds small, but they explain why it’s there. In an earlier run, with another model and no bonus, calls per task crept from 13 to 41. In another, a 0.2 reward “for submitting anything” taught the model to submit right away: test accuracy dropped from 0.740 to 0.178 while the training reward still looked healthy (the model did exactly what it was paid to do :P).

Tool calls per task

Average per test task under each harness. Lower is better.

Base modelTrained in OpenCode onlyTrained in all four

OpenCode

Base model6.53
Trained in OpenCode only5.00
Trained in all four4.64

Claude Code

Base model8.86
Trained in OpenCode only8.61
Trained in all four6.32

Codex

Base model10.40
Trained in OpenCode only7.83
Trained in all four4.78

Mini-SWE-Agent

Base model9.69
Trained in OpenCode only9.26
Trained in all four7.89

Average of the four harnesses

Base model8.87
Trained in OpenCode only7.67
Trained in all four5.91
Measured at training step 1,000. On the tasks the base model also solved, the model trained in all four harnesses used 31% fewer calls. Source: Hugging Face multi-harness RL guide (the article’s data file).

In the end, the model trained in all four harnesses made 31% fewer calls than the base model on the tasks both solved. Under Codex it dropped to about half.

This connects straight to what I measured. In my benchmark, each harness’s bill depended on how much context it sends every turn and how much of that hits the cache. Fewer calls means less history resent, and less history means fewer tokens on the invoice. Getting it right and spending little can be trained together.

5. Where I stay a little skeptical

I liked this work a lot, but it needs a careful read. These are small models (2 to 2.6 billion parameters), a single task family and a single run of each setup. The gap between training in one harness and training in four was 1.9 points overall, and the authors themselves say that’s within the noise.

Another point: in OpenCode, the specialist beat the generalist (58% against 49.6%). If you only use one harness, training in that one still gives the best result there. And the two runs didn’t see the same amount of data: 162 million tokens processed in one, 451 million in the other.

What gives me confidence is that all of this is written in the guide itself, and that they published the models, the data and the code.

6. What I take from this for day-to-day work

You don’t need to train any model to get something out of this read.

When someone shows you a model benchmark, ask which harness it was measured in. And test the model in the harness you use, because a score from another one may not hold for yours.

For anyone running a small open model, there’s one more: it’s reproducible. Each training run used two H100 GPUs, and the trained models are on Hugging Face.

Before you pick the model, look at the harness!

7. Frequently asked questions

What is an AI agent harness?

It’s the program around the model that turns it into an agent: it runs the loop, hands over the tools, builds the context and decides when to stop. Claude Code, Codex, OpenCode and Cline are harnesses.

What is multi-harness RL?

It’s training a model with reinforcement learning inside several harnesses at once, so it doesn’t get hooked on the habits of a single one.

What is harness engineering?

It’s the work of designing the harness: which tools the model gets, how the context is built and summarized, when the agent retries and when it stops. In a study cited in the guide, swapping the harness moved GLM-5.1’s score by 13 points, and swapping the model inside the same harness moved it by 2.5 to 5.

Do I need to train a model to benefit from this?

No. If you only use agents, the lesson is to test the model inside the harness you use and to be wary of any score that doesn’t name the harness.

A good model is one that drives well in the car you have.

Cheers,
Fellipe Soares

Leave a Reply

Your email address will not be published. Required fields are marked *