An agent harness is the underlying architecture that transforms a large language model (LLM) into an autonomous agent. It encompasses everything outside the model itself — often expressed as Agent = Model + Harness. The harness provides the orchestration loop, tool integration, memory systems, context management, feedforward guides, feedback sensors, and other components needed for an LLM to interact with the world, execute multi-step tasks, and maintain state over time. Companies such as Anthropic, OpenAI, Perplexity, and LangChain each develop their own harness designs. For coding agents specifically, the harness includes a built‑in portion (system prompt, code retrieval, orchestration) and an outer harness that users build to improve correctness and enable self‑correction before human review.
Key Points
The agent harness is the structural layer that turns a static LLM into an active, goal‑driven agent. It is everything except the model.
Major AI firms and frameworks (Anthropic, OpenAI, Perplexity, LangChain) are each developing their own harness designs.
Core components include the orchestration loop, tools, memory, context management, feedforward guides, and feedback sensors.
The harness defines how the agent perceives its environment, decides on actions, and learns from outcomes.
For coding agents, an outer harness (feedforward guides + feedback sensors) aims to increase first‑attempt correctness and provide self‑correction before human review, reducing review toil and saving tokens.
Building a coherent harness is expensive but directs human input where it matters most.
Concepts
Orchestration Loop – The iterative cycle in which the agent observes, reasons, acts, and repeats until a task is complete.
Tools – External capabilities (APIs, code executors, search engines) the agent can invoke to gather information or effect change.
Memory – Mechanisms for storing and recalling past interactions, whether short‑term (conversation context) or long‑term (persistent knowledge).
Context Management – Strategies for deciding what information to keep in the LLM’s limited prompt window, often involving summarization, retrieval, or sliding windows.
Outer Harness – User‑defined feedforward guides and feedback sensors that shape agent behavior for a specific use case, augmenting the built‑in harness.
Feedforward Guides – Controls applied before agent action to steer it toward correct outputs. Subtypes: inferential (principles, rules, reference documentation) and computational (language servers, CLIs, scripts, codemods).
Feedback Sensors – Controls that detect errors or drift after agent action, enabling self‑correction. Subtypes: inferential (review agents) and computational (static analysis, logs, browser).
Human Implicit Harness – The skills, experience, conventions, and contextual awareness that human developers bring, which coding agents lack and the outer harness attempts to externalize.
Harness Coherence – The challenge of keeping feedforward and feedback controls consistent and non‑contradictory as the harness grows.
Details
The term “agent harness” emerged as industry shorthand for the infrastructure needed to move beyond simple prompt‑response LLMs. While exact implementation varies, every harness addresses the same fundamental challenge: giving an LLM the ability to plan, use tools, remember past steps, and manage its own context.
Orchestration Loop – The harness repeatedly feeds the agent’s observations and internal state back into the model, allowing it to decide on the next action. This loop continues until a stopping condition (e.g., task completion, error, or user interrupt).
Tools – The harness exposes a curated set of functions the agent can call. These tools are the agent’s interface to the outside world — from simple calculator calls to complex database queries.
Memory – Without memory, an agent forgets every prior turn. Harnesses implement both working memory (the current conversation or task) and persistent memory (stored facts, embeddings, or logs) to enable coherent, multi‑session behavior.
Context Management – LLMs have fixed context windows. The harness must decide which pieces of history, instructions, and tool outputs stay in the prompt, often using techniques like sliding windows, summarization, or retrieval‑augmented generation (RAG).
For coding agents specifically, the outer harness is built by users to augment the built‑in harness (system prompt, code retrieval, orchestration). Its two primary goals are to increase the likelihood that the agent gets it right the first time (feedforward) and to provide a feedback loop for self‑correction before human review (feedback). This reduces review toil, improves system quality, and saves tokens.
The structure of the outer harness consists of feedforward guides and feedback sensors, each with inferential and computational subtypes:
Feedforward guides: Inferential guides include principles, change review requests, rules, reference documentation, and how‑tos. Computational guides include language servers (LSPs), CLI tools, scripts, and codemods.
Feedback sensors: Inferential sensors include review agents (human or automated). Computational sensors include static analysis, logs, and browser (e.g., visual testing).
A human steers both types of controls.
Rendering diagram…
Human developers bring an implicit harness formed from skills, experience, conventions, organizational alignment, awareness of tolerated technical debt, and a slow, thoughtful pace. Coding agents lack social accountability, aesthetic sense, contextual intuition, and organizational memory — they cannot distinguish load‑bearing conventions from mere habit or judge fit with team goals. The outer harness attempts to externalize what human experience provides, but building a coherent system is expensive. The goal is not to eliminate human input but to direct it where it matters most.
The sources referenced offer distinct takes: Anthropic’s “agent harness” concepts appear in their agent‑focused research and tools; OpenAI’s function calling and assistants API form a harness; Perplexity’s search‑centric agents; LangChain’s composable framework for building custom harnesses. Industry examples of outer harness components include:
OpenAI team documented a harness with layered architecture enforced by custom linters and structural tests, plus recurring “garbage collection” scanning for drift with agent‑suggested fixes. Their conclusion: “Our most difficult challenges now center on designing environments, feedback loops, and control systems.”
Stripe’s minions use pre‑push hooks that run relevant linters based on a heuristic, emphasize shifting feedback left, and use “blueprints” that integrate feedback sensors into agent workflows.
Mutation and structural testing — computational feedback sensors — are experiencing a resurgence.
Increased integration of LSPs and code intelligence in coding agents (computational feedforward guides).
Thoughtworks teams tackle architecture drift with both computational and inferential sensors (e.g., API quality via agents + custom linters; code quality via a “janitor army”).
Open questions remain:
How to keep a harness coherent as it grows, ensuring guides and sensors are in sync and not contradictory?
How far to trust agents to make sensible trade‑offs when instructions and feedback signals conflict?
If sensors never fire, is that high quality or inadequate detection?
There is a need to evaluate harness coverage and quality akin to code coverage and mutation testing.
Feedforward and feedback controls are scattered across delivery steps; tooling that helps configure, sync, and reason about them as a system holds real potential.
Building this outer harness is emerging as an ongoing engineering practice, not a one‑time configuration.