What is an agent harness?
On this page
An agent harness is the software wrapped around an AI model that turns it into a working agent. The harness runs the loop, gathers context, offers tools, enforces permissions and asks for approval. Claude Code and Codex are agent harnesses. Harness engineering is the practice of shaping that layer so agents do reliable work, and on an employee's laptop the harness settings decide what the agent can read, run and send.
Key takeaways
- An agent is a model plus a harness: the loop, context, tools, memory, instruction files and permissions.
- Harness engineering moves the engineer's job toward designing the agent's environment, constraints and feedback loops.
- On laptops, harness settings are the first line of control, and each user can often change them.
- Use harness settings to limit what an agent tries, and a central check to decide and record what it does.
The agent harness is everything around the model
A model on its own takes text in and sends text out. It cannot open a file or run a test. The harness is the program that lets it do those things, which is why people often describe an agent as a model plus a harness.
The harness covers everything outside the model: the loop that keeps the work going, the tools, memory, instruction files such as CLAUDE.md, permissions and approval prompts. OpenAI describes its open-source Codex harness as helping models gather context, use tools, operate within configured boundaries and request approval. Anthropic says its Agent SDK gives developers the same tools, agent loop and context management that power Claude Code.
Swap the harness and the same model behaves differently. Examples include coding harnesses such as Claude Code and Codex, SDKs such as the Claude Agent SDK, and hosted services such as Claude Managed Agents, which Anthropic describes as providing the harness and infrastructure for running Claude as an agent.
Harness, framework and runtime are three different layers
Three terms get mixed up. A framework is the code library a developer builds an agent with. The harness is the running program around the model, whether someone built it with a framework or installed it ready-made. The runtime is the environment where that program and its tool calls execute, such as a laptop, a container or a managed cloud service.
Figure 1 as text
- Model: takes text in and sends text out. On its own it cannot open a file or run a test.
- Harness, the program around the model: the loop, tools and memory, instruction files such as CLAUDE.md, permissions, and approval prompts where a person says yes before risky steps. Examples are Claude Code, Codex and the Claude Agent SDK.
- Runtime, where tool calls execute: a laptop (reaches what the employee can reach), a container (reaches what it is given) or a managed cloud service (a hosted sandbox per session).
- A framework is the code library used to build a harness. It shapes the harness at build time and has no layer of its own while the agent runs.
The difference shows up when you decide where to put controls. Settings in the harness travel with the tool. Checks in the agent runtime apply to everything that runs there.
Harness engineering shifts the engineer’s job to the agent’s environment
Harness engineering is the practice of improving that surrounding layer instead of the model. OpenAI used the term in February 2026 for a team that built software mainly through Codex, and wrote that the team's primary job became enabling the agents to do useful work.
In practice that meant designing environments, specifying intent and building feedback loops. The team gave the agent a short map of the repository instead of a long manual, and enforced architecture rules with linters and structural tests. When the agent struggled, the engineers asked which tool, guardrail or document was missing, then added it.
The same idea applies to governance. An agent's behavior depends on its harness as much as its model, so your policy needs a place in the harness.
On a laptop, harness settings are the first line of control
Coding harnesses run on employees' machines, next to their files, credentials and network. The harness settings decide what the agent may touch there. The same goes for personal agents such as OpenClaw that employees install themselves, which is one way shadow AI reaches a work laptop.
Claude Code shows how harness settings work. Its permission rules can allow a tool, ask before using it or deny it, and Claude Code enforces those rules itself, outside the model. Admins can push managed settings that users cannot override, and they can switch off the mode that skips approval prompts.
Lock that switch in managed settings. A developer who turns off approvals to move faster removes the main check on that machine, and the change shows up nowhere else.
Harness settings and a central check do different jobs
Harness settings live on each device and are configured per tool, so they shape what one agent attempts. A central check sits outside the agent. It compares each action with company policy and keeps the record, whichever harness made the call.
Picture a finance analyst who uses a coding agent to tidy a spreadsheet. Their local settings allow any shell command, so the agent uploads the file to a free online converter to fix the formatting. The file holds customer account numbers, and the company learns about it months later in an audit. A central check on what leaves the laptop would have stopped the upload and logged the attempt.
Moring AI's local AI governance is that central check for AI on employee laptops. It compares every prompt with your AI usage policy and blocks secrets before they leave the machine, and its Claude Code governance also masks customer data and records every Claude Code session.
Start by listing which agent harnesses run on your company's laptops, and who sets their permissions today.
Frequently asked questions
What is an agent harness?
An agent harness is the software around an AI model that makes it a working agent. The harness runs the loop, gathers context, offers tools, enforces permissions and asks the user for approval. Claude Code and Codex are examples of agent harnesses. The same model can behave very differently in two harnesses, which is why people describe an agent as a model plus a harness.
Why is it called an agent harness?
A harness is a frame that holds something powerful and directs its effort. An agent harness does that for an AI model: it keeps the model inside a loop, gives it tools and context, and sets limits on what it can do. Without a harness, a model can only return text. With one, the model can read files, run commands and finish tasks.
What is harness engineering?
Harness engineering is the practice of improving an agent's surrounding layer, meaning its environment, tools, constraints, documentation and feedback loops, so the agent does reliable work. OpenAI described the approach in February 2026, writing that its engineers' main job became enabling Codex agents to do useful work. Harness engineering treats each agent mistake as a sign that a tool, rule or document is missing.
What is the difference between an agent harness and an agent framework?
An agent framework is a code library a developer uses to build an agent's loop, prompts and tool definitions. An agent harness is the running program around the model, whether someone built it with a framework or installed it ready-made, like Claude Code. The runtime is a third layer: the environment where the harness and its tool calls execute, such as a laptop or a container.
Is Claude Code an agent harness?
Yes. Claude Code wraps Claude models with an agent loop, tools, context management and permission rules, which makes it an agent harness. Anthropic's Agent SDK gives developers the same tools, agent loop and context management that power Claude Code, so they can build their own harness on top of it.
What can admins control in a coding agent harness?
In Claude Code, admins can set permission rules that allow, ask about or deny each tool, and push managed settings that users cannot override. Admins can also disable the mode that skips permission prompts. Claude Code enforces these rules itself, outside the model, so a confused or manipulated model cannot talk its way past them.
How does Moring AI govern agent harnesses on laptops?
Moring AI governs AI on employee laptops through local AI governance, a central check that sits outside each harness. Local AI governance compares every prompt with your company's AI usage policy and stops secrets before they leave the machine. For developers on Claude Code, the Claude Code governance product adds customer data masking and a record of every session.
Related reading
Sources
- OpenAI, "Harness engineering: leveraging Codex in an agent-first world", 11 February 2026
- OpenAI Developers, "Codex as a platform: build on the open agent harness", accessed 1 December 2026
- Claude Code Docs, "Agent SDK overview", accessed 1 December 2026
- Claude Code Docs, "Configure permissions", accessed 1 December 2026
- Claude Platform Docs, "Claude Managed Agents overview", accessed 1 December 2026