Applied AI Notes · November 2026
What Turns a Model into an Agent
The harness: the code around the model that lets it act, and what to ask of whoever builds it.
What makes a system agentic
A language model on its own produces text. It cannot open a file, send an email or update a record. What it can do, once trained for it, is to write a structured request in place of an answer, naming a tool and the arguments to pass to it. Something else has to read that request, run the tool and hand the result back to the model.
A system becomes agentic when that exchange runs in a loop and the model decides what happens next. In the design process I use with clients, an agent is a model that chooses the next step in a loop, with tools, limits and stopping rules. A fixed workflow, by contrast, sets the path in advance, even when it calls a model at some of its steps. The distinction matters because many requests for an agent describe the second kind of system. Of the projects asking for an “agent” in my November survey of published requirements, 41% describe a fixed workflow, 18% a model choosing its next step, 5% plain code or a single model call, and 36% too little to tell.
The harness is the easy part to explain
The code that runs the loop is called the harness. Claude Code’s documentation defines it as “the layer around the model that provides the tools and manages the context the model sees”, and the slides for lecture 6 of Carnegie Mellon’s course 11-768 write it as a sum: “Harness = prompts + tools + agent loop + context management”. The slides of Harvard’s course CS 2680 put the division of labour in one line: “The model proposes for an action and the harness executes it”.
In the three open-source harnesses I read for this note, the loop takes the same shape, shown below.
The same model in a different harness is therefore a different agent, with other tools, other information and other limits. The Harvard slides give the reason in a phrase of their own: “Model capability sets the ceiling; Harness determines realized performance”.
The anatomy of a harness
I read three harnesses part by part, from their source code, at their commits of 19 November 2026, without installing or running any of them: OpenAI’s Codex, Google’s Gemini CLI, and Pi, a small open-source harness by Mario Zechner. Pi’s agent core comes to about 2,500 lines, and its separate coding-agent package adds about 79,000, while the core packages of Codex and Gemini CLI are each about 150,000 lines, excluding tests. Since the package boundaries differ, these sizes give an order of magnitude rather than a comparison. The basic loop can be sketched in a few lines, and most of the implementation in each harness handles the systems around it.
The figure groups the parts by when they act, and the table sets out what each one does.
| Part | What it does | What a buyer should ask |
|---|---|---|
| Instructions | The standing prompt, plus project instructions loaded at startup or as needed | Where do the rules for this business live, and who can change them? |
| Tools | What the model can ask for: read, search, edit, run, send | Which actions can it take, and which are left out on purpose? |
| Permissions | A policy that allows, asks or refuses before a tool runs | Which actions need a person’s approval? |
| Sandbox | Limits on what a running tool can touch, the network included | If a tool call goes wrong, what can it reach? |
| Context and compaction | What the model sees, and how old history is summarised as it approaches a set limit | What is kept when history is summarised: instructions, approvals, decisions? |
| Output caps | How much of a tool’s result is shown to the model | What happens when a result is too large to show? |
| Limits | What stops a run that does not end on its own | Who or what stops a runaway, and at what cost? |
| Hooks and extensions | Points where the business’s own code can check or block a step | Where can my own checks run? |
| Sub-agents | Further loops started by the first, with limits on how many | Is the work split across agents, and why? |
| Models | Which models it can call | Am I tied to one provider? |
The three agree on the loop and differ on most of the rest, in design choices that a business relying on one of them should know about.
- Enforcement. Codex and Gemini CLI can enforce permissions and a sandbox outside the model. Pi has no built-in approval policy for each call and no operating-system sandbox, so approval checks come from extensions and isolation from a container or a virtual machine.
- Number of tools. Pi exposes four standard coding tools by default and Gemini CLI about twenty-five, although extensions and connected tool servers can change both counts.
- Timing of summaries. Gemini CLI compacts at half the context window by default, while Codex compacts at nine tenths, or earlier when a configured or model-specific limit is lower.
- Runaways. I found no default cap on tool rounds in the main loop of any of the three. Gemini CLI detects repeated loops, Codex has a budget gate, and otherwise it falls to the user to interrupt a runaway run.
Ways to get a harness
Writing it on a model API. In a separate reading of the code of 110 applied agentic projects published with research papers since 2024, the largest group, 45%, had recognisable model-API calls and no detected use of an agent framework. The loop is easy to write, but each of the other parts in the table has to be written, taken from a library or the provider, or gone without. These are research projects, and production code may look different.
Using a workflow framework, such as LangGraph. A framework of this kind gives the work a typed state and a graph of steps and branches. It can express fixed workflows with programmed branches, as well as loops in which the model chooses its next step. Either way, the parts that sit around the model, from approvals to sandboxing, need to be checked against the table rather than assumed.
Building on an existing harness. Codex, Gemini CLI and Pi can each be driven from other programs, through software development kits or a headless mode. A business that does so inherits the harness’s choices on enforcement, tools, compaction and limits, and should read them before relying on them, since all three change often and were each updated on the day I read them.
Provider offerings also include the OpenAI Agents SDK, the Claude Agent SDK and Google’s Agent Development Kit, while some hosted services operate the harness for the business. Each supplies the loop and some of the parts in the table; which permission controls and limits it enforces still needs to be checked in the documentation or with the vendor.
The choice depends on the task. A path that can be written down in advance is a workflow, which a framework or plain code can carry. A task in which the model has to choose its next step needs a harness, and whoever builds it should be able to answer every question in the table.
For more on designing agentic systems, the guide, design process and task-screening worksheet I use in practice are public in my agentic_training repository.
Method and limits
For each harness, one reading agent read the repository without changing it. I checked about twenty of its file and line references by hand, and a model from a different provider reviewed the reading. Claude Code is not included, because its source is not public. “Default” means the default written in the code, not what a running installation was observed to do. The count of 110 projects also comes from a static reading of their code, and its categories are code signatures, not judgements of what each system does.
Use of AI tools
Claude (Anthropic) agents read the repositories and drafted this text under my direction, and a Codex model (OpenAI) reviewed the reading and the draft; I checked the references and the final wording.