# Agent Harness

> The code around a model. It runs the loop, the tools and the rules.

**Field:** Artificial Intelligence  
**Category:** AI Agents  
**Also known as:** Agent Runtime, Agent Scaffold, Agent Framework

## Think of it like

Think of it like the car around an engine. The engine gives power, and the car gives it wheels and brakes.

## Definition

An agent harness is the software around a language model that turns it into a working agent. It runs the agent loop, hands the model its tools and runs each tool call. It also picks what goes into the context window, keeps memory and checks the rules. One model can act in very different ways in two harnesses. Coding agents and chat apps with tools each have their own.

## Example

Jack tries one model in two coding tools. In one it finishes the task, and in the other it gets lost. The model is the same, and the harness is not.

## Why it matters

Much of what makes an agent good or bad lives in the harness, not the model.

## Common mistake

Blaming the model for every failure. Often the harness gave it the wrong tools or too little context.

## Three principles

- **Wraps the model.** Loop, tools, memory.
- **Sets the limits.** Permissions live here.
- **Shapes results.** Same model, new harness.

## Related terms

- [Agent Loop](https://learn.benibix.com/term/ai/agent-loop)
- [Tool Use (Function Calling)](https://learn.benibix.com/term/ai/tool-use)
- [Agent Permissions](https://learn.benibix.com/term/ai/agent-permissions)
- [Context Engineering](https://learn.benibix.com/term/ai/context-engineering)

![A language model in the middle, wrapped in a frame. The frame holds the loop, the tools, the memory and the permissions.](https://learn.benibix.com/diagrams/ag-agent-harness.svg)

---

Source: https://learn.benibix.com/term/ai/agent-harness
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
