KRIT HUB

Agent = Model + Harness: Why Your LLM Needs Scaffolding


If you strip an AI agent down to its core, you are left with a simple equation: Agent = Model + Harness.

Everyone has access to the same frontier models today. When the intelligence layer becomes commoditized, the model itself ceases to be your competitive advantage. The differentiator is the system you build around it.

That system is the harness, and designing it has become one of the most critical roles in modern software development.

What is an AI Harness Engineer?

A harness engineer builds the structural layer that wraps around an AI model. A raw LLM is just a stateless text predictor—it has no memory, no hands, and no concept of whether its output actually works.

The harness provides the agency. It consists of the execution loop, context delivery systems, tool interfaces, and verification gates.

As Mitchell Hashimoto recently framed it, harness engineering requires a fundamental mindset shift: When an agent makes a mistake, you don’t just tell it to do better next time. You change the system so that specific mistake becomes structurally harder to repeat.

Why Does the Harness Matter More Than the Model?

If you swap a good model for a great one, you might get a 10% bump in capability. If you add a proper harness, an agent goes from a flaky demo to something you can trust on its 100th execution.

According to experiments by LangChain, harnesses consistently beat models. An agent’s success drops drastically when its context window is flooded with irrelevant data or when it gets stuck in a “doom loop” trying the same broken solution ten times in a row.

A strong harness solves these failure modes by:

  • Preventing Context Collapse: Incrementally loading only the documentation the agent needs right now, rather than dumping an entire codebase into the prompt.
  • Enforcing Reliability: Using deterministic rails to prevent an agent from marking a task as “done” until it actually passes a test.
  • Providing Agency: Giving the model a safe, constrained environment to execute bash commands, read filesystems, or interact with APIs.

How Harness Engineering Works in Practice

Harness engineers don’t write prompts; they build infrastructure. A typical production harness operates across a few distinct layers.

Here is a basic example of how a harness configuration might look, intentionally routing through an aggregator to manage model fallbacks:

{
  "harness_config": {
    "provider": "openrouter",
    "model": "anthropic/claude-3.5-sonnet",
    "max_retries": 3,
    "eval_framework": "playwright",
    "mcp_servers": ["filesystem", "bash"]
  }
}

1. Tooling and The Model Context Protocol (MCP)

An agent without tools can only talk. Harness engineers wire up standard interfaces—increasingly using the Model Context Protocol (MCP)—to give the model secure hands. Instead of hardcoding a custom tool for every possible action, the harness provisions a sandboxed environment where the agent can search directories, read logs, or execute scripts autonomously.

2. Orchestration and Routing

Single-prompt systems hit a ceiling quickly. A harness manages the Planner-Generator-Evaluator loop. It determines which agent handles a task, spawns parallel sub-agents for independent work, and routes complex reasoning to heavier models while keeping simple tasks on faster, cheaper models.

3. Verification Gates and Evals

This is where the harness keeps the model honest. Before an agent can commit code or return a final answer, the harness runs it through a gauntlet. This could mean running deterministic BDD tests via Playwright, checking types, or utilizing an evaluation harness (like DeepEval) to score the output against a golden dataset. If the test fails, the harness catches the error and feeds the exact trace back to the agent to fix it.

What Skills Are Required?

You don’t need a PhD in machine learning to be a harness engineer. In fact, standard software engineering skills are far more relevant.

  • Systems Architecture: You need to know how to design durable state, manage memory, and build reliable API integrations using languages like TypeScript, Golang, or Python.
  • Testing Rigor: A deep understanding of CI/CD, automated testing, and deterministic validation is mandatory. If you can’t write a strict test, your agent won’t know when it succeeds.
  • Orchestration Frameworks: Familiarity with the mechanics of frameworks like LangChain or CrewAI, understanding how they manage agent loops under the hood.

The models will keep getting smarter, but they will always need a reliable environment to operate inside. The engineers who master the harness are the ones who will actually make AI work in production.


References & Further Reading