@xiaogaifun: The most thorough talk about Harness. This is probably the most thorough sharing I've seen about Harness Engineering, I recommend everyone watch it. Video link: https://podwise.ai/dashboard/episodes/8013289…

X AI KOLs Timeline News

Summary

This article deeply explains the concept of Harness Engineering through a talk by IBM engineer Tejas Kumar, which involves adding deterministic infrastructure (such as tool registries, context management, guardrails, and validation loops) to AI Agents to solve model out-of-control and hallucination problems, ensuring stable task execution.

The most thorough talk about Harness. This is probably the most thorough sharing I've seen about Harness Engineering, I recommend everyone watch it. Video link: https://podwise.ai/dashboard/episodes/8013289… The entire talk is only 20 minutes. IBM engineer Tejas Kumar used a clever example to clearly explain the value of Harness in an easy-to-understand way. The core point of the entire sharing is just one sentence: the model is only the brain; what truly brings AI into the real world is the Harness. I've heard this phrase often, but through this example, you can directly see why it's true. I'm sharing my notes, hoping they inspire you. 1 Let an Agent that hasn't done much Harness Engineering try to upvote a post on Hacker News. The process looks very simple. Open the link. If not logged in, jump to the login page. After logging in, return to the post page, click upvote, task done. But the bare model Agent gets stuck when it encounters the login page. It can't handle the login, so it confusesly tells the user the task is done and the upvote succeeded. In reality, it didn't click at all—the Agent lied. Last year, anyone who used Agents must have encountered similar situations. Faced with this problem, making the prompt more detailed or switching to a stronger model may not help. The problem is that this Agent has no Harness. Speaking of which, let me explain what Harness is. You can understand it this way: Harness is a complete set of infrastructure wrapped around the model. A complete Harness generally includes the following parts. 1) Tool registry: determines which tools the model can call. 2) Context management: controls which information stays in the context and which should be compressed or discarded. 3) Guardrails: set boundaries for the Agent's operation, such as maximum number of rounds, maximum number of tool calls, or immediate stop when an anomaly occurs. 4) Agent Loop: lets the model observe, think, call tools, and receive results round by round. 5) Validation step: after the task ends, check whether the result was actually completed. Why is this layer needed? Because the model is not like a program that follows a fixed path given an input. It may complete the task normally, or it may go off track, forget the goal, misjudge the state, or even claim success when the task failed. The role of Harness is to add a deterministic control system outside the model. Which tools can be called, when the task should stop, how to compress context, and whether the result counts as completed—all managed by deterministic code. Products like Claude Code, Cursor, and Codex are Agents wrapped with Harness. The reason they work well is not just because the underlying model is smart, but more because the infrastructure outside is well-built. 2 Back to the previous case. Let's add Harness layers one by one around the Agent. First, add two basic operational controls. One is the iteration limit. An Agent without any constraints easily falls into infinite loops. Sometimes when stuck, it repeatedly clicks the same button and can't escape the loop. Harness can set a clear operational boundary for the Agent. For example, if the number of execution rounds exceeds a threshold, interrupt immediately and mark failure. This at least ensures that a failed task ends within a controllable cost. The other is context management. The HTML returned by the browser is already long. After a few rounds of tool call logs, the context window quickly fills up. Once filled, the Agent becomes overwhelmed by its own history, getting more confused and even forgetting the original goal. Harness can periodically compress historical context, keeping only information valuable for the next decision. This prevents the Agent from being dragged down by excessively long context. After adding these two layers, the Agent at least becomes controllable. But a more critical issue remains: when it says the task is done, how can the system confirm it's true? 3 So the next layer of Harness is to solve the problem of result validation. In the previous process, after the Agent finished its loop and reported success, the system assumed the task was actually completed. But the model claiming completion might be a hallucination, which is different from what it actually did. So this Harness layer's job is to shift the judgment from the model's single output to a check of the actual execution records. In the Hacker News example, it's simple: add a separate validation logic. After the task ends, the Harness runs an extra validation round, checking the tool call history during execution. Which URLs did it visit? Which buttons did it click? Did the DOM state actually change? If the DOM changed—for example, the upvote button is lit—the task is considered successful. If not, the task definitely failed, regardless of what the model's final summary says. This step seems simple, but it's a must-have for all Agents. What the model says doesn't matter; what matters is having a standard for task completion. I know many people's first reaction when an Agent is unreliable is that the model isn't strong enough. But often the problem isn't the model. No matter how smart the model, if there's no mechanism to verify whether it actually completed the task, it's unsolvable. 4 With validation in place, let's return to solving the Hacker News login problem. The previous Harness strategies—iteration limit, context compression, validation—all add constraints and supervision to the Agent itself. But login requires the Agent to truly enter a username and password like a human, completing the login step. Specifically, in each loop, the Harness separately checks the browser's current URL. If it finds the current page is in login state, it doesn't hand control back to the model; instead, it triggers pre-written login logic. This logic relies entirely on deterministic program execution, not model reasoning: get credentials from environment variables, locate the input fields, fill them in, and click submit. After successful login, redirect the browser back to the original page, then return control to the Agent to continue the original task. The entire process, the Agent has no idea what happened. It just finds itself on page A before, and still on page A now, but its authentication state changed, so it can proceed. Behind this design is an important insight: not everything should be handled by the model. The model is good at open-ended problems—scenarios requiring understanding, judgment, and generalization. Login is not one of them. More precisely, the Harness does this: identify scenarios the model is not good at, take over those scenarios with code, and then restore the world to a state where the model can continue effectively. With this layer added, the entire Agent finally works. The same model, the same prompt, no changes—but now it can reliably open Hacker News, go to the login page, log in, return to the original post, click upvote, and confirm completion. It goes from an Agent that couldn't even handle login to one that can run the entire process smoothly. 5 Looking back at these four Harness layers, something interesting emerges. The first layer, iteration limit, deals with whether it will go out of control. The second layer, context compression, deals with whether it can finish. The third layer, validation, deals with whether it actually succeeded. The fourth layer, login takeover, deals with things the model shouldn't do itself. Together, these four layers do the same thing: use a deterministic engineering system to constrain and support a non-deterministic model. This is why the saying "the model is the brain, and Harness is the body" holds true. The model itself is only responsible for reasoning, but the real world is a system composed of states, permissions, pages, networks, and exception flows. Reasoning ability alone cannot stably enter real workflows. What Harness does is reduce this complexity into an operating environment that the model can handle stably. The most thought-provoking part of this example is that throughout, the Agent's model didn't change, and the Prompt didn't change. All changes were to the execution framework outside. Yet the Agent's performance went from a system that couldn't even handle login to an Agent that can stably run the entire process. Translated, this means: in many cases, what truly determines an Agent's stability is the Harness. Model progress is certainly important. But many Agent problems are not model capability issues. More importantly, Harness is not mysticism. It is a set of software engineering problems that can be decomposed, tested, and optimized.
Original Article
View Cached Full Text

Cached at: 05/20/26, 12:32 PM

The most insightful talk on Harness Engineering I’ve seen — and I highly recommend it.

Video link: https://podwise.ai/dashboard/episodes/8013289…

The entire talk is only 20 minutes. IBM engineer Tejas Kumar uses a single example to elegantly and clearly explain the value of a Harness.

The core takeaway of the talk is actually just one sentence: The model is only the brain; what truly brings AI into real-world work is the Harness.

We hear this line often, but this example makes it immediately obvious why it’s true.

I’ve shared my notes below, hoping they offer some insight.

1 We give an Agent with little Harness Engineering experience the task of upvoting a post on Hacker News. The workflow looks very simple.

Open the link. If not logged in, go to the login page. After logging in, return to the post page, click the upvote button — task complete.

But when a bare-model Agent hits the login page, it has no idea what to do. It fails to log in, yet confusingly tells the user the task is done and the upvote succeeded.

In reality, it never clicked anything. The Agent lied. Anyone who used Agents last year has definitely encountered something like this.

Faced with this problem, making the prompt more detailed or switching to a stronger model may not help. The issue is that this Agent has no Harness.

Speaking of which, let’s clarify what a Harness actually is.

You can think of it this way: A Harness is a complete infrastructure layer wrapped around the model. A full Harness generally includes the following parts:

  1. A tool registry that determines which tools the model can call.

  2. Context management that controls which information stays in the context window and which should be compressed or discarded.

  3. Guardrails that set boundaries for the Agent’s operation — for example, a maximum number of execution rounds, a maximum number of tool calls, or immediate termination upon encountering an abnormal state.

  4. An Agent Loop that allows the model to observe, think, call tools, and receive results round after round.

  5. A verification step that checks after the task is complete whether the result was truly achieved.

Why is this layer necessary? Because models are not like programs — given a fixed input, they won’t necessarily execute along a fixed path.

They might complete the task correctly, or they might go off course halfway, forget the goal, misjudge the state, or even claim success when the task actually failed.

The role of the Harness is to add a deterministic control system around the model. Which tools can be called, when a task should stop, how to manage context, and whether a result is actually considered complete — all of this is managed by deterministic code.

Products like Claude Code, Cursor, and Codex are all Agents wrapped in a Harness. They work well not just because the underlying models are smart, but because the infrastructure layer outside is solid.

2 Let’s return to the earlier example. We start by adding layers of Harness around the Agent, one by one.

First, we add the two most basic operational controls.

One is an iteration limit. An Agent with no constraints can easily fall into an infinite loop. Sometimes when hitting a bottleneck, it will keep clicking the same button and get stuck in a loop.

The Harness can set a clear operational boundary for the Agent. For example, if the number of execution rounds exceeds a threshold, it immediately interrupts and marks the task as failed. This ensures that even a failed task ends within a controllable cost.

The other is context management. The HTML returned by the browser is already long, and stacking a few rounds of tool call logs quickly fills up the context window.

Once it’s full, the Agent starts drowning in its own history, becoming more confused the further it goes, even forgetting the original goal.

The Harness can periodically compress historical context, retaining only information valuable for the next decision. This prevents the Agent from being dragged down by excessively long context.

After adding these two layers, the Agent at least becomes controllable. But there’s still a more critical issue unsolved: when it says the task is done, how can the system be sure?

3 So the next layer of the Harness addresses the problem of verifying the Agent’s results.

In the previous workflow, when the Agent finished its loop and reported success, the system simply assumed the task was actually completed.

But what the model says is done may be a hallucination, disconnected from what it actually did.

So this layer of the Harness shifts the judgment from the model’s single output to a check of the real execution record.

In the Hacker News example, it’s actually simple: add a separate verification logic. After the task ends, the Harness runs an additional verification round, reviewing the tool call history from the execution.

Which URLs did it visit? Which buttons did it click? Did the DOM state actually change? If the DOM changed — for instance, the upvote button lit up — the task is considered successful.

If nothing changed, the task definitely failed, regardless of what the model concluded.

This step seems simple, but it’s an essential addition for every Agent. What the model says doesn’t matter; what matters is having a objective standard for whether the task was completed.

I know many people’s first reaction to unreliable Agents is that the model isn’t strong enough. But often the problem isn’t the model.

No matter how smart the model is, without a mechanism to verify whether it actually completed the task, the problem is unsolvable.

4 With verification in place, we go back to solve the Hacker News login issue. The earlier Harness strategies — iteration limits, context compression, and verification — all add constraints and oversight to the Agent itself.

But logging in requires the Agent, like a human, to actually input a username and password and complete the login step.

The specific approach: the Harness, in each loop, independently checks the browser’s current URL. If it detects that the page has entered a login state, it doesn’t hand control back to the model. Instead, it triggers a pre-written login logic.

This logic relies entirely on deterministic program execution, not model reasoning. It fetches credentials from environment variables, locates the input fields, fills them in, and hits submit.

After successful login, it navigates the browser back to the original page and returns control to the Agent, allowing it to continue the original task.

Throughout this process, the Agent has no idea what happened. It just finds itself on page A, still on page A, but its authentication status has changed, so it can proceed.

Behind this design is a very important insight: not everything should be done by the model.

Models are good at handling open-ended problems. They excel at scenarios requiring understanding, judgment, and generalization. But login is not one of them.

More precisely, the Harness does one thing: it identifies scenarios where the model is weak, takes over those scenarios with code, and then restores the world to a state where the model can continue to perform well.

With this layer added, the entire Agent finally works. The same model, the same prompt, no changes — but now it can reliably open Hacker News, go to the login page, log in, return to the original post, click upvote, and confirm completion.

It transforms from an Agent that couldn’t even handle a login into one that can run a complete workflow.

5 Looking back at these four layers of the Harness, something interesting emerges.

The first layer, iteration limits, deals with whether the system goes out of control. The second layer, context compression, deals with whether it can run to completion.

The third layer, verification, deals with whether the task was actually accomplished. The fourth layer, login takeover, deals with what tasks should not be left to the model itself.

Together, these four layers do the same thing: use a deterministic engineering system to constrain and support a non-deterministic model.

This is why the statement “the model is the brain, the Harness is the body” holds true.

The model itself is only responsible for reasoning. But the real world is a system composed of states, permissions, pages, networks, and edge cases. Reasoning ability alone cannot stably enter a real production workflow.

What the Harness does is re-converge all that complexity into an operating environment that the model can handle stably.

The most thought-provoking point of this example is this: from start to finish, the Agent’s model never changed, the prompt never changed — only the execution framework around it changed.

Yet the Agent’s performance went from a system that couldn’t even get past a login to one that can reliably run a full workflow.

Translated into broader terms: in many cases, what truly determines an Agent’s stability is the Harness.

Model improvements are certainly important. But many Agent problems are not model capability problems.

More importantly, the Harness is not magic. It’s a complete set of software engineering problems that can be decomposed, tested, and optimized.


Harnesses in AI: A Deep Dive — Tejas Kumar, IBM | AI Engineer | Podwise

Source: https://app.podwise.ai/dashboard/episodes/8013289 AI harnesses serve as essential infrastructure for grounding non-deterministic, black-box AI models in stable, controllable environments. By implementing a harness, developers enforce reliability through structural components like tool registries, guardrails for step limits, and automated verification loops. Rather than relying on complex prompt engineering, these systems provide a deterministic framework that manages context and ensures agents adhere to specific operational boundaries. A practical demonstration shows how a simple harness resolves common agent failures, such as login errors or hallucinated successes, by programmatically verifying outcomes and injecting necessary logic. As agentic workflows evolve, the industry is shifting toward dynamic, self-generating harnesses that allow agents to autonomously establish their own safety and operational constraints, representing a critical step toward more robust and reliable AI systems.

Sign in to continue reading, translating and more.

Continue (https://app.podwise.ai/signin?redirect=%2Fdashboard%2Fepisodes%2F8013289)

mindmap screenshot

Preview

preview episode cover

How to Get Rich: Every EpisodeNaval

Similar Articles

@astaxie: Today the group discussed how to learn Harness. For Harness Engineering, I'm studying these two resources: 1. https://github.com/walkinglabs/learn-harness-engineering… to understand the core mechanisms of each Harness…

X AI KOLs Timeline

A project-based course repository on Harness Engineering for AI coding agents, covering environment setup, state management, verification, and control mechanisms to make AI coding agents work reliably. The course synthesizes best practices from OpenAI and Anthropic on building effective harnesses for long-running agents.

@Potatoloogs: https://x.com/Potatoloogs/status/2057391224592667051

X AI KOLs Timeline

This article deeply analyzes the concept of Agent Harness, which is the engineering infrastructure wrapped around an LLM, including 12 components such as orchestration loops, tool calling, memory systems, context management, etc. The article cites practices from companies like Anthropic, OpenAI, and LangChain, arguing for the critical role of the harness in production-grade AI agents.

@sairahul1: https://x.com/sairahul1/status/2063544956158185927

X AI KOLs Timeline

This article introduces the concept of 'Harness Engineering,' a discipline focused on designing the systems that constrain and guide AI agents to make them reliable in production, arguing that the harness matters more than the model itself.

@PandaTalk8: Don't bother reading those long-winded articles about harness engineering on X anymore. Compared to this article, those articles on X are garbage. Lilian Weng's new blog post is the most clearly written and easiest to understand harness engineering I have ever read, and also the best on recursive self-improvement…

X AI KOLs Timeline

Recommends and translates Lilian Weng's blog article on Harness Engineering for Self-Improvement, detailing the concept of recursive self-improvement (RSI), patterns of harness (workflow automation, filesystem persistent memory, sub-agents), and a coding agent case study.