中文
中文版

The Harness Engineering Compendium

Full Version | Video: AI Engineering Deep Dive

Analysis: Claude Opus 4.6 Cloud | Voice transcription: mlx-whisper | 2026-04-04

No matter how fine the horse, without reins it can't run long distances.
No matter how smart the AI, without a Harness it can't deliver in the real world.
Table of Contents
  1. Core Insight: Where the Problem Lies
  2. Three-Stage Evolution: From Clear Instructions to Stable Execution
  3. The Six-Layer Harness Architecture
  4. How Leading Companies Do It
  5. Historical Parallels
  6. Business Insights
  7. Summary

1. Core Insight: Where the Problem Lies

A true story: a team's Agent used the best model, rewrote the prompt over a hundred times, tuned every parameter imaginable, yet the task success rate never broke 70% -- sometimes brilliant, sometimes inexplicably off-track.

They eventually brought in someone to diagnose the system. The biggest changes were made to things that were neither the model nor the prompt: how tasks were decomposed, how state was managed, how key steps were validated, and how failures were recovered. The result? Same model, same prompt -- success rate pulled above 95%.

This reveals a First Principles truth:

Agent = Model + Harness The model determines the capability ceiling; the Harness determines the delivery floor.
What truly makes AI work in production is never how smart the model is, but how reliable the system around it is.

2. Three-Stage Evolution: From Clear Instructions to Stable Execution

Over the past two years, AI engineering has undergone three major shifts in focus. Each shift originated from the structural ceiling hit by the previous stage. The three are nested, not sequential -- Prompt is a subset of Context, and Context is a subset of Harness.

Stage 1

Prompt Engineering -- The Design of Language

Problem it solves: Did the model understand what you're saying?

Essence: Large models are probability-generation systems extremely sensitive to context. Give it a role, and it answers along that role; give it examples, and it completes along that pattern. So prompt engineering isn't about commanding the model -- it's about shaping a local probability space.

Ceiling: It can only activate capabilities the model already has. No matter how well you phrase things, you can't compensate for missing facts, manage state, or handle complex multi-step tasks. Prompting solves the "expression" problem, not the "information" problem.

Stage 2

Context Engineering -- The Design of Information

Problem it solves: Does the model have enough of the right information?

Essence: Context isn't just a few background paragraphs -- it's the total sum of all information influencing the model's current decision: user input, conversation history, retrieval results, tool returns, task state, intermediate outputs, system rules, safety constraints, results passed from other agents. The prompt is actually just a small part of the context.

Key insight: The context window is a scarce resource. More information isn't always better -- too much dilutes attention. The mature approach is to provide information on demand, in layers, at the right moment. (A canonical practice: Agent Skills start with minimal metadata and only dynamically load the full SOP when needed.)

Ceiling: Even if all the information is perfectly provided, models in long execution chains still plan well but execute poorly, call tools but misinterpret their returns, and slowly drift over long chains with nobody noticing.

Stage 3

Harness Engineering -- The Design of the System

Problem it solves: Can the model keep performing correctly during real execution?

Essence: "Harness" originally means reins, horse tack, a restraint device. The first two generations of engineering focused on making models "think better." Harness focuses on keeping models "on track" -- and when they veer off or make mistakes, pulling them back.

Prompts optimize "intent expression," context optimizes "information supply," but the hardest problem in complex tasks is: when the model starts taking continuous actions, who monitors it, constrains it, and corrects it?

Sending a new hire to visit an important client:

Prompt = Explain the task clearly (greet them, present the proposal, ask about needs, confirm next steps)

Context = Prepare all the materials (client background, past records, pricing, competitors, meeting objectives)

Harness = Send them with a checklist, require real-time check-ins at key milestones, verify notes against the recording afterwards, correct deviations immediately, and validate results against standards

3. The Six-Layer Harness Architecture

1 Goal & Role Definition
The model must clearly know: Who am I? What's the task? What does success look like? The Harness's first job is to keep the model thinking within the correct information boundaries. Information needs structured organization -- rules here, tasks there, evidence over there, clearly layered. Once it gets messy, the model starts missing key points, forgetting constraints, or even self-contaminating.
2 Tool System
It's not enough to just plug in tools. Three problems must be solved: which tools to provide (too few limits capability, too many cause confusion), when to use them (don't query when unnecessary, don't hallucinate when a query is needed), and how to feed back results (dozens of return results can't be dumped back raw -- they must be refined, filtered, and kept relevant to the task).
3 Execution Orchestration
Many Agents' problems aren't that they can't do individual steps -- they can't chain them together: they work on whatever comes to mind and end up delivering a pile of half-finished pieces. Mature systems need a clear track: understand the goal -> assess if information is sufficient -> supplement -> execute -> check -> retry if not satisfactory. Humans navigate this path through experience; Agents do it through the Harness.
4 Memory & State
An Agent without state management is amnesiac every turn. At minimum, three categories must be distinguished: current task progress, in-session intermediate results, and long-term memory with user preferences. Mix them together and the system grows increasingly chaotic.
5 Evaluation & Observability
The most easily overlooked layer. The problem often isn't "it can't produce output" but "it doesn't know whether its output is any good." An Agent without independent evaluation capability permanently lives in a state of "feeling good about itself." This layer includes: output validation, environment verification, automated testing, logging and metrics, and error attribution.
6 Constraints, Validation & Recovery
The layer that truly determines whether a system can go to production. In real environments, failure is the norm -- search results are inaccurate, APIs time out, document formats are messy, the model misinterprets the task. Three capabilities are essential: Constraints (what can and can't be done), Validation (how to check before and after output), and Recovery (how to roll back to a stable state after failure, rather than starting from scratch).

4. How Leading Companies Do It

Anthropic -- Two Core Breakthroughs

Breakthrough 1: Context Refresh (Solving Context Fatigue)

During long autonomous tasks, the context fills up, and the model starts dropping details, losing focus, and even exhibiting a curious behavior -- it seems to "know it's running out of room" and starts rushing to wrap up.

The common approach is to compress the historical context and keep going, but Anthropic found that compression only makes things shorter -- the model's "sense of burden" doesn't go away. So they did something more radical: spin up an entirely new Agent and hand off the work. It's like dealing with a memory leak in software engineering -- instead of clearing the cache, you restart the process and restore state.

Breakthrough 2: Separating Production from Validation (Solving Self-Scoring Bias)

When a model does the work and grades itself, it's naturally biased toward optimism. The solution: split "doing" and "verifying" across different roles --

Core principle: As long as the evaluator is sufficiently independent, the system can form an effective "generate -> check -> fix -> re-check" loop.

OpenAI -- Humans Design the Environment; the Agent Writes All the Code

Redefining the Engineer's Role

Humans don't write code -- they only "design the environment." The engineer's job becomes three things:

  1. Break product goals into tasks the Agent can understand
  2. When the Agent fails, don't tell it to "try harder" -- instead ask: what structural capability is missing from the environment?
  3. Build feedback loops so the Agent can see the results of its own work

The AGENT.MD Lesson

Early on, they crammed all specifications into one massive AGENT.MD file, which actually made the Agent more confused -- the context window is a scarce resource, and stuffing it full is the same as saying nothing. They switched to a directory-page structure: keep only a core index, break detailed content into sub-files, and drill in only when needed. This is fundamentally the same idea as Agent Skills' "load on demand" approach.

Automated Governance System

Agents submit code so fast that human code review can't keep up. So they encoded senior engineers' experience into system rules (module layering, dependency restrictions, interception conditions), and the rules don't just flag errors -- they return "how to fix it" to the Agent, feeding into the next correction cycle. This is no longer traditional code standards; it's a continuously running automated governance system.

LangChain -- Same Model, Different Harness

Without changing the underlying model at all, solely by redesigning and optimizing the Harness, they pulled their agent from outside the top 30 to the top 5 on the leaderboard. This is the most intuitive proof of Harness Engineering's value.

5. Historical Parallels

Zhuge Liang's Governance of Shu Han -- From Individual Genius to Institutional System

Zhuge Liang (181-234 AD) was the most powerful "model" of China's Three Kingdoms era -- a peerless strategist, equivalent to a top-tier LLM. His "Longzhong Plan" (a famous strategic blueprint presented to warlord Liu Bei) was his "Prompt" -- clearly defining the strategic goal of dividing the realm into three. But the survival of Shu Han (the weakest of the three kingdoms) was never sustained by one brilliant move after another.

What truly kept this weakest kingdom alive for decades was the institutional governance system Zhuge Liang built: strict rule of law (the Shu Code) served as the constraint layer; military farming programs and a stable logistics supply chain served as execution orchestration; the chancellery's bureaucratic system ensured that even front-line failures wouldn't cause systemic collapse -- this was state management and recovery.

Contrast this with Guan Yu (a legendary warrior general) -- individual combat ability at the top (strong Model), but his loss of the strategic city of Jingzhou was essentially a failure of Harness. No intelligence verification mechanism (missing evaluation/observability layer), no failure rollback plan (missing recovery layer), chaotic state management (completely unaware when his rear was attacked). A top-tier Model without a Harness -- one failure means permanent collapse.

Qin's "Rule of Law by Quantification" -- From Theory to Executable System

The Shang Yang Reforms (4th century BC, which transformed the state of Qin into a military superpower) were essentially a complete Harness Engineering exercise.

Before the reforms, Qin's "Model" (military potential) wasn't much weaker than the other six warring states. What was lacking? The operating system. What Shang Yang did maps with striking precision:

Result: the same Qin people, who before the reforms were beaten by the state of Wei and lost their western territory, within just one generation became the most powerful force in the realm. The Model didn't change. The Harness changed. The entire system's output was transformed. This is strikingly parallel to the story in the video: "same model, same prompt, success rate from 70% to 95%."

6. Business Insights

Competition in the AI era is shifting from "who has the smartest model" to "who has the most stable system." Here are three business directions born from Harness thinking:

1. Sell "Stability," Not "Intelligence" -- Harness-as-a-Service

Business logic: Models are commoditizing through open-sourcing and homogenization; moats are getting shallower. But the Harness layer (orchestration logic, validation rules, recovery mechanisms, state management) is highly scenario-specific and hard to replicate.

How to do it: For specific verticals (legal contract review, medical report generation, financial risk control reports), don't sell model API access -- sell "a complete workflow engine guaranteeing 95%+ success rate." Customers don't need to care what model runs underneath; they're buying reliable delivery.

Moat: Every industry's Harness requires deep domain knowledge to design validation rules, error recovery paths, and quality standards -- things that can't be replaced by simply swapping models.

2. AI Quality Assurance (QA) Services -- Commercializing the Evaluation Layer

Business logic: The fifth layer "Evaluation & Observability" -- the most overlooked in the video -- happens to be the most commercially valuable. Because every enterprise customer's core anxiety is the same question: "How do I know if the AI got it right?"

How to do it: Provide independent "AI auditing" services -- don't generate, only verify. Like Anthropic's Evaluator role, build an independent evaluation layer outside the customer's Agent system: automated testing, log analysis, error attribution, compliance checks.

Pricing model: Charge per verification or by "guaranteed accuracy rate." In highly regulated industries like finance, healthcare, and law, willingness to pay for "reliability" is extremely high.

3. "Agent Environment Design" Consulting -- The New-Era System Architect

Business logic: OpenAI's practice reveals a key shift -- an engineer's value is no longer in writing code but in "designing environments where Agents can succeed." This means the market needs an entirely new type of professional service.

How to do it: Like the real case at the beginning of the video -- don't help clients swap models or rewrite prompts. Instead, diagnose their Harness: Is task decomposition reasonable? Are there blind spots in state management? Is the validation mechanism complete? Do failure recovery paths actually work?

Market timing: Right now, countless teams are stuck in the "we got the best model but our Agent is still unstable" trap -- exactly the scenario described at the opening of this case. People who can diagnose and fix Harness problems will be the most sought-after experts of the AI deployment era.

7. Summary

Three stages, three questions:

Prompt Engineering -> How do you explain the task clearly? (Engineering the expression)

Context Engineering -> How do you provide the right information? (Engineering the input environment)

Harness Engineering -> How do you keep the model performing correctly during real execution? (Engineering the entire runtime system)

Harness doesn't replace Prompt and Context -- it encompasses both within a larger system boundary.

When your Agent performs inconsistently, the problem is almost never "the model isn't trying hard enough." It's missing some structural capability. Find that gap, add that layer of Harness -- that's the most valuable work in AI engineering right now.