AI Briefing
KO

The Structure of Agent Harnesses

·2026.03.11 11:41

Key point

An agent Harness is the system infrastructure around a model, providing filesystem, tools, memory, and orchestration.

1 / 2

Details

Agent = Model + Harness. Everything that is not the model is the Harness. A raw model only takes text in and outputs text, but the Harness provides state, tool execution, feedback loops, and constraints, turning it into an agent that actually performs work.

The Harness includes:

  • System prompts, tools, skills, MCP servers
  • Bundled infrastructure (filesystem, sandbox, browser)
  • Orchestration logic (subagent spawning, handoffs, model routing)
  • Hooks/middleware (compaction, continuation, lint checks)

The core components are derived backward from the desired agent behavior:

Filesystem: The model can only work with knowledge inside the context window. The Harness provides filesystem abstractions and tools so the agent can read data, save intermediate results, and persist work across sessions. Git adds version control, enabling rollbacks and branch experimentation.

Bash + Code Execution: Predefined tools alone cannot enable autonomous problem-solving. Bash and code execution are general-purpose tools that let the agent create needed tools on the fly as code. This is a major step forward in "giving the model a computer."

Sandbox: Running agent-generated code locally is risky. The sandbox provides a safe, isolated execution environment that can be created, expanded, or destroyed as needed. Basic tools — language runtimes, git, testing tools, browsers — are pre-installed, forming a self-verification loop where the agent writes, runs, and validates code.

Memory & Search: The model has no knowledge beyond its weights and current context. The Harness injects memory files like AGENTS.md into context to preserve knowledge across sessions (continual learning). MCP tools like Web Search and Context7 provide access to information beyond the knowledge cutoff.

Countering Context Rot: Model performance degrades as the context window fills up. The Harness is the delivery mechanism for context engineering. Compaction summarizes and offloads existing content when context fills up, allowing work to continue. Tool call offloading keeps only the head/tail of large tool outputs while storing the full output in the filesystem. Skills use progressive disclosure to prevent too many tools from loading at startup.

Long-horizon Autonomous Execution: Completing complex tasks autonomously and accurately requires planning, observation, and verification. The Ralph Loop pattern intercepts the model's attempts to terminate and re-injects the original prompt into a clean context, forcing the task to continue. The filesystem tracks state across sessions. Planning decomposes goals into steps, and self-verification checks correctness after each step, creating feedback signals.

The Future: Products like Claude Code and Codex post-train the model and Harness together. Useful primitives get added to the Harness, forming a feedback loop that is used when training the next generation of models. This makes the model more proficient at a specific Harness, but it can also cause overfitting. A case in point is the performance drop when Codex-5.3's apply_patch tool logic was changed. On Terminal Bench 2.0, Opus 4.6's scores vary significantly across different Harnesses.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.