An AI harness, also called an agent harness, is the software around an AI model that turns it into a working agent: the loop that runs it, the tools it can use, the memory it reads, the rules it follows and the checks on its work. The model supplies reasoning, and the harness supplies everything else.
How an AI harness works
A harness wraps the model in a loop. The model decides what to do next, the harness carries out that action, and the result goes back to the model as new information for its next decision. The cycle repeats until the task is done or the harness stops it.
Around that loop, the harness handles what a model can't do by itself. It runs tools and code, saves files and notes so work survives between sessions, decides what goes into the model's limited context window, and enforces permissions and rules. LangChain's definition is the simplest one going: "If you're not the model, you're the harness." Claude Code and OpenAI's Codex CLI are well-known examples.
Why an AI harness matters for business
The same model can perform very differently depending on the harness around it. LangChain reported moving its coding agent from the top 30 into the top 5 on the Terminal Bench 2.0 leaderboard by changing only the harness, with the model left as it was.
The harness is also the part of an AI system that lasts. Businesses usually rent the model, and it gets replaced every few months. The harness holds the business rules, data connections and checks, so it keeps working when a better model is swapped in. At Custom AI Studio, that harness is code the client owns.