What is an agent harness?
An agent harness is every part of an AI agent except the model. LangChain writes it as a formula: agent = model + harness (LangChain, March 10, 2026). The model writes text. The harness turns that text into work on files, databases and repositories.
What an agent harness is in simple words
A language model alone can only answer. It cannot open a file or run a test. The harness is the program around the model that can. It sends the task to the model and reads the answer. It runs the tool the model asked for and returns the result. This loop repeats until the task is done.
A harness has a system prompt, tools and MCP servers, a sandbox, the loop and hooks. A hook is code that checks a step of the agent. Coding agents such as Claude and Codex come with a harness.
The model and the harness
| Question | The model | The harness |
|---|---|---|
| Where it comes from | An AI lab trains it | The maker of the agent ships it, and a team extends it |
| What it does | Writes text and asks for tool calls | Runs the tool calls and returns the results |
| What it sees | The context of the current session | The files, rules and tools of the project |
| How a rule holds | It follows a written rule most of the time | A hook blocks a forbidden call in code |
What harness engineering is
Harness engineering is the work of fitting a harness to one codebase and one team. Birgitta Böckeler of Thoughtworks sorts its controls into guides and sensors. Guides steer an agent before it acts. Sensors check its work afterwards (martinfowler.com, April 2, 2026).
An agent framework is a different thing. A framework is a library for writing an agent in code. A harness is the running setup around a model.
Context engineering and vibe coding
Context engineering is the work on what the model sees. Anthropic defines it as the strategies for curating the tokens a model gets during inference (Anthropic, September 29, 2025). Prompt engineering covers the written instructions. Context engineering also covers tools, external data and the message history. The harness is where this work takes effect, because the harness builds the context.
Vibe coding is software development in which a developer describes a task in natural language and a model generates the code. Andrej Karpathy coined the term in February 2025. Vibe coding can mean accepting generated code without a thorough review (Wikipedia). A harness with checks is the opposite approach. The agent writes the code, and hooks and a review decide what reaches production.
What I have built in this field
I am an IT expert for data platforms, and coding agents speed up my work. I help a client rebuild its platform with Claude and Codex under a harness. The project has more than 300 RESTful API endpoints and more than 8,000 commits. Several agent sessions and the human team work on one repository at the same time.
A coding agent follows a written rule most of the time. That is too little for production. On the client’s platform AI agents work under the same rules as humans. The database role of an agent reads and cannot write. Its credentials cannot push to the production branch. A production change needs the confirmation of a person, given outside the chat.
A hook reads a tool call before it runs and blocks what a rule forbids. Such a hook has a test matrix of allowed and forbidden calls, because developers switch off a check that blocks valid work. Claude, Codex and Gemini read their rules from one source file through imports.
I take on agent harness engineering for software teams in Germany, as a freelancer or as a permanent employee. As a Claude consultant for companies in Germany I set Claude up for the developers of a team and write the rules for the code it generates.
Searches this page answers
- what is an agent harness
- what is an agent harness in ai
- what is an ai agent harness
- what is agent harness in simple words
- coding agent harness meaning
- harness engineering
- what is harness engineering in ai agents
- what is harness engineering in simple terms
- what is context engineering
- what is vibe coding