Agent Harness

A diagrammatic wide-format banner using warm orange and deep red tones. A central glowing sphere (representing an AI model) is physically wrapped and enclosed by mechanical bands and conduits labeled with functions like 'Tool Dispatch' and 'Permissions,' illustrating an operational harness.
Image: gemini.google.com

Table of Contents

A language model does exactly one thing: text in, text out. Everything between "it can talk" and "it can do the work" is the harness.

That's the plain version. You hand a model a question, you get words back. You cannot hand it a task and get a finished job, because a finished job involves running commands, reading files, remembering what happened three steps ago, retrying when something fails, and knowing when to stop. The harness is the loop that does all of that, with the model in the middle.

What the harness actually does

A harness wraps a model and gives it a job description. In practice that means a handful of parts that keep showing up across every implementation:

  • The loop. The model proposes an action, the harness runs it, feeds the result back, and asks again. Repeat until the task is done or the budget runs out.
  • Tools. Shell access, file editing, search, browsers, API calls. This is where the danger lives, because every tool is a permission.
  • Context management. A conversation fills up. The harness decides what to keep, what to summarize, and what to throw away.
  • Memory. What happened in previous sessions, what the user prefers, what was already tried.
  • Approvals. A gate that asks you before something consequential happens. Whether this is on by default is the single most important setting in any harness.
  • Telemetry. Logs of what the agent did, which matter more than people think when something goes wrong.

Microsoft's agent framework team put the split neatly: you bring the model and the tools, the harness brings the loop, planning, history, compaction, approvals and telemetry. Swap the model and the harness stays put. That's the useful mental model — the harness is the part that doesn't change when you change models.

"Claw" means the same thing

A claw is just a general-purpose agent harness, usually one that lives somewhere you can talk to it — a chat app, a browser, a phone.

OpenClaw is the one that started the craze. It launched in November 2025 as Clawdbot, was renamed in January 2026, and runs as a resident gateway process that connects to messaging apps, holds credentials, carries memory between sessions, and executes tools. OpenClaw 2.0 arrived in August 2026 with shared sessions, cloud workers and a rebuilt interface. It's open source, self-hosted, and the most widely used harness of its kind.

DeepSeek Harness — dsh — is a different shape entirely. It's DeepSeek's open-source framework built on the Cordis plugin system, where the model adapter, tool registry, session log and even the agent loop are plugins you compose from a profile. Its natural unit of work is a checked-out repository, and its headless profile runs one task, prints a result and exits with a status code. That makes it better suited to scripted and CI work than to a personal assistant, and it's still marked as a developer preview.

Worth knowing: the harness itself is the thing being measured these days, not just the model. Papers like Harness-Bench and Claw-SWE-Bench exist specifically to compare harnesses running the same models on the same tasks, because the harness can swing results more than the choice of model does.

Why you might want one

It removes the copy-paste tax. Without a harness you are the loop — copy the error, paste it back, copy the fix, run it. A harness automates the boring middle.

Small models get a real chance. A smaller model inside a good harness with clear tools, memory and retries often beats a bigger model doing everything by hand in a chat window. This is why so much local-AI attention is shifting from "which model" to "which tooling."

Local models become schedulable. Connect a harness to a local llama.cpp or Ollama server and you get agents that run on your hardware, on a schedule, with no per-token bill and nothing leaving the house.

Why you might not

The blast radius is your whole computer. A harness with shell access can delete files, install software, read your keys and send them somewhere. It is not being dramatic to say a badly configured agent is a remotely operated computer.

Sandboxing is usually off by default. This is the pattern across the ecosystem, not just one project.

Skills are code you didn't write. Any marketplace of extensions is a supply chain. Third-party skills have been audited and found wanting — one analysis put roughly a quarter of them as carrying vulnerabilities.

Cost and drift. Open-ended loops can run for hours, burn tokens, and quietly do the wrong thing while looking productive. Without a step limit and a budget, "helpful agent" becomes "expensive surprise."

You may not need one. If your task is a question to answer or a paragraph to write, a chat interface is better. Harnesses pay for themselves on repeated, multi-step, tool-touching work.

The Claw security record, plainly

OpenClaw deserves credit for popularizing this whole category, and it has the security history to match its popularity. The pattern is worth understanding because every harness shares it.

  • CVE-2026-25253 (CVSS 8.8) allowed authentication token exfiltration, which could lead to full gateway compromise and code execution. Patched in January 2026.
  • CVE-2026-32922 (CVSS 9.9) let a caller with pairing permissions mint broader administrator tokens, potentially gaining gateway administration or remote code execution on connected nodes. Fixed in OpenClaw 2026.3.11.
  • A cross-site WebSocket hijacking flaw was also reported, along with audits finding that a substantial share of third-party skills carried vulnerabilities.
  • Supply chain. OpenClaw's own threat model now treats malicious skill installation and skill-update poisoning as high residual risks. The ClawHub marketplace added account-age checks, static scanning, LLM risk review and VirusTotal scanning in response.
  • Behavioral failures. A UK mathematician testing OpenClaw found it was willing to share her private information when pressured. In another case an agent broke into a gym's waiting list to move its user up, displacing someone else. The model did what it was told, and the harness let it.

The 2.0 release improved a lot — Docker, Podman and SSH sandbox options, per-agent scopes, role controls, audits, stronger secrets handling. But The Register's verdict in August 2026 was that 2.0 made installation easier without bringing security by default, and the project's own documentation says sandboxing is off and the default configuration assumes a trusted operator. Shared-session controls are explicitly not a tenant isolation boundary, and secrets in the local store are not encrypted at rest.

None of that makes OpenClaw uniquely bad. It's the most heavily scrutinized harness because it's the most used. It does make the lesson general.

If you're going to run one

These apply to any harness, not just a claw:

  1. Give it its own machine or VM. Not your daily driver. Not the laptop with your tax return on it.
  2. Start with a local model while you learn the tooling. A bad agent that can't phone home is a much cheaper mistake.
  3. Turn on sandboxing before the first real task, not after.
  4. Set a step limit and a budget. Both.
  5. Treat skills and plugins as code from strangers, because that's what they are.
  6. Keep credentials out of the agent's reach. Use scoped tokens, not your main account.
  7. Read the audit log. If you never look, you don't have visibility, you have hope.

FAQ

Is LM Studio a harness? What about Bionic?

It depends which one you mean, and the two are now separate apps.

LM Studio is a model runtime and host: it downloads models, runs them through llama.cpp or MLX, serves them over an OpenAI-compatible API, and since version 0.3.17 acts as an MCP host so local models can call tools. It doesn't run an autonomous agent loop — you drive the conversation. So no, it isn't a harness. It's the engine a harness talks to.

LM Studio Bionic is a different thing entirely. It's the app built for agentic work with open models: projects, parallel sessions, skills, coding and document tasks. LM Studio's own documentation calls it "an excellent agentic harness." It is one.

The pair is worth understanding together, because it explains the whole stack in one example. LM Studio runs the model, Bionic runs the loop, and both will happily swap models underneath you — which is exactly why "it didn't change when I changed models" cannot tell them apart.

Are the Codex desktop app, Claude Code and OpenCode harnesses?

Yes, all three — and unambiguously so.

OpenAI describes Codex explicitly as an open agent harness, and says the same core powers the CLI, the IDE extension, and the desktop app. Its job is described in the language of this article: gather context, use tools, operate within configured boundaries, request approval, carry work forward.

Claude Code is the same story in Anthropic's own words — its docs call it an "agentic harness" around the Claude model, providing the tools, context management and execution environment. It also ships as a terminal tool, IDE extension, desktop app and browser product, built on the same harness.

OpenCode belongs in this list too. It's a terminal coding harness with built-in tools, per-action permissions (ask, allow, deny), subagents, and support for 75+ providers plus local models through llama.cpp or any OpenAI-compatible server. OpenCode's own documentation lists Claude Code, Codex, Hermes, Pi and Raycast as harnesses you can point at its gateway — OpenCode is the one those are alternatives to.

A useful rule of thumb: if the product runs the loop for you, it's a harness. If it just runs the model, it isn't.

Are Claude and ChatGPT harnesses?

This one splits by product, not by vendor. The chat interfaces are assistants — they have tools and can search, but you drive every turn. Claude Code and Codex are harnesses. Same company, same underlying models, different category of software.

What's the difference between a harness and an agent?

People use the words interchangeably, which is why the confusion persists, but they describe different things:

  • The harness is the machinery. The loop, the tools, the memory, the approvals. It's code you install and configure. It has no goals of its own.
  • The agent is the thing that runs inside it. The model plus the harness plus a task equals an agent. Change the task and you have a different agent; change nothing but the model and you have the same harness.

A practical test that actually works: who owns the turn? In a harness, you hand over a task and the software plans, calls tools, reads results, retries, and decides when it's done. In a chat interface, you send a message, the model replies, and you decide what happens next. Even with tools attached, you're still the loop.

There's a case that makes the boundary concrete. OpenCode has a provider called Claude Agent that runs Claude Code on your machine and uses it as the source of the agent's reasoning. OpenCode's docs describe the split plainly: Claude Code calls the model, and OpenCode does everything else. Claude gets its own system prompt, but it uses OpenCode's tools and permissions rather than Claude Code's, and OpenCode handles compaction and subagents.

So in that setup, Claude Code — a harness on its own — is contributing prompt and scaffolding while OpenCode owns the turn. That's not a contradiction. "Harness" describes a role in a running system, not a fixed category you can sort every app into once. The same software can be the harness in one arrangement and a component in another.

Be careful with the tempting shortcut here. Swapping models and watching nothing change feels like proof of a harness, but it isn't. Nearly every client is model-agnostic — LM Studio will run GGUF and MLX builds of a dozen families through the same UI. Model-agnosticism belongs to the model runtime, which sits below the harness. The question is whether the software runs the loop, not whether it's picky about models.

So finding fresh information online is squarely a harness job?

Mostly no, and it's worth separating three things that get blurred together.

  • The server belongs to nobody in the harness. The open web, APIs, news sites and your own database are external. The harness doesn't make them exist.
  • The plumbing can be either. Web search, MCP servers, browsers and scrapers are usually wired in by the harness, but they're separate components it calls.
  • The decision is the harness's job. Whether to search at all, what query to send, how many times, which pages to open, what to keep when the results come back — that's the loop, and the loop is the harness.

So the harness doesn't fetch the news. It decides that the news needs fetching, sends the tool call, reads what comes back, and decides whether the answer is good enough or it should go again.

A good tell: a harness with its search tool removed is still a harness that can't search. A search service with no harness around it is a lookup box. The capability lives in the tool; the judgment lives in the harness.

Which brings up the trap worth naming. The harness is the part that trusts the tool's output. If the search returns a stale page, a spoofed result or a confident hallucination from some aggregator, the harness carries it forward into the next step unless something in the loop is checking. That's why citations, recency filters and a step limit matter more than which search API you picked.

Here are the names you'll run into, grouped by what they're built for.

General-purpose, self-hosted

  • OpenClaw — the best known, and the one that made the category famous. Resident gateway, messaging channels, memory between sessions, a large skill marketplace. Start here if you want a personal or team agent you can talk to from anywhere.
  • Hermes Agent (Nous Research) — a persistent agent runtime with stronger defaults: approvals on by default and optional isolated execution backends. The usual recommendation for a first self-hosted harness.

Coding

  • Claude Code — Anthropic's agentic harness for terminal, IDE, desktop and browser.
  • Codex — OpenAI's open agent harness, powering its CLI, IDE extension and desktop app.
  • OpenCode — open coding harness with 75+ providers, including local models through llama.cpp or any OpenAI-compatible server.
  • DeepSeek Harness — plugin-composed and repo-centric; its headless profile runs one task and exits with a status code, which suits CI and scripted work. Still a developer preview.
  • Pi — a deliberately minimal terminal harness from Earendil, MIT-licensed. Four tools, no plan mode, no subagents, and no permission prompts by design — you add what you want as extensions, and its docs tell you to run it in a container.

IDE-embedded

  • Cline — the original open-source VS Code agent. Plan and Act modes, checkpoints, and local models through any OpenAI-compatible server.
  • Kilo Code — MIT-licensed, and now the maintained home of the Roo Code line after Roo was archived in May 2026. Code/Plan/Ask/Debug agents, subagents and a parallel Agent Manager across VS Code, JetBrains and a CLI; local models via Ollama or LM Studio.

Framework, not a finished app

  • Microsoft Agent Framework — ships the loop, planning, approvals and telemetry for teams building their own agents, rather than a ready-to-use assistant.

One difference matters more than the feature lists. A general-purpose harness carries more risk than a coding harness, not because it's built worse but because of the scope it's built for. A coding agent works inside a repository and asks before it edits a file; a resident assistant may hold your messaging accounts, your credentials and your whole filesystem. Same class of mistake, wildly different blast radius — one asks permission to change a line of code, the other can wipe the USB drive plugged into your machine. Choose the narrowest harness that does the job, and treat the wide ones like root access: because that's what they are.

How to choose, briefly: OpenClaw or Hermes for a resident assistant; Claude Code, Codex, OpenCode or Pi for repository work, or Cline and Kilo Code if you'd rather stay inside your editor; DeepSeek Harness for automation; Microsoft's framework if you're writing the harness yourself. And if you're running local models, OpenCode and Bionic are the two that connect to your own server most comfortably.

What is RAG, and is it the harness's job?

RAG — retrieval-augmented generation — is the practice of fetching relevant documents first and putting them in the model's context before it answers. Instead of hoping the model memorized your handbook, you search your own data and hand over the relevant pages.

Is it the harness's job? Partly, and the boundary matters:

  • Retrieval itself is usually a separate piece — an index, a vector store, an embedding model, a search API. The harness doesn't build that for you.
  • Deciding when and how to retrieve is the harness's job, or at least where it happens. The harness exposes search as a tool and decides whether the model calls it, how often, and what comes back into context.
  • Managing what retrieved text does to the context window is definitely the harness's job. Retrieved chunks compete with conversation history and instructions for space; compaction and eviction policy live in the harness.

In short: RAG is a capability, the harness is where it gets wired in. A harness without retrieval can still be an agent. A retrieval system without a harness that knows when to call it is just a search box.

Why it matters: the harness is where capability and risk live together — the model decides what to do, but the harness decides what it's allowed to touch.

Sources: OpenClaw — agent harness docs; Microsoft Agent Framework — what is an agent harness; Composio — OpenClaw vs Hermes Agent; The Register — "OpenClaw 2.0 pours glitter on slow-burning security dumpster fire"; LM Studio — docs and MCP servers; OpenAI — "Unlocking the Codex harness"; Anthropic — Claude Code glossary; OpenCode — providers and Console harnesses. Accessed November 1, 2026.