I wanted to explore more about how a coding harness actually ran an agentic loop - in particular, how the underlying large language model (Claude Sonnet, GPT Sol 6.1, etc.) got the harness to do things.
This topic is something I’m quite interested in - I built an open source behavior-driven code generation/editing tool named ZapCircle in 2025, and it quickly got eclipsed by the state of the art in coding harnesses. Part of what changed is that large language models got much better at getting code right on the first attempt. They also got much better at editing or creating entire groups of code files all at once to keep them consistent.
Plenty of coding harnesses are open source, and you can inspect them. But what if we actually took a look at the large language models instead, and saw how they want to drive an agentic loop?
Modern (as of 2026) LLMs have been specifically trained to make tool calls when they want to achieve a goal. Tools are various functions that are provided to the LLM by the harness - some examples might be:
- read_file
- write_file
- read_directory_listing
- run_command
- run_python
- search_text_in_files / grep
Think some basic combination of file I/O, search, and command execution.
The interesting thing is that the LLM doesn’t actually have these specific calls built in - the harness provides them as a list. Using the OpenAI Playground, we can simulate being a harness or coding agent and talk directly to an OpenAI large language model in a friendly user interface. We can also customize the system prompt, and inspect the model’s reasoning summary.
On July 1, 2026, I gave a talk at the Austin AI Middleware Users Group (AIMUG) that demoed this from the beginning to the end using an LLM and a set of tool definitions.
Understanding the model vs the harness
The model knows which tools are available from the harness - they get included in the context. Typically this would be at the beginning of the conversation. The way the tools get described is different between harnesses - some include just the name and arguments, some might include a short description. The model can respond with a tool-call request. It doesn’t execute the tool itself; the harness receives structured output containing the tool name and arguments.
The harness is responsible for interpreting the tool call out of the model’s response. Before actually executing the tool request, the harness may make sure the tool request is authorized - for instance, some tools might require the end user’s permission, or the user might have granted permission to all similar requests. The harness may also run a lightweight model to determine if the request is risky or dangerous. In other cases, the model may be asking to modify or read a file outside of its guardrails, and the request is rejected by the harness - in this case, the model will be informed that the tool call was blocked.
If the tool call is allowed, it’s the harness’s responsibility to execute the tool call and to provide the outputs back to the model for continued work on the task.
decides the next steptool callHarness
checks permission, runs the toolexecuteTools
read_file · write_file · run_tests
Watch the talk
The demo uses a security review task to show tool use, then implements the same kind of agent with LangChain in Python. These are useful places to jump in:
- 4:35 — Defining the tools
- 9:30 — Non-deterministic tool calls
- 11:31 — Explaining the loop
- 12:33 — The same agent in LangChain
- 16:44 — Checking the patch
Chapter times and demo details come from the AIMUG talk page.
Specialization and tools
In the demo, I provided a specific role for the model by customizing the system prompt to explain that the model was an application security engineer. I also provided a set of tools that might be useful for cybersecurity:
| Tool | Operation exposed to the model |
|---|---|
read_file |
Read a file’s contents |
write_file |
Write changes to a file |
list_directory |
Inspect the files in a directory |
run_tests |
Run checks on the code |
run_in_sandbox |
Execute code in a sandbox |
display_message |
Show a message |
post_results_to_slack |
Report results to Slack |
Just because a tool gets provided to the model doesn’t mean that the model has to use it, of course.
Anatomy of the agentic loop
During the talk, I supplied the tool response as text. There wasn’t a harness involved, I just pretended to be one.
How would this work in practice for another task?
Consider a task such as fixing a failing test. One possible sequence is:
- The model requests the relevant test file.
- The harness reads it and returns the contents.
- The model requests the implementation source file, and the harness returns its contents.
- The model requests an edit through a tool.
- The harness applies the edit and returns the result.
- The model requests a test run, and the harness runs the test.
- The model receives the test output and either makes another change or reports the result.
Things don’t always have to be this linear. The model can use its own approaches to solving the problem, which means that the steps might go in a different order, or there might be an error that has to be solved.
Another thing to consider is that the harness itself might limit the run through a turn limit or token budget.
From one agent to multiple agents
This only takes a look at one harness, running one model. If several agents run at the same time, their actions can affect or interfere with each other. There are differing levels of coordination and workflows to explore once agents start to work in parallel.
For more on that, visit What is agent concurrency? for an introduction to that coordination problem.
Source material
The system prompt, tool names, and manual loop walkthrough are from slides 5–7 of my July 1, 2026 AIMUG deck, Harnesses, Tools, and Models. The recording and timestamp links above provide the companion demonstration.