# Agent harness (the runtime scaffold around an agent)

> VI: https://5ac.vn/wiki/agent-harness/ · EN: https://5ac.vn/en/wiki/agent-harness/ · lang: en · spec_as_of 2026-10-21 (spec no formal spec) · cluster C8

The layer that turns a model into an agent: tool calls, context management, sandboxed execution, output checking. Benchmark scores move with the scaffold, not only the model.

---
## Definition

An agent harness is the software layer around a language model that turns it into an agent: it takes a goal, decides which tools to call, manages context across hundreds of loop iterations, executes commands inside a sandboxed environment, and checks output before declaring a task done. It is not the model and not the prompt — remove the model from a coding-agent product and what remains is the harness. Its components each have their own entries — [coding agent](/en/wiki/coding-agent/), [sandbox](/en/wiki/sandbox/), [agent memory](/en/wiki/agent-memory/), [terminal](/en/wiki/terminal/) — while this entry covers the scaffold as a whole.

## Mechanism

A minimum harness does four jobs: assemble context at the top of each turn, define the tool interface, provide an execution environment, and run a verification step on the output. The measurable consequence is that scores move with the scaffold. 5ac's numbers on the DeepSeek line: vendor-published DeepSWE 74.2; the same build scored 65.6 inside the Codex harness and 65.5 inside OpenCode; the October 1017 rebuild re-scored 77.0 on the Mini-SWE-V2 harness. Same model family, a swing of nearly nine points, caused by scaffold and build. The "three species of agents" piece adds the cost angle: the harness changes cost per task by more than 2x while output quality stays the same.

## Application context

Two practical rules. When reading a leaderboard, ask which harness and which build produced the score — numbers are comparable only inside one scaffold. When choosing an agent for your team, you are choosing model and harness together, and it is the harness that touches your data, permissions and bill. Y Combinator open-sourcing QM, its internal multi-agent harness, backs the 5ac position: each company needs its own agent harness, open source and self-hosted. The harness is a company asset; the model is a swappable component.

## Sources fetched

- [Chinese Flash Models for Agent Harnesses: Benchmarks and Prices Compared](/en/blog/chinese-flash-models-agent-harness-comparison/) — the 63.4 to 74.2 DeepSWE swing, 65.6 Codex / 65.5 OpenCode, 77.0 on Mini-SWE-V2 — accessed 2026-10-21
- [YC Open-Sources QM — A Multi-Agent Harness](/en/blog/yc-qm-open-source-multi-agent-harness/) — QM as an open-source company harness — accessed 2026-10-21
- [Codex, Pi, Hermes — Three Species of AI Agents, Not Three Rivals](/en/blog/three-species-of-ai-agents-codex-pi-hermes/) — the harness doubles per-task cost with quality held — accessed 2026-10-21

## Related

- [Coding agent](/en/wiki/coding-agent/)
- [Sandbox](/en/wiki/sandbox/)
- [Agent memory](/en/wiki/agent-memory/)
- [Terminal](/en/wiki/terminal/)
- [llms.txt](/en/wiki/llms-txt/)
- [Sub-agent](/en/wiki/sub-agent/)
