> ## Content Index
> Fetch the complete content index at: https://stalin-pereira.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# The Harness Is the New Model: Why AI Agents Live or Die by Their Scaffolding
- URL: https://stalin-pereira.com/the-harness-is-the-new-model-why-ai-agents-live-or-die-by-their-scaffolding/
- Published: 2026-10-17T05:31:32.000Z
- Updated: 2026-10-17T08:35:15.000Z
- Description: What an AI harness is, why it suddenly matters more than which model you pick, and seven habits for getting real work out of one.
- Author: Stalin Pereira
- Tags: AI Engineering

For a couple of years the question everyone asked about AI was "which model is best?" Lately the question has quietly changed to "which *harness* are you using?" If you've heard the word and nodded along, this post is for you: what a harness is, why it suddenly matters so much, and how to get real value out of one, whether you're a developer or not.

## What a harness actually is

A language model on its own does one thing: it takes text in and predicts text out. It can't read your files, run a command, remember yesterday, or check whether its answer works. Everything that turns that text predictor into something that *does work* is the harness.

The simplest way I've found to say it:

> **Agent = model + harness.** The model decides what to do next. The harness lets it actually do it, and keeps it on track while it does.

A typical harness takes care of:

- **The loop.** Ask the model what to do, run the tool it asked for, feed the result back, repeat until the task is done.
- **Tools.** Reading and editing files, running shell commands, searching the web, calling APIs.
- **Context management.** Deciding what goes into the model's limited window, and summarising or dropping old material when it fills up.
- **Permissions and safety.** What the agent may do on its own, what needs a human "yes", and what is off-limits.
- **Memory and instructions.** Project rules, preferences and notes that carry over between sessions.
- **Delegation.** Spinning off sub-agents for side tasks so the main conversation stays focused.
- **Hooks and verification.** Running tests, linters or custom checks automatically, so the agent sees when it's wrong.

Here is how those pieces fit together. Step through one turn of the loop:

Your taskprompt · rules · memory Doneno more tool calls Modeldecides the next step Contextwhat the model sees Permissionsallow · ask · deny Toolsfiles · shell · web Feedbackresults · tests · hooks 

‹ BackPauseNext ›

1. **Load.** The harness assembles the context: your request, the project's instructions file, any saved memory, and the list of tools the model may call.
2. **Decide.** The model reads the context and picks: answer now, or call a tool? It only knows what is in the window, which is why the quality of that window matters so much.
3. **Check.** Before anything runs, the harness checks permissions. Safe actions go straight through, risky ones wait for a human, forbidden ones are refused.
4. **Act.** The tool runs: read a file, edit code, run a command, search the web.
5. **Observe.** The result comes back, and hooks can add their own signal: failing tests, lint errors, a formatter's diff. This is how the agent finds out it was wrong.
6. **Remember.** Everything is appended to the context. When the window fills up, the harness compacts it or hands side work to a sub-agent, and the loop goes round again.
7. **Finish.** When the model replies without asking for a tool, the loop ends. A good harness only gets here after the checks pass.

One turn of the agent loop. Everything except the model is the harness.

Coding agents in the terminal, IDE assistants and the various agent SDKs are all harnesses. They often run the very same models. What differs is everything around the model.

## Why it suddenly matters

Harnesses aren't new. People have been wrapping models in loops since the first chatbots could call functions. What changed is *where the bottleneck is*.

**1\. Models got good enough at using tools.** Early models could call a tool, but they'd lose the thread after a few steps. Current models can keep a plan going across dozens or hundreds of tool calls. Once the model can reliably drive a long loop, the quality of that loop becomes the limiting factor.

**2\. The same model gives very different results in different harnesses.** This was the eye-opener for a lot of people, me included. Put one model in a bare loop and it flounders on a real codebase. Put it in a harness that gives it good search tools, runs the tests and manages its context, and it fixes the bug. Benchmark leaderboards made this visible: scores for "the same model" move a lot depending on the scaffolding around it.

**3\. Tasks got longer.** We stopped asking for one function and started asking for "migrate this module and make the tests pass". Long tasks run into the context window. A harness that compacts history, writes notes to disk and hands side quests to sub-agents can finish work a naive loop can't.

**4\. Autonomy needs guardrails.** The moment an agent can run `rm` or push to a remote, permissions stop being optional. Sandboxing, approval prompts and audit trails are harness features, and they're what make it reasonable to let an agent run for twenty minutes unattended.

**5\. It became the product.** Model providers and tool makers now ship their harnesses as products and SDKs. When everyone has access to roughly similar models, the harness is where they compete, so it's what everyone is talking about.

## How everyone should use one

The biggest mistake I see is treating a harness like a chat box: type a request, hope for the best. A harness is closer to a new teammate. It's capable, but it knows nothing about your world until you tell it. Here's what made the difference for me.

### 1\. Write down the rules once

Most harnesses read an instructions file at the start of every session, usually a markdown file in the project root. Put in it what you'd tell a new hire on day one: how to build and test, the conventions you care about, the things never to touch. Keep it short and specific. "Run the unit tests before saying you're done" beats a page of philosophy.

### 2\. Give it a way to check its own work

This is the single highest-leverage habit. An agent that can run tests, a type checker, a linter or even a screenshot comparison will catch and fix its own mistakes. An agent that can't has to guess, and it will tell you it's done when it isn't. If your task has no automatic check, ask for one first: "write a test that reproduces the bug, then fix it."

### 3\. Plan before you build

For anything bigger than a small fix, ask for a plan first and read it. Correcting a wrong assumption in a five-line plan is cheap. Correcting it after forty files changed is not. Many harnesses have a dedicated planning mode for exactly this.

### 4\. Protect the context window

The model only knows what's in its window, and a cluttered window makes it worse. Start a fresh session for unrelated tasks. Let sub-agents do broad searches and report back a summary instead of dumping fifty files into the main conversation. Point at the exact files that matter rather than asking it to "look around".

### 5\. Set permissions deliberately

Allow the boring, safe things (reading files, running tests) without prompts, so you're not clicking "yes" all day. Keep a human in the loop for anything destructive or outward-facing: deleting data, deploying, sending messages, spending money. Approving everything blindly is how accidents happen. Approving nothing makes the agent useless.

### 6\. Turn repeated advice into automation

If you find yourself typing the same instruction every session, move it into the instructions file. If it must *always* happen, such as formatting after every edit, make it a hook so it runs deterministically instead of relying on the model to remember. If it's a multi-step routine you repeat, save it as a reusable command or skill.

### 7\. Review like it's a pull request

Read the diff. Run it yourself. The agent is fast and usually right, and that's exactly when it's easy to stop paying attention. You still own the result.

## If you're building one

The core loop is surprisingly small:

```python
messages = [system_prompt, user_task]
while True:
    reply = model.generate(messages, tools=TOOLS)
    messages.append(reply)
    if not reply.tool_calls:
        break                      # the model says it's done
    for call in reply.tool_calls:
        if not allowed(call):      # permissions live here
            result = "denied by user"
        else:
            result = run_tool(call)
        messages.append(tool_result(call, result))
    messages = compact_if_needed(messages)   # context management lives here

```

That loop is maybe twenty lines. The hard part is everything those three comments point at: good tool design, sensible permissions, and context that stays useful over a long run. My advice is not to write those from scratch. Start from an existing agent SDK, then spend your effort on the tools and instructions that are specific to your problem. That's where your harness becomes better than the generic one.

## Trade-offs

- **More autonomy, more risk.** A harness that can do more can also break more. Sandboxes and approvals cost a little speed and buy a lot of safety.
- **Cost and latency.** Agent loops make many model calls. A ten-minute task can cost far more than one chat reply. Use the agent for work that's worth it.
- **Setup takes time.** Instructions, hooks and permissions pay off over weeks, not on day one. For a one-off question, a plain chat is fine.
- **Lock-in.** Instruction files and skills are becoming more portable across tools, but not fully. Keep your rules in plain markdown so they're easy to move.

## Takeaway

The model is the engine; the harness is the rest of the car. Models are converging, so the gains now come from how well the agent can act, check itself and stay focused. Pick a good harness, teach it your rules once, give it a way to verify its work, and keep a human on the decisions that matter.