SENS ADVISOR

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 agent loop: the model proposes, the harness executes The model either replies or asks for a tool. A tool request goes to the harness, which checks permission, runs the tool if allowed inside the sandbox and caps the output, then adds the result to the conversation and calls the model again. Controls vary by tool, harness and configuration. The loop normally ends when the model replies without asking for a tool; a budget, loop detection or user interruption may stop it earlier. Normally ends: a reply that asks for no tool Model proposes a step HARNESS · EXECUTES AND ENFORCES tool request 1Check permission allow, ask or refuse 2Run if allowed inside the sandbox 3Cap the output trim what is too large result added to the conversation; the model is called again May stop earlier: a budget, loop detection or user interruption.
Simplified loop drawn from Codex, Gemini CLI and Pi. Controls vary by tool, harness and configuration; Pi needs extensions for approvals and external isolation for sandboxing.

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.

The parts of a harness, by when they act Before each model call, the harness supplies the instructions, the list of tools offered, and the context, compacted when it grows too long. On each tool request it applies permissions, hooks, the sandbox and output caps. Across the whole run it applies limits, starts sub-agents and selects the models it calls. These are typical points of use; hooks and compaction can also act elsewhere. BEFORE EACH MODEL CALL Instructions Tools offered Context and compaction Model chooses the next step ON EACH TOOL REQUEST Permissions Hooks Sandbox Output caps before the tool runs, while it runs, and on its result ACROSS THE RUN Limits Sub-agents Models
The ten parts, grouped by typical points of use. Hooks and compaction can also act elsewhere. Each is described in the table below.
PartWhat it doesWhat a buyer should ask
InstructionsThe standing prompt, plus project instructions loaded at startup or as neededWhere do the rules for this business live, and who can change them?
ToolsWhat the model can ask for: read, search, edit, run, sendWhich actions can it take, and which are left out on purpose?
PermissionsA policy that allows, asks or refuses before a tool runsWhich actions need a person’s approval?
SandboxLimits on what a running tool can touch, the network includedIf a tool call goes wrong, what can it reach?
Context and compactionWhat the model sees, and how old history is summarised as it approaches a set limitWhat is kept when history is summarised: instructions, approvals, decisions?
Output capsHow much of a tool’s result is shown to the modelWhat happens when a result is too large to show?
LimitsWhat stops a run that does not end on its ownWho or what stops a runaway, and at what cost?
Hooks and extensionsPoints where the business’s own code can check or block a stepWhere can my own checks run?
Sub-agentsFurther loops started by the first, with limits on how manyIs the work split across agents, and why?
ModelsWhich models it can callAm 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.

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.