An agent harness is the software layer around an LLM that enables it to act as an agent. It assembles prompts and context, exposes and executes tools, maintains memory and execution state, and decides how results return to the model. section 1.2.3 section 1.7
The model performs reasoning and generation; the harness connects it to resources such as files, databases, browsers, command-line interfaces, and APIs. Together they support an iterative loop of reasoning, acting, and observing rather than a single prompt-response exchange. section 1.2.3
A function-calling cycle shows how the harness manages the boundary between model reasoning and tool execution:
- Assemble the user prompt, system instructions, active state, and tool definitions for the model. section 4.2
- Receive a structured tool call containing a call identifier, function name, and typed arguments; validate and execute the requested function. section 4.2
- Append the call and its output to the message history, matched by identifier, and call the model again to generate a response grounded in the result. section 4.2
Figure 4.2 Function calling workflow: tool definitions and the user prompt enter the context window, a first model call returns a tool call, the tool executor runs it, and a second model call turns the tool output into the final answer
The workflow traces context assembly, tool execution, and the second model call. section 4.2
Call identifiers let the harness correlate requests and responses, including parallel tool calls within a turn. Each tool interaction requires at least two model calls and expands the active context, so long loops can quickly consume context-window capacity. section 4.2



