What is an AI harness? The simple explanation
An AI harness is everything that surrounds a language model to make it useful: the interface, the instructions given to it, and the software that acts on its behalf. Claude Code, Codex, and Cursor are examples.
For the past year, this word has been circulating whenever coding agents or AI assistants are mentioned in the workplace: the harness (harness (in English). We read that such and such a tool has "a better harness," that such and such a developer is doing "harness engineering." The term sounds technical. Yet the idea is simple, and it explains something that many users observe without understanding why: the same AI model can be brilliant in one tool and disappointing in another.
An image to begin with: the horse and the carriage
A horse is powerful, but without a harness it pulls nothing. The harness is what connects its strength to the carriage and makes it useful.
The AI harness plays exactly this role. The language model is the horse: raw power. The harness is everything that attaches to this model to transform this power into concrete work: reading a file, launching a calculation, modifying a document, chaining several steps together.
Three floors to be clearly distinguished
To understand the harness, it must be situated in relation to the other two levels of an AI tool.
1. The model: the engine
The model is Claude Opus, GPT, Gemini, Mistral Large or Qwen. Concretely, it is a huge file that contains billions of numbers (the "parameters"), adjusted during training to predict the most probable word following a text.
Key point: this file is inertOn its own, it does nothing. And even when you make it spin, it can only produce one thing: text.
2. The inference server: the machine room
The software runs the model. It loads it onto graphics processors, gives it your text, calculates the next word, then the next, until the end of the answer.
He has a second, less well-known but very important mission: sort and standardize The model writes what it says. In the resulting text, it distinguishes between internal reasoning, the response intended for the user, and any requests to use a tool. Then it organizes everything into a common computer format.
Why is this useful? Each lab (Mistral, Qwen, DeepSeek, etc.) has its own way of tagging what its model writes. The inference server reduces these dozens of dialects to a handful of standard formats (OpenAI's, Anthropic's, Google's). Anything that connects to it afterward can then communicate with any model without knowing its specific characteristics.
Examples: vLLM, Ollama, llama.cpp, LM Studio, or the proprietary servers of Anthropic and OpenAI that run behind their APIs.
3. The harness: everything that makes the model useful
The harness connects to the inference server. This is what you see and work with. Claude Code, Codex, Cursor, OpenCode, and Pi are all examples of harnesses.
| Étage | What it is | Examples |
|---|---|---|
| Model | The billions of parameters that predict the next word | Claude Opus, GPT, Gemini, Mistral, Qwen |
| Inference Server | The software that runs the model, sorts its output and puts it into standard format | vLLM, Ollama, llama.cpp, Anthropic or OpenAI servers |
| Harness | The interface, the added context, and the software that acts | Claude Code, Codex, Cursor, OpenCode, Pi |
What a harness actually does
A harness combines three things.
An interface. The chat window, the terminal, the panel in your editor. Without it, you would have to communicate with the model by exchanging technical files. The model, however, is completely unaware of this interface.
Text added before your question. Even before reading your request, the model receives a series of elements prepared by the harness:
- general instructions, often stored in files like AGENTS.md or CLAUDE.md (who you are, the response language, the project rules);
- the list of available tools and how to use them (read a file, write, modify, launch a command);
- a brief description of the skills (skills) which it can charge as needed;
- depending on the harnesses, the work file, the date or the status of the project.
The entire text is read by the model. This is what is called...context engineering.
Software that works. This is the part that the model doesn't see, but that makes all the difference:
- actually perform the actions requested by the model and send the result back to it;
- check permissions before each action (the famous choice between "ask every time" and "automatic mode");
- summarize the conversation when it becomes too long, in order to start again on a lighter note;
- load a skill when the model needs it;
- deploy sub-agents and take over their work;
- cut off overly large results, correct errors so that the model can correct itself;
- resume a previous session.
A step-by-step example
Imagine you ask in your tool: "How many lines does the clients.csv file contain?"
- The harness prepares the ground. He places his instructions, the list of tools, and the location of your file in front of the model.
- You ask the question. It reaches the model via the inference server.
- The model thinks and writes a request. He understands that he doesn't know the answer and writes, in the form of markup text, something like: "run the command that counts the lines of clients.csv". He doesn't execute anything: he only knows how to write.
- The inference server detects this request in the text and transmits it properly to the harness.
- The harness is working. He checks that he has the right, executes the command and gets "1249".
- The result is pasted back into the conversation. The template resumes its wording: "The file contains 1,249 lines, i.e., 1,248 clients plus the header line."
What is most surprising is that the conversation mixes two types of text: a part generated by the model, another simply stuck via the harness. The model never "touched" the file. It requested it, the harness did so, and then the model read the result as if it were part of the discussion.
And what about the officer in all of this?
Un AI agentIt is simply the assembly of three layers: a model, its inference server, and a harness.
In everyday language, we often say "the Claude Code agent." Technically, Claude Code is the harness, and the agent is Claude Code associated with a Claude model. This approximation is inconsequential, but it highlights one point: the components are partially interchangeable. Some harnesses, like OpenCode or Pi, can work with an Anthropic model today and an open-source model installed locally tomorrow.
As for the word "AI" on its own, depending on the context it refers to one or the other of these levels: the model alone, the model and its server, or the complete agent.
Why it's useful to understand it
To understand the discrepancies in results. Two tools can use the same model and produce very different results. The available tools, the provided context, and the way the steps are linked often matter as much as the model itself. This is also true for assistants integrated into office suites: Microsoft 365 Copilot, for example, relies on models from OpenAI and Anthropic, and what distinguishes it from a general-purpose chat application is the layer that Microsoft builds around it (access to your emails and documents, respect for access rights, actions within applications).
To know where to take action. You can't modify a model, but you can significantly influence the harness: write a good instruction file, choose which skills to activate, and adjust permissions. This is within the reach of a business user, without any data science expertise.
To compare the solutions. When faced with a new tool, the right question is not only "which model?", but also "which harness, with which tools and which rules?".
For safety. The harness permissions determine whether the AI can read, write, delete, or send something. This is where a significant part of risk management takes place.
In Summary
- Le model is the engine: it only predicts text.
- Le inference server It runs it, sorts what it writes and puts it into a standard format.
- Le harness provides the interface, the context, and the software that actually does the work.
- The agent is the union of the three.
Remembering this distinction is enough to read AI news with a sharper eye, and to better choose and configure your own tools.
source: What is an AI harness?, Thomas Bourgeois (cours-socrate.ai)which further details the technical operation of the inference server.
To learn more: our comparison Claude Code or Codex: which coding agent to choose in 2026? puts two harnesses facing each other.
