# Agentic harness

An agentic harness is the software environment that turns a language model into a working agent: the loop, tools, context management and safety rails around the model. Claude Code, Codex and OpenHands are harnesses.

An agentic harness (often just "the harness") is the software environment that turns a raw [language model](https://www.wikiprompt.org/wiki/large-language-model) into a working agent: the loop that feeds the model context, executes its [tool calls](https://www.wikiprompt.org/wiki/tool-use), returns results, and repeats until a task is done. The term became central to AI engineering in 2025-2026 as it became clear that a large share of an agent's real-world capability comes not from the model alone but from the quality of the harness around it - the same model can look mediocre or exceptional depending on the harness it runs in.

## What a harness provides

- **The agent loop.** Prompt the model, parse its action, execute it, append the result to context, repeat. Termination conditions, retries and error handling live here.
- **Tools.** File editing, shell execution, browsing, code running, search - exposed through [function calling](https://www.wikiprompt.org/wiki/function-calling) or protocols like the [Model Context Protocol](https://www.wikiprompt.org/wiki/model-context-protocol).
- **Context management.** What the model sees each turn: system prompts, [context engineering](https://www.wikiprompt.org/wiki/context-engineering), summarization or compaction when the [context window](https://www.wikiprompt.org/wiki/context-window) fills, and memory across sessions.
- **Sub-agents and orchestration.** Spawning [sub-agents](https://www.wikiprompt.org/wiki/subagent) for parallel or specialized work, and merging their results - the substrate for [multi-agent systems](https://www.wikiprompt.org/wiki/multi-agent-system) and patterns like the [gauntlet loop](https://www.wikiprompt.org/wiki/gauntlet-loop).
- **Safety rails.** Permissions, sandboxing, human-approval gates and audit logs; the 2026 OpenAI-Hugging Face incident (see [2026-openai-agent-cyberattacks](https://www.wikiprompt.org/wiki/2026-openai-agent-cyberattacks)) made harness-level isolation a first-order safety topic.

## Examples

Coding harnesses are the most visible: [Claude Code](https://www.wikiprompt.org/wiki/claude-code), OpenAI's Codex CLI, Cursor's agent mode, and open-source projects such as OpenHands and Aider. Evaluation harnesses (the scaffolds used to run benchmarks like SWE-bench) are the same idea applied to measurement, which is why benchmark results are often reported "with harness X": scores move with the harness, not just the model.

## Why the term matters

"Harness" separates two layers that used to be conflated: model capability (weights) and agent capability (weights + environment). Model announcements increasingly cite harness-dependent results, prompt patterns are written FOR a harness (the gauntlet loop explicitly requires one), and labs tune models to their own harnesses - Anthropic's Claude models and Claude Code being the canonical pairing. The related term agent scaffolding is sometimes used interchangeably, though scaffolding usually refers to the prompt-and-workflow structure while harness refers to the full runtime.

## See also

- [Agentic AI](https://www.wikiprompt.org/wiki/agentic-ai)
- [Tool use](https://www.wikiprompt.org/wiki/tool-use)
- [Claude Code](https://www.wikiprompt.org/wiki/claude-code)
- [Model Context Protocol](https://www.wikiprompt.org/wiki/model-context-protocol)

---
Source: https://www.wikiprompt.org/wiki/agentic-harness
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-14T03:52:34.937512+00:00
