What Is an Agent Harness?

markgavalda1 pts0 comments

What is an Agent Harness? | Rubric Labs

What is an Agent Harness?<br>The software that makes an LLM agentic<br>By Ted Spare, Dexter Storey, and Sarim Malik<br>August 10, 2026·Analysis

Table of Contents<br>Chevron iconLooping<br>Context<br>Compaction<br>Memory<br>Orchestration<br>Planning<br>Dispatch<br>Tools<br>Execution<br>Interfaces<br>Verification<br>Permissions<br>What's next for harnesses?

A harness is the software that translates a model into a system that can affect its environment .

For example, Pi is a harness that lets the model use your terminal to read and edit files on your computer.

Functionally, a harness makes a model agentic, meaning it can take action.

Put simply:

Agent = Model + Harness

The components of an agent harnessA circular agent reveals a model at its center. The model then fades, leaving a harness divided into looping, context, orchestration, tools, verification, and permissions.ModelAgentHarnessLoopingContextOrchestrationToolsVerificationPermissions<br>div_button]:hover:!bg-black/5 [&>div_button]:hover:!text-primary dark:[&>div_button]:hover:!bg-white/10 relative flex w-full items-center justify-between gap-3 py-1.5">Play iconPlay animationRestart iconRestart animation

The components of an agent harness[ 1 ]<br>Copy<br>A few of the harnesses we'll discuss in this post include Claude Code, Codex, Cursor, OpenClaw, Hermes and Pi. They generally share the same underlying functional areas.

Looping

At a minimum, a harness collects LLM calls in a loop (even ChatGPT has a harness). A common looping architecture is ReAct (Reason + Act) , where a user sends a message and the agent thinks, searches, writes code, and responds when it's done.

A model and harness completing an instruction loopThe model thinks and produces an instruction. The harness executes the instruction and returns the result to the model.Model<br>div_button]:hover:!bg-black/5 [&>div_button]:hover:!text-primary dark:[&>div_button]:hover:!bg-white/10 relative flex w-full items-center justify-between gap-3 py-1.5">Play iconPlay animationRestart iconRestart animation

The harness executes the model's instructions and returns the resultCopy<br>Modern harnesses go much further: they let agents work for a long time, learn from experience, and delegate work.

Context

Every time the agent loops, the harness passes context to the inference endpoint. Context is all the information the model can see to decide what to do next. A common pattern is to include:

a fixed system prompt (which describes the agent's role)

some current information (today's date, preferences, available tools)

the past messages (user messages, tool calls, tool outputs and agent messages) in chronological order

Keeping much of the prompt fixed offers cost benefits via prompt caching.

LLMs have finite context windows (a maximum amount of information they can process at a time) and an agent that loops enough will often fill up this window. So we have to choose which parts of the total context to keep.

A model context window filling across multiple turnsEach result returned to the model adds information until its context window fills. A fourth input is then blocked.Model0%<br>div_button]:hover:!bg-black/5 [&>div_button]:hover:!text-primary dark:[&>div_button]:hover:!bg-white/10 relative flex w-full items-center justify-between gap-3 py-1.5 !pointer-events-auto !opacity-100">Play iconPlay animationRestart iconRestart animation

The context window fills until the model cannot accept another inputCopy<br>Harnesses largely use two strategies that address different parts of the problem: compaction and memory.

Compaction

Harnesses largely deal with context limits within a single run using a compaction strategy, where they ask an LLM to summarize historic information, and then remove it from the window.

A model compacting several context payloads into one summaryThree execution loops stack payloads inside an initially empty model while its context rises from zero to full. The three payloads travel to a funnel-shaped compactor, which returns one same-sized summary and reduces the context to 30 percent.Model0%Model<br>div_button]:hover:!bg-black/5 [&>div_button]:hover:!text-primary dark:[&>div_button]:hover:!bg-white/10 relative flex w-full items-center justify-between gap-3 py-1.5 !pointer-events-auto !opacity-100">Play iconPlay animationRestart iconRestart animation

Good compaction can be the difference between stunted and outstanding performance.Copy<br>When a session ends, its compacted context is generally discarded.

What if we want an agent to learn over time and across sessions?

Memory

Humans actually have a few types of memory, such as procedural (how to), episodic (what happened), and tacit (intuition) .

Most harnesses today collapse memory into procedural vs. everything else .

A common way to store procedural memory is in skills . Skills are folders that include markdown text describing a workflow, and optionally scripts that aid that workflow. Encoding your IP into high quality, opinionated skills is a...

model harness context agent div_button hover

Related Articles