AI Agent Harness

This post appeared first in my notes: AI Agent Harness.

An AI agent harness is a tool or environment that wraps an AI model and exposes it as an interactive agent; giving it access to tools (file system, shell, browser, APIs, messaging), a conversation loop, and context about its operating environment. The harness handles the orchestration; routing tool calls, managing context windows, streaming output, persisting state, applying permission profiles.

Most early harnesses were coding-focused (Claude Code, Codex CLI, Aider), but the category now spans coding, personal-assistant, and managed-cloud variants. Hermes Agent and OpenClaw are personal-assistant harnesses with messaging gateways and skill learning loops; Codex Cloud and Claude Managed Agents are managed-cloud variants where the agent runs server-side. The pattern is the same, but their orientation is not.

The simplest way I know to explain it comes from Isuru Wijesiri's book Harness Engineering 101: "The LLM is the brain. The harness is the body." A model API is stateless. On every turn, you send the whole conversation as a JSON array and you get text back. The harness is the program that builds, maintains and protects that array. Tools, memory, subagents, compaction, permissions: each one is a patch on that loop, added because something broke. More in Harness Engineering.

You can also build your own. Toolkits like the Pi SDK, Mastra Harness and the OpenAI Agents SDK give you the agent loop as a library, so routing, permissions and checks live in your code instead of in a vendor's defaults. I explain why you'd want that in Harness Engineering.

The term distinguishes the harness (the scaffolding around the model) from the model itself. The same harness can often work with multiple models; the same model can be driven by multiple harnesses. Although it's not a given. I've tried using Claude Code at work against different models (e.g., GPT 5.4) and it was a disaster ;-)

Common capabilities

  • Read/write files and execute shell commands
  • Search codebases (grep, AST, LSP)
  • Run tests and linters
  • Browser/web access
  • Model Context Protocol (MCP) tool integration
  • Git operations (commits, PRs, diffs)
  • Multi-agent coordination (subagents, parallel workers)
  • Persistent memory and context files (e.g., CLAUDE.md, AGENTS.md)

Harnesses I've taken notes about

The detailed map is at AI Agent Harnesses (MoC).

References


About Sébastien

Ready to get to the next level?

Found this valuable? Share it with someone who needs it.

Join 6,000+ readers. Get practical systems for knowledge & AI. Free.

Subscribe ✨

Free: Knowledge System Checklist

A clear roadmap to building your own knowledge system. Subscribe and get it straight to your inbox.

6,000+ readers. No spam. Unsubscribe anytime.

Subscribe