---
title: 'Agent harness'
description: 'The software layer that surrounds a model with instructions, context assembly, tools, state, permissions, control flow, budgets, verification, observability, and recovery.'
canonical_url: 'https://darkfactory.dev/glossary/agent-harness'
markdown_url: 'https://darkfactory.dev/glossary/agent-harness.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Agent harness


## Definition

An agent harness is the software layer that turns a model into an operating system for work. It assembles instructions and context, exposes tools, stores state, controls permissions and flow, enforces budgets, records traces, checks results, and decides how a run should recover or stop.

Viv Trivedy introduced the related phrase "harness engineering" in LangChain's *The Anatomy of an Agent Harness*, using the compact formulation "Agent = Model + Harness." The terminology is recent, but the underlying components draw from older workflow, distributed-systems, security, and operations practice.

Harness design can change behavior as much as the model choice. The same model can produce different results when its tools, context policy, retry logic, environment, or feedback signals change. This is why a model benchmark does not, by itself, predict the quality of a deployed agent.

## Distinguish it from nearby terms

The model supplies learned capabilities. The harness determines how those capabilities meet a real environment. A scaffold is often a lighter set of prompts and tools; a harness includes the runtime controls and lifecycle around them. Orchestration coordinates work across one or more harnessed runs.

## Check your understanding

Two coding agents use the same model, but one can run tests, inspect repository rules, and recover from failed edits while the other only emits code. Calling them equivalent because the model matches ignores the harness.

## Also called

harness, agent runtime

## Related terms

- [Recursive self-improvement (RSI)](https://darkfactory.dev/glossary/recursive-self-improvement)
- [Token budget](https://darkfactory.dev/glossary/token-budget)
- [Token burn](https://darkfactory.dev/glossary/token-burn)
- [Token efficiency](https://darkfactory.dev/glossary/token-efficiency)
- [Token maxing](https://darkfactory.dev/glossary/token-maxing)
- [Token minning](https://darkfactory.dev/glossary/token-minning)
- [Token spin](https://darkfactory.dev/glossary/token-spin)

## Related factory areas

- [Architecture & technical strategy](https://darkfactory.dev/factory/architecture-strategy)
- [Orchestration, state, concurrency & recovery](https://darkfactory.dev/factory/orchestration-state)

## Evidence and further reading

- [The Anatomy of an Agent Harness](https://www.langchain.com/blog/the-anatomy-of-an-agent-harness)
- [Harness Engineering as Categorical Architecture](https://arxiv.org/abs/2605.12239)
- [Same Signal, Different Semantics](https://arxiv.org/abs/2605.18332)
- [The Harness Effect: How Orchestration Design Sets the Token Economics of Enterprise Agentic AI](https://arxiv.org/abs/2607.06906)
