Harness Engineering · Episode 01

Why Your Agent Fails

The model spoke last. That does not mean the failure began there.

Arc · The problem Episode · 1 of 8 Next · Episode 02 — Inside a Production Agent Harness
After this you will know
  • SurfaceWhy a polished model answer can hide a broken workflow.
  • AnatomyHow to separate Model, Harness, Tools, and Environment.
  • PatternsSix failure shapes that recur in production.
  • PracticeThe incident-review questions that lead to an owner and a fix.

The reconciliation team is a constructed teaching case. Its dialogue, timeline, and numbers illustrate mechanisms; they are not measured customer outcomes.

The AI PM decision

Turn an unreliable customer journey into a defensible problem statement, containment decision, and prioritized repair. Ask for evidence that distinguishes capability, data, workflow, and control failures.

01The 2 AM failure nobody can explain

At 2 AM on Tuesday, the reconciliation agent reports that it is finished.

It processed 847 of 2,347 invoices. The dashboard is green. No exception fired. No tool timed out. Fifteen hundred invoices are still waiting.

The team blames the model. That is reasonable. The model is the part that spoke last.

But the model never saw 2,347 invoices.

The surrounding system fetched one page, passed 847 records into the session (one recorded interaction that can contain many model and tool calls), and accepted the model's final sentence as proof that the full job was complete. Nothing compared the processed count with the source ledger. Nothing asked whether another page existed.

The model completed the task it received. The system represented the wrong task and accepted weak evidence.

The incident review now has three questions:

  1. What state did the system show the model?
  2. What counted as complete?
  3. What checked that claim against the real world?

Those questions lead to code, evidence, and an owner. "The model was weird" does not.

The reconciliation team stays with us for all eight episodes. Its illustrative numbers make the failure inspectable; they are not evidence of a measured customer outcome.

Model capability and system design jointly shape what users can rely on. Diagnose the combination you actually deploy.

02A failed run is not a diagnosis

The final response is where a problem becomes visible. Its causes may begin earlier: an ambiguous job, missing evidence, a misleading tool result, an unavailable dependency, or a model that reasons incorrectly despite adequate information.

Start with the intended outcome and reconstruct the run. Do not start with a preferred culprit.

Five contracts to inspect

ContractPlain questionRefund example
JobWas success and the stopping condition explicit?Determine eligibility under the current policy; do not issue a payment
ContextDid the model receive the relevant, current, authorized evidence?Correct customer, purchase date, policy version, and account restrictions
ActionWere tool meaning, inputs, effects, and permission clear?Drafting a refund and issuing one are separate operations
StateDid the process distinguish proposed, attempted, confirmed, and unresolved work?A timeout after submission leaves the refund outcome unknown
AcceptanceWas the real result checked against the job?The right case received a valid decision; a polite message alone is insufficient

A defect in one contract does not rule out defects elsewhere. Missing pagination may explain why invoices never arrived. A weak acceptance check explains why that omission reached the user as a green dashboard. Both deserve repair.

Nine diagnostic questions

Use these as an inspection route, not a rule that the model must always be investigated last. Follow stronger evidence first.

  1. Job: What was the exact outcome, scope, and stop condition?
  2. Context: (the information available to a model for the current call) Which sources and policy versions reached the model, and which were missing?
  3. Tool contract: What operation did the interface promise, and what did it actually return or change?
  4. State: What had happened, what remained pending, and what was merely inferred?
  5. Harness: How did context selection, routing, retries, handoffs, and completion affect the run?
  6. Runtime implementation: Which services hosted state and control, and did their configured limits hold?
  7. Environment: Were records, credentials, dependencies, network routes, and isolation as expected?
  8. Verification: Did the checker inspect independent evidence or repeat the agent’s own claim?
  9. Model: Given the actual evidence and interface, which interpretation, plan, or judgment was wrong?

Runtime is a deployment view, not a fifth MHTE responsibility. Verification is an activity that can use tools, model judgment, and evidence from the environment.

The repair-owner test

Complete this record before choosing the durable fix:

The evidence shows [divergence]. It was enabled by [contributing conditions] and escaped because [missing detection or containment]. We will contain it through [action], repair it through [change], assign [owner], and test [case and acceptance evidence].

The earliest observed divergence is useful evidence. It is not automatically the only cause, and a missing trace (a record of the steps, operations, and evidence in a run) may prevent certainty. Record that uncertainty rather than inventing a clean story.

Contributing defectEvidenceUser impactImmediate containmentDurable repairOwnerRegression case
Missing paginationEligible IDs absent from inputInvoices left unprocessedReport incomplete workRetrieve all pages under stable scopeNamed implementerMultiple pages and duplicate IDs
Weak completionFinal response accepted without coverage checkDashboard falsely greenDisable automatic successCompare expected IDs with accepted outcome IDsWorkflow owner and engineeringIncomplete and valid complete runs

Episode 02 organizes the harness work into five decision clusters. Those clusters support design; these questions support diagnosis. Neither is another list of MHTE layers.

Figure 01 · Diagnose
Nine diagnostic questions
An inspection aid · not nine layers, not a ranking
01 JobWhat was the exact outcome, scope, and stop condition?
02 ContextWhich sources and policy versions reached the model, and which were missing?
03 Tool contractWhat operation did the interface promise, and what did it actually return or change?
04 StateWhat had happened, what remained pending, and what was merely inferred?
05 HarnessHow did context selection, routing, retries, handoffs, and completion affect the run?
06 Runtime implementationWhich services hosted state and control, and did their configured limits hold?
07 EnvironmentWere records, credentials, dependencies, network routes, and isolation as expected?
08 VerificationDid the checker inspect independent evidence or repeat the agent’s own claim?
09 ModelGiven the actual evidence and interface, which interpretation, plan, or judgment was wrong?
Follow the evidence. Record contributing defects, missing containment, and repair owners separately.
Figure 01. Nine diagnostic questions. Use them to inspect evidence, not to force a model-last verdict. Record contributing defects and missing containment separately.

03What is a harness?

An agent harness is the software control system around model calls that manages a task’s execution: it assembles context, maintains working state, coordinates model calls and tool operations, applies workflow policies, and determines when to continue, pause, hand off, or finish against defined acceptance checks.

In plain language, the harness turns separate model responses into a managed process. It arranges the next step, tracks what happened, and applies the checks required to proceed or finish.

It is not everything outside the model. A ledger is environmental state; querying it is a tool operation. The harness manages when the query happens, which task it belongs to, how its result enters context, and whether the work may continue.

Consider a contractor arriving for a shift. The model resembles the contractor’s ability to interpret a job and propose the next move. The harness resembles the work-order and supervision process. Tools perform the operations. The building, records, access system, and available equipment resemble the environment. The analogy stops short of real human accountability: the organization remains responsible for deploying the software and authorizing its work.

Vendors may sell all four responsibilities in one product. That packaging does not make them interchangeable. OpenAI’s Agents API (a programmatic interface for requesting operations from another application) packages a managed Codex harness and supporting infrastructure; the customer still specifies its workflow and acceptance conditions. OpenAI: Introducing the Agents API

For a PM, harness engineering connects the user’s outcome to context, state, authority, recovery, and completion. A model may propose decisions within that process. The harness manages their consequences.

04The four-responsibility map

ResponsibilityWhat it doesInvoice example
ModelProposesSuggests that an invoice matches a payment
HarnessManages the workAssembles the evidence, checks the proposed operation, tracks progress, and applies acceptance rules
ToolsPerform operationsRead payment records, record an approved match, and retrieve the saved result
EnvironmentSupplies state and limitsHolds ledger records, credentials, access rules, and the resources in which operations run

The environment affects the loop throughout; it is not merely the last station. Nor do four responsibilities imply four different team owners.

Imagine the model proposes updating the wrong invoice. The harness may fail to check the ID; a tool may accept an ambiguous identifier; the environment may allow access to more tenants than necessary. Model behavior explains the proposal. Other failures explain why the proposal became a damaging effect.

Different repairs address different conditions. Improve the reasoning if evidence supports a capability gap. Strengthen identity checks at the operation boundary. Restrict environmental access. These changes can be complementary rather than competing diagnoses.

A permission check may live in a tool wrapper, a policy service, or an API gateway. Name the decision and its enforcement point instead of forcing the whole service into one category.

Figure 02 · Concept
Four responsibilities, one workflow
E Environment · state, access, dependencies, execution limits
ModelProposes
HarnessManages the work
ToolsPerform operations

The environment affects operations throughout. Inference may be hosted remotely; the boundary is conceptual, not one physical machine.

Figure 02. Four responsibilities, one workflow. The model proposes; the harness manages; tools operate; the environment supplies state and limits throughout the loop.

05One symptom can have four causes

A user says, "The agent forgot what I told it."

That sentence describes the experience, not the cause.

What happened underneathWhat the user seesWhere to look
Project instructions never loaded"It ignored our rules"Identity at session start
The session stored the fact but context assembly omitted it"It forgot"Memory policy
Correct context arrived, but reasoning failed"It misunderstood"Model
A tool returned an old record"It remembered the wrong thing"Tool and data source

Start where the problem became visible, then inspect the earlier conditions that made it possible. A run can have several preventable divergences.

The same holds for a support agent that gives the wrong refund decision.

The visible symptom can be the same while the repair differs. Describe the outcome and inspect the evidence before selecting a model, harness, tool, or environment intervention.

06Why benchmarks do not settle production reliability

A benchmark measures defined tasks under specified models, harnesses, tools, budgets, and environments. Some test a narrow capability; others test a complete agent system. Read the configuration before transferring a score to your product.

Production adds its own distribution of records, permissions, policy changes, interruptions, and consequences. A strong score is useful evidence, but it does not establish that your process will recover after a write timeout or account for every invoice across a restart.

The October 23 preprint When Agents Fail compares model–harness pairings across six benchmarks and finds that rankings depend on the model and task. It also separates task correctness from Valid Completion Rate: terminating normally with an evaluable result, “irrespective of task correctness.” This is benchmark evidence for testing interactions, not a universal winner or an enterprise failure rate. When Agents Fail: Model or Harness—Who’s to Blame?

For your workflow, ask:

  1. Does a restart preserve the state needed to resume?
  2. Does the system notice stale or withdrawn evidence?
  3. Does a retry address the actual failure?
  4. Can it distinguish progress from repeated motion?
  5. Can external evidence establish completion?
  6. Can another session reconstruct unresolved work without repeating an uncertain side effect?

Call the continuity requirement context durability: keeping the information and state needed for useful work available across turns, interruptions, and sessions. This is a working term for the series, not a single standardized metric.

More context is not automatically better context

A larger window creates room; selection determines whether the right evidence occupies it. A current rule beside several obsolete copies can leave the model with a harder decision, not a better one.

Measure retrieval coverage and source freshness, then inspect what the model actually received. If the correct evidence arrived and the model still misunderstood it, investigate reasoning. If it never arrived, a larger model alone does not demonstrate a durable retrieval repair.

07The production gap is an operating problem

LangChain’s June 2026 report describes 1,340 self-selected survey responses, collected in November–December 2025. It reports 57.3% with agents in production and quality as the leading barrier. This is older, technology-heavy survey context—not a current enterprise census or evidence that quality is solely a harness property. LangChain: State of Agent Engineering

Enterprise readiness can fail even when the model is capable. McKinsey’s September 14 field account describes an unnamed medical-technology company that discovered cross-system data-version mismatches while building an agentic customer-service solution. The account is consultancy evidence, not an audited experiment. Its useful question is concrete: which system is authoritative when two connected systems disagree? McKinsey: Stacking the odds

For the invoice agent, tools can return different versions of a customer record from the environment. The harness needs a source-selection or conflict-handling policy. The model can flag the discrepancy, but should not silently invent an authoritative version.

The production gap is therefore a question to investigate: which missing capability, data condition, control, or operating decision prevents an acceptable outcome?

08Six failure shapes

Symptoms help decide what evidence to inspect first. They do not prove the cause.

What you seeInitial question
Stops earlyWhat evidence allowed completion?
Repeats without progressWhat failure is being retried, and why could another attempt help?
Finishes the wrong workWhich objective and policy versions governed the run?
Uses the right words with the wrong meaningWhere is the business definition, and which version was used?
Acts beyond authorityWhich boundary should have blocked the operation?
Workers disagreeWhich inputs, shared state, and merge rules coordinated them?

Premature stop

The system exits cleanly with work remaining. For invoices, compare eligible IDs under a recorded cutoff with IDs in accepted outcome states. Equal counts alone can hide duplicates and omissions.

If exceptions transfer to a human queue, verify that the receiving queue accepted them and show unresolved work separately. “Assigned” does not mean “resolved.” The workflow may finish its automated stage without finishing the whole business journey.

Infinite loop

The agent repeats a rejected operation or makes cosmetic changes without addressing the constraint.

A validation failure needs corrected input. A temporary network problem may justify waiting and retrying unchanged input. A denied permission requires an authorized change or a stop. Moving to a stronger model does not grant broader authority.

A write timeout may mean the write succeeded but its reply was lost. Preserve an unknown-outcome state and inspect the service’s operation record or supported idempotency (protection against repeating the effect of the same intended operation, when the receiving service supports it) behavior before resubmitting. Bound attempts, total time, spend, and consecutive turns without progress.

Silent drift

The output is polished but follows old intent or policy. Keep the objective, source version, and important changes traceable. A summary should distinguish a prior plan from a current instruction.

Personal agents add a long-lived variant: a preference inferred last month may be irrelevant or withdrawn today. Retained information needs scope, provenance (where information came from and how it was transformed), and a correction path.

Shared-vocabulary failure

“Active customer” may mean recent usage, an unexpired contract, or an account eligible for billing. The model cannot settle a policy choice the organization has not made.

Store the relevant definition with an owner, version, and examples. A model may ask for clarification; it should not quietly choose a convenient definition when the downstream consequence depends on it.

Unauthorized action

Drafting and sending are different authorities. Access to a document does not automatically permit disclosure. A prompt states intent; tool and environment controls must enforce consequential boundaries.

A background monitor can check whether an agent’s behavior appears consistent with its authorized task. For example, an invoice assistant asked to prepare an internal report might attempt to send customer records to an external service.

The monitor can flag suspicious behavior and, where supported, block further execution. However, its checks run alongside the workflow. An operation may already have happened before the concern is detected, and stopping later work does not reverse that effect.

A flag means “investigate this,” not “a violation is proven.” The monitor can also miss problems. The product therefore needs controls before consequential operations, a person responsible for investigating alerts, and evidence of what actually happened.

Source: OpenAI’s misalignment-monitoring documentation.

The PM distinction to remember
  • PreventionRestricts what may happen.
  • MonitoringLooks for concerning behavior.
  • RecoveryHandles effects that already happened.

In MHTE, the model proposes, the harness manages checks and dispatch, the tool performs the operation, and the environment supplies access limits and actual state. Detection must connect to an owner, stop authority, and reconciliation of effects already committed.

Worker divergence

Parallel workers can be locally plausible and jointly inconsistent. One may use an old policy; two may claim the same invoice; a merged summary may omit a failed worker.

Give each worker exact scope, source versions, output and evidence requirements, a budget, and a cancellation path. Define who may write shared state and how conflicts are resolved. A coordinating harness must verify coverage, not count worker messages.

Separate context windows do not establish isolated files, credentials, or independent judgment. Verify the deployment and the evidence each worker uses.

Figure 03 · Patterns
Six failure shapes
A symptom tells you where to investigate first—not the whole cause.
01 Premature stopClean exit, unfinished queueWhich IDs and accepted states prove coverage?
02 Loop without progressMotion without progressWhat failure could another attempt repair?
03 Silent driftPolished output, old objectiveWhich objective and policy versions governed the run?
04 Vocabulary mismatchRight word, wrong meaningWhere is the business definition, and which version was used?
05 Unauthorized actionProposed becomes performedWhich boundary permitted the effect?
06 Worker divergenceLocally right, jointly wrongWhich inputs, shared state, and merge rules coordinated them?
Figure 03. Six failure shapes. Symptoms guide the first investigation; they do not prove a root cause or assign a team automatically.

09When a model swap is the right move

Model limitations are real. Compare alternatives when representative cases show a reasoning, instruction-following, perception, or judgment gap. Keep the task set, allowed tools, evidence, and budget comparable, and inspect changed failure cases rather than only the average score.

The surrounding system may also need repair. A stronger model might notice missing pagination, yet relying on that observation is different from ensuring the workflow retrieves and accounts for the full queue.

Upgrade capability where it is missing. Repair controls where evidence shows a gap. Test the resulting combination.

A model change can reduce one failure and introduce another through different tool choices, verbosity, refusal, or recovery behavior. Release the pairing that meets the workflow’s requirements; do not assume the newest model is automatically the safest or cheapest fit.

10Where prompt engineering fits

These practices overlap. They are not a mandatory sequence of maturity levels. A prompt is one way to express workflow guidance; a tool permission or environment boundary is a different way to constrain what can happen. Choose the intervention that addresses the observed mechanism.

11The ownership gap

Organizations divide model selection, tool implementation, infrastructure, security, and business policy in different ways. A workflow can have capable contributors and still lack a decider for its complete behavior.

Ask who owns these decisions:

  1. Which evidence and policy apply to this task?
  2. What proves acceptable completion?
  3. Which failures become release tests?
  4. Who may expand or narrow delegated authority?
  5. Who can stop a live run and reconcile its prior effects?

One accountable workflow owner does not implement every component or override security and business policy. The role ensures that decision rights, implementing teams, required approvals, and escalation are explicit. Episode 07 develops that operating arrangement.

Use a real incident to test ownership. Can the team name who contains it now, who makes the durable change, and who accepts the evidence before wider rollout?

12In practice: diagnose the last three failures

Take the last three agent sessions that failed, required manual repair, or produced an outcome nobody was willing to trust.

For each session, complete one record:

FieldRecord
Intended outcomeWhat the user needed to become true in the real world
Observed outcomeWhat happened instead
First observed divergenceEarliest supported departure, with later contributing defects and uncertainty
Broken contractJob, context, tool, state, harness, runtime, environment, verification, or model
MHTE responsibilityModel, Harness, Tools, or Environment; list several when evidence supports it
EvidenceTrace, policy version, tool result, external state, or missing artifact
Immediate containmentWhat reduces harm now
Long-term repairProduct, policy, code, infrastructure, or eval change
OwnerPerson or team able to make and maintain the change
Regression caseTest of the failure and valid behavior under stated conditions

Use these definitions

Do not begin with the layer. Begin with the intended outcome, then follow evidence backward to the first divergence.

If every incident receives the same label, check whether the evidence supports it. Repeated model failures are possible; repeated missing-control failures are possible too. Keep uncertainty visible rather than forcing a balanced allocation.

The road from here

The remaining seven episodes follow the repair from diagnosis to operating discipline.

EpisodeNext questionWhat you will leave with
02 · Inside a Production Agent HarnessWhere do state, control, and execution live?Three views of one machine and five harness decisions
03 · Four Small ChangesWhat can we improve without changing the model?Evidence-rich retries, constrained output, narrow tools, external completion
04 · Five ParadoxesWhen is each control worth its cost?Five tensions and a decision card
05 · What It Costs, What It ReturnsWhat does an accepted workflow really cost?Build, Run, Review, Failure, and cost per accepted result
06 · Your Monday Morning Harness KitWhat should the team do first?A nine-day diagnosis, four tickets, and a twelve-week runway
07 · Organisations That Rebuilt Around AgentsWho may decide?Decision rights, operating models, and an ownership page
08 · When the Harness Becomes the HabitWhat survives implementation change?Five continuing obligations, a release loop, and a retirement discipline

The same reconciliation team will carry the argument. The system will become more capable, some controls will move into models and vendors, and some local machinery will be deleted. The finale returns to the same 2 AM dashboard.

The goal is not to preserve the first harness. It is to preserve the discipline that decides what to build, what to verify, what to own, and what to remove.

Remember the product decision

Outcome → evidence → diagnosis → repair.

  • Describe what the customer needed to become true.
  • Follow the supported divergence and contributing conditions.
  • Repair capability, control, data, or operation where the evidence points.
  • Ask who owns containment, durable repair, and the acceptance evidence.
You now hold
Attribution 01 The four-responsibility map: the model proposes, the harness manages, tools operate, the environment supplies state and limits. Nine diagnostic questions. Six recurring failure shapes. One incident record that ends with evidence, containment, a repair, an owner, and a regression case.
The next question
If the harness is the system that decides, what sits inside it, and which decision belongs where?
Continue
Harness 02 Inside a Production Agent Harness → — three views of one machine and the five decisions the control plane makes.
Read alongside
Environment 00 The World Around the Agent → — the layer that constrains what any action can reach.
Sources
  1. OpenAI: Introducing the Agents API. September 10, 2026 · managed Codex harness and infrastructure announcement.
  2. When Agents Fail: Model or Harness—Who’s to Blame?. October 23, 2026 · research preprint; model–harness interaction, not a production prevalence estimate.
  3. LangChain: State of Agent Engineering. June 12, 2026 · self-selected survey fielded November 18–December 2, 2025; older context.
  4. McKinsey: Stacking the odds. September 14, 2026 · anonymized consultancy field account, not an audited causal study.
  5. OpenAI: Misalignment monitoring. Current documentation, checked November 3, 2026 · coverage, asynchronous detection, and stopping behavior.