Agent Harness
An agent harness is the software around a language model that turns it into a working agent: the prompts, tools, context handling, control loop and checks the agent actually runs with. It runs the loop of model calls, executes the tools the model asks for, feeds the results back and decides when a task is finished. Along the way it manages the context window, for example by trimming or summarising history, keeps state such as progress notes or files between sessions, enforces permissions on what the agent may do and records a trace of each step. The same model can perform very differently in two different harnesses, which is why the term comes up most around coding agents and long-running agents. It is also called agent scaffolding, and it is a different thing from an eval harness, which runs test cases against a model or agent.
The line between framework, runtime and harness is blurry. LangChain splits it into a framework that supplies building blocks, a runtime underneath that handles durable execution and persistence, and a harness as the opinionated layer an agent ships with, such as Claude Code. Birgitta Böckeler, writing on martinfowler.com, separates the inner harness a vendor ships from the outer harness a team adds on top: instruction files, skills, MCP servers and checks. LangChain reported that changing only the harness, with the model fixed, raised its coding agent on Terminal Bench 2.0 from 52.8% to 66.5%. Long-running work shows why the layer matters, because a task that needs more than one context window only succeeds if the harness leaves the next session a usable trail, such as a progress file and version-control commits.
Related terms
Related services: AI agent development company, Agentic AI consulting.
Ready to put agentic AI to work?
Book a free 30-minute consultation. We'll map one real process worth automating with production-grade AI.