Skip to content

harness

A harness is the software around a language model that decides what the model sees, carries out the actions it asks for, and checks with a person when needed. On its own, a model only reads text and writes a reply. The harness supplies everything else. It assembles the context for each request, runs tool calls such as reading files or executing commands, feeds the results back, and enforces permissions.

Try acting as the harness yourself and decide which of the model’s requests to carry out, which to check with the human, and which to refuse:

Interactive diagram — enable JavaScript to view.

A model and its harness together form an agent, and the harness drives the agent loop that repeats these steps until a task is done. Coding tools such as Claude Code and Cursor are harnesses. The same model can behave quite differently in two harnesses because each one controls the context, tools, and safeguards the model gets.

The word isn’t fully standardized. Some writers use it for a whole product, and in classic machine learning an evaluation harness is a test suite for measuring models.

A person holding up a 9/10 score card beside an evaluation machine with gauges, a Python logo, a 1-10 rating scale, and bins of documents sorted into Pass and Fail.

Tutorial

LLM Evaluation in Python: Build an Eval Harness From Scratch

Build an LLM evaluation harness in Python that scores model outputs with code-based checks and an LLM judge you calibrate against human labels.

intermediate ai

For additional information on related topics, take a look at the following resources:

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Sarah Jane Ross • Updated Nov. 30, 2026