Harness Engineering · Episode 03

Four Small Changes, Dramatic Outcomes

Add evidence. Bound outputs. Narrow choices. Verify outcomes.

Arc · The patterns Episode · 03 of 08 Next · Episode 04 — Five Paradoxes Every PM Must Hold
After this you will know
  • RetryWhich failures benefit from new evidence, waiting, correction, or escalation.
  • Schema(a formal description of allowed fields, types, and values) What a shape contract can prove, and what it cannot.
  • ToolsHow to reduce tool confusion without removing useful capability.
  • LearningHow one failed run becomes a test that protects the next release.

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

Choose a small product intervention, specify acceptable and unacceptable behavior, and decide whether the resulting customer benefit justifies cost and friction. Engineering implements the checks; the PM makes their purpose and acceptance clear.

01Where Episode 02 left us

At 9:10 on Monday, the reconciliation team opens a spreadsheet comparing four models.

One column is green. The production failure list is unchanged.

The agent still repeats malformed calls, returns fields the downstream system cannot use, and chooses the wrong operation when tool names overlap. In the most serious failure, it processes 847 of 2,347 eligible invoices and stops with 1,500 still waiting.

Episode 01 taught the team to inspect evidence and contributing failures. Episode 02 organized harness decisions into five clusters:

The team can now draw the machine. The next question is practical: what can it change this sprint without replacing the model?

02The sprint that changed no model

The team freezes the model for a controlled comparison. Four decisions change: useful validation feedback reaches the next attempt; outputs follow a versioned contract; tool discovery becomes clearer; and acceptance checks inspect the actual workload.

This is a constructed sprint, not a measured customer result. It shows the mechanism and the comparison to run. The separate benchmark in Section 08 supplies external evidence of a fixed-model intervention, with its limits stated.

Each pattern removes a different kind of avoidable guesswork. None guarantees reliability, and each can block valid work if designed badly.

The four patterns address retries, output, tools, and completion. Section 10 adds three supporting practices for making them durable.

Give the model room to reason where the answer is uncertain. Make scope, authority, and acceptance explicit where the workflow can define them.

03The whole pattern in one table

PhaseMHTE responsibilitiesWhat to inspect
PrepareThe harness selects current evidence and relevant tool descriptions from the environment, using retrieval tools where neededScope, provenance, access, and missing evidence
ProposeThe model generates a response or operation requestMeaning, supported shape, uncertainty
DispatchThe harness applies workflow checks; tools and environment enforce the relevant operation and access limitsPermission for this action, resource, and moment
OperateA tool performs the read or write in the environmentActual result, error, or unknown outcome
VerifyThe harness invokes checks against external state and the task contractCorrect effect, progress, accepted completion
LearnThe team uses recorded evidence to propose and validate a changeGeneralization, counter-metrics, release decision

For business, the job is to define an acceptable result. Product makes scope, uncertainty, and escalation visible. Engineering implements the loop and operations. Security and operations help make boundaries enforceable and recovery workable. Actual decision rights depend on the organization.

Figure 01 · Patterns
Four ambiguity reducers
AmbiguousSpecific
1 Retry“Try again.”
Retry: Evidence, waiting, or another justified recovery path
2 OutputAny text the model can express
Output: A supported, versioned shape plus business checks
3 ToolsOverlapping or irrelevant choices
Tools: Distinct, discoverable operations with scoped authority
4 CompletionThe model says it is done
Completion: Expected IDs, accepted outcomes, and visible exceptions
Each change removes one decision the model would otherwise improvise.
Figure 01. Four ambiguity reducers. Return useful feedback, specify the output contract, expose relevant capabilities, and verify the business result. Each still needs a failure and escalation path.

04Pattern 1: retry with evidence

“Try again” is weak feedback when the problem is a known violation. The next attempt needs information it can act on.

Weak feedbackUseful feedback
Validation failedamount_minor must be an integer in the currency’s minor unit
Try againYou returned "$42.50"; for this USD example return 4250
Wrong formatCorrect this field only; preserve the source record ID and other validated fields

The stronger feedback gives the field, observed value, rule, and correction scope. It must not expose another tenant (a customer or organization with its own data and access scope)’s data or leak internal secrets through an error message.

Choose recovery by failure class

FailureNext stepWhat would make repetition harmful?
Invalid structureReturn the exact validator error and permit a bounded correctionRepeated sampling without addressing the violation
Business-value mismatchRetrieve the correct source or resolve the rulePolishing a value that belongs to another invoice
Temporary connection failure on a readWait with bounded backoff, then retry if appropriateExcess load, stale results, or ignoring a persistent outage
Write timeoutMark outcome unknown; inspect operation status or use supported idempotencyDuplicating a write whose reply was lost
Permission deniedStop, narrow scope, or obtain an authorized grantTrying another route to evade the denial
Goal incompleteResume from verified progress within task limitsReprocessing completed records or looping forever

Changing models is a capability choice, not an authority grant. A temporary failure can justify the same input after a wait; not every useful retry needs a new prompt.

The harness chooses the recovery path and budgets. The model may propose a correction or alternative method. The tool returns precise errors and exposes its operation-status or duplicate-prevention contract. The environment supplies the resulting state and service guarantees.

Track recovered first-attempt failures alongside wrong outcomes, duplicate effects, cost, and time. A higher recovery rate is not an improvement if the “recovery” silently damages records.

PM requirement

name the recoverable failure, feedback supplied, maximum attempts, progress signal, unknown-outcome handling, and escalation owner.

Idempotency and cryptographic integrity solve different problems

Idempotency means repeating the same intended operation does not create an additional effect. Suppose an adjustment request uses the stable key R17. The service saves adjustment A9, but the reply is lost. If that service supports the key under its stated rules, retrying R17 returns or refers to A9 instead of creating a second adjustment. A newly invented key can defeat that protection.

The harness preserves the key and tracks uncertainty. The tool exposes the request and status contract. The receiving service in the environment implements duplicate prevention. The model’s confidence cannot establish whether the write occurred.

Cryptographic integrity is different. A digital signature is a mathematical check attached to a record. With a trusted signer and protected signing credentials, it can help identify the signer and detect later changes. It does not stop the request executing twice, prove the invoice value correct, or authorize the action. Two duplicate wrong adjustments can each have an intact signed record.

Remember

prevent duplicate effects; detect record changes; verify business truth; check authority. Those are four different jobs.

05Pattern 2: constrain the output space

A structured response gives downstream systems a contract they can parse. It reduces structural ambiguity; it does not prove that the values are true.

For an illustrative invoice-matching result:

FieldStructural contractBusiness check still required
invoice_idRequired stringExists, is unique in scope, and belongs to the current tenant
currencySupported currency codeMatches the source invoice and downstream operation
amount_minorIntegerUses the currency’s unit; sign and permitted range follow this workflow’s rules
due_dateDate string or explicit null with reasonIs an actual calendar date and matches the source; unknown is not invented
match_statematched, unmatched, or needs_reviewEvidence supports the state and required follow-up is recorded
evidence_refsList of source referencesReferences resolve to authorized evidence for this decision

Do not treat a non-empty vendor name as entity resolution. Two companies can share a name. Do not assume a YYYY-MM-DD-looking string is a valid date. Do not prohibit negative amounts across every invoice workflow: credit notes may require them.

Also avoid compressing distinct concepts into one status field. An invoice can be disputed and overdue at the same time. Separate business dimensions when consumers need both.

OpenAI’s documentation distinguishes valid JSON (a structured text format for fields and values) from adherence to a supported strict schema. Applications still need to handle refusals and interrupted responses, and valid structure does not establish semantic (about the business meaning rather than only the data shape) correctness. OpenAI: Structured model outputs

Shape is one check. Source agreement, business meaning, authority, and job completion need their own evidence.

Treat the schema as an API

Version changes, identify consumers, test compatibility, and define what happens when no valid answer exists. An explicit needs_review state can preserve uncertainty; it must not become a bin for hiding failed work from completion metrics.

Track schema validity separately from business correctness and accepted workflow completion. The model proposes values; the harness invokes parsing and acceptance checks; tools validate their inputs and read authoritative records; the environment stores the source and resulting state.

PM requirement

identify the consumer, required and unknown values, semantic checks, refusal path, migration plan, owner, and counter-metrics (checks for new harm or tradeoffs introduced by the change).

06Pattern 3: narrow the decision surface

Tool count alone does not determine performance. The difficulty depends on overlapping meanings, context, descriptions, model capability, and whether the relevant operation can be discovered.

The goal is a clear set of relevant capabilities—not the fewest possible tools or one wrapper for every raw API (a programmatic interface for requesting operations from another application) endpoint.

Vague operationClearer contractDecision clarified
query_dataget_invoice_by_idExact invoice lookup under explicit tenant scope
run_analysislist_overdue_invoicesFiltered list with defined dates and pagination
update_recorddraft_payment_adjustmentDraft creation, not payment execution
refundSeparate draft and issue operationsPreparing a proposal versus changing payment state

A precise name helps the model choose. It does not enforce permission. A renamed tool can still operate on the wrong account if its inputs and access checks are weak.

Progressive disclosure, with discoverability

Keep concise descriptions available so the model or harness can discover a needed capability; load detailed instructions and specialized tools when the task needs them. Test rare paths as well as common ones. Hiding an escalation operation that the agent cannot discover makes a tidy catalog and an incomplete product.

Audit dimensionQuestion
ContributionDoes this operation help complete a distinct user job?
OverlapCan the model distinguish it from neighboring operations?
ConsequenceWhat happens if the wrong resource or action is selected?
DiscoveryCan uncommon but necessary work find it?
AuthorityWhat grant and receiving-system checks govern execution?
EconomicsDoes changing discovery or tool definitions affect tokens, caching, or latency?

Caching rewards reusable input, while dynamic tool exposure can change the request prefix. Measure actual cache use rather than assuming either a fixed catalog or dynamic discovery is always cheaper.

Try keep, rename, tighten, group by user intent, defer, require approval, merge, or remove. A general-purpose shell or browser needs the same authority analysis because it may provide another route to an operation hidden from the named tool list.

PM requirement

name each tool’s job, side effects, negative boundary, discovery route, approval policy, owner, and selection test. Track correct completion and dangerous selection separately; fewer calls are useful only if the task and its limits still hold.

If your B2B product is itself called by agents, this is also an adoption decision. Provide current operation descriptions, examples, permission rules, useful errors, pagination behavior, and a way to inspect results. An integration that requires a human to translate every error transfers work to the customer. A machine-readable protocol can help distribute the interface; it does not replace a clear, usable contract.

07Pattern 4: verify before exit

The invoice agent’s response can be valid while the job remains incomplete. The harness must distinguish finishing a turn, ending a run, confirming an operation, and accepting the business outcome.

CheckRequired evidence
ScopeTenant, eligibility rule, cutoff, and a stable source version or explicit change-handling policy
CoverageExpected invoice IDs agree with accounted-for IDs; duplicates and omissions are detected
QualityMatching and reconciliation rules pass against source evidence
ExceptionsUnresolved cases have valid states and an acknowledged receiving path, reported separately
AuthorityRelevant actions complied with the task’s grant and required controls

Equal counts are insufficient: duplicate processing can hide omitted records. A list of assigned exceptions is not proof that finance resolved them. Define whether the automated stage may complete after a valid handoff, then show the remaining business work.

Anthropic’s current workflow documentation explicitly distinguishes a completed run from successful child work. That is an API lifecycle fact, not a universal definition of your customer’s success. Anthropic: Workflow runs

Continuation needs limits

When coverage fails, resume from verified progress or escalate. Bound elapsed time, total cost, attempts without progress, and nested workers. Record the reason for a pause and who can unblock it.

An approval pause can consume a customer’s deadline even while no model call runs. Cancellation may stop new operations while leaving an already submitted write unresolved. A completion check needs a truthful incomplete state, not only “retry” and “success.”

The model can propose that the job is done. The harness applies acceptance rules. Tools retrieve the effects and source records. The environment supplies the business state and persistence needed to check those claims.

08The measured receipt

LangChain reports holding gpt-5.2-codex fixed while changing prompt, tools, and middleware (software hooks that run around model or tool calls). On the 89-task Terminal Bench 2.0 benchmark, its reported score rose from 52.8% to 66.5%—13.7 percentage points. The intervention combined several changes, so it does not isolate a universal contribution from any one pattern. It is older company-reported benchmark evidence, not a prediction for your workflow. LangChain: Improving Deep Agents with harness engineering

Use the comparison method: define tasks and acceptance; preserve the original configuration; inspect failed traces; make a targeted change; repeat variable runs; and examine both improved and regressed cases.

Failure to improve after several attempted interventions does not prove the harness is irrelevant. The chosen interventions, sample, or evaluator may be weak. Compare plausible explanations—including model capability, source quality, tool behavior, and the task definition—before choosing the next experiment.

09The feedback loop

A production trace (a record of the steps, operations, and evidence in a run) records what happened. It becomes an eval (a repeatable check against a stated criterion) only after the team states what should have happened.

StageInvoice example
TraceAgent used list_invoices_by_status despite an exact ID
Failure labelWrong tool selected when invoice_id is explicit
EvalExact-ID cases must retrieve the correct scoped invoice without broad or unauthorized search
ChangeAdd a negative boundary to the list tool
HoldoutTest new exact-ID and ambiguous cases not used to design the fix
ShipRelease if selection improves without harming ambiguous search

A holdout set contains test cases the team does not use while designing the change. It checks whether the improvement extends beyond the examples that inspired it.

A small set of well-labeled real failures can reveal mechanisms that a large generic set misses. It still needs representative successes, rare consequential cases, and a sampling plan; size alone does not establish coverage.

Figure 02 · Loop
Trace to evaluation and controlled release
01TraceWhat the run actually did
02LabelWhat should have happened
03EvaluationThe rule, written as a test case
04ChangeOne surface: prompt, tool, or hook
05HoldoutCases not used to design the change.
06Staged releaseOutcome checks, counter-metrics, and exposure limits support release.
Release feeds the next observation
Figure 02. Trace → label → evaluation → change → holdout → staged release. Counter-metrics and production monitoring qualify the release decision.

10Three practices that keep the four changes working

The four patterns are interventions. These three practices help them survive handoffs, long sessions, and system changes.

Practice 1: give the agent a map, not an undifferentiated manual

Use a short entry point to identify authoritative rules, tools, and task-specific references. Load detail when needed, while testing that mandatory policy is retrieved before consequential decisions. “On demand” is not permission to omit a rule the workflow requires.

Keep scope, acceptance evidence, and stopping conditions visible. Open-ended planning and repeated self-review should earn their cost through better outcomes, not the appearance of diligence.

Practice 2: make the handoff a checked artifact

A context window is temporary working material. For work that outlives a session, preserve the task ID, source versions, completed and pending operations, evidence, unresolved questions, approvals, and next safe action in durable state.

A weak handoff says: “Finished step three. Continue.” A useful illustrative handoff says:

Policy index version 14 is saved. Retrieval passed 28 of 30 test cases. Two German-language cases still return version 13. Do not release. Evidence: retrieval-report-14. Next action: inspect locale routing.

The receiving worker must check consequential claims against current state. A correct old handoff can become stale while it waits. In multi-agent work, also define write ownership, conflict rules, deadlines, and how late results are handled after cancellation.

Practice 3: separate proposal, permission, operation, and acceptance

The model proposes a step. The harness checks task scope and approval. The tool performs the operation within environmental limits. The harness then checks evidence of its effect and the wider task’s acceptance.

Bind approval to the material action details. Recheck relevant state and grants at execution because records, recipients, amounts, or permissions can change while waiting. A prior approval and a returned success code answer different questions.

One-week experiment

MeasureBeforeAfter
Accepted completion on the same task set
Correct refusal or safe handoff, reported separately
Cost per accepted result, including failed attempts
Duplicate or unknown effects after recovery
Human investigation and approval minutes
Legitimate work incorrectly blocked

Set thresholds before inspecting results. Expand to representative traffic only after the comparison supports the change.

Figure 03 · Practice
Three practices supporting the four patterns
01 Find current rulesA short entry point says where authoritative rules live; detail loads on demand.
02 Preserve a checked handoffPlan, evidence, open questions, and next action stored outside the conversation.
03 Separate proposal, permission, and acceptanceProposal, authorization, and acceptance evidence are distinct steps.
The model proposes; the harness checks and manages; tools operate within environment limits; evidence supports acceptance.
Figure 03. Three supporting practices. Find current rules, preserve a checked handoff, and separate proposal, permission, operation, and acceptance. These support the four patterns rather than renumbering them.

11In practice: one sprint

Pick one high-volume model decision or one failure with serious consequences.

MoveActionPrimary metricCounter-metric
RetryReturn the exact violation and correction scopeRecovery after first failureWrong outcome after retry
OutputEnforce one versioned shapeSchema-valid outputSemantic correctness
ToolsShow relevant tools; rename one vague operationCorrect-tool selectionValid completion rate
CompletionAdd one external business check before exitValid completed workflowsLoops and escalations
LearningTurn the next failed trace into an evalTime to regression coverageHoldout regressions

Treat Learning as the supporting practice across the four interventions. Do not ship all interventions at once if that prevents a useful comparison. Start with the failure that appears most often or carries the largest consequence.

For the selected move, complete this record:

FieldRecord
EvidenceTrace, validator result, tool call, ledger state, or missing artifact
Immediate containmentWhat reduces harm before the full repair ships
Long-term repairThe smallest durable change to the harness
OwnerPerson or team able to make and maintain the change
Regression caseCases testing the failure and legitimate behavior under stated conditions
Release decisionShip, hold, narrow, or revert

12Connecting the dots

The four patterns share one design principle: let the model reason over the uncertain part, but do not make it improvise the contract around the uncertain part.

A precise error reduces wasted retries. A schema protects downstream systems. A narrow tool surface reduces wrong actions. A completion check lets the organisation trust longer work.

Each constraint can also add latency, cost, maintenance, or blocked edge cases. A stable tool prefix may save cache cost while exposing too many choices. A completion gate may prevent premature exit while creating a loop. A strict schema may protect a downstream system while rejecting a legitimate new case.

That tension is the bridge to Episode 04. The next question is not whether constraints work. It is when they buy enough reliability, when they limit useful autonomy, and when a stronger model makes them unnecessary.

You now hold four ambiguity reducers: evidence in the retry, a versioned output shape, a narrowed tool surface, and an external completion check. You also hold the loop that turns one failed trace into a regression test (a repeatable check for behavior that a later change might break). Episode 04 asks when each constraint buys reliability, and when it quietly costs autonomy.

Remember the product decision

Feedback · Shape · Tools · Completion.

  • Give recoverable failures useful feedback.
  • Check shape and business meaning separately.
  • Make needed operations discoverable and authorized.
  • Close the job using evidence of the outcome.

Idempotency prevents duplicate effects. Integrity protection helps detect record changes. Neither alone establishes correct business meaning or authority.

You now hold
Patterns 03 Four ambiguity reducers: evidence in the retry, a versioned output shape, a narrowed tool surface, and an external completion check. You also hold the loop that turns one failed trace into a regression test.
The next question
When does a constraint buy reliability, and when does it quietly cost autonomy, latency, or a legitimate edge case?
Continue
Harness 04 Five Paradoxes Every PM Must Hold → — when a constraint buys reliability, and when it quietly costs autonomy.
Read alongside
Environment 02 Construct the Task World → — where the completion evidence in Pattern 4 comes from.
Sources
  1. OpenAI: Structured model outputs. Current documentation, checked November 3, 2026 · schema adherence and its limits.
  2. Anthropic: Workflow runs. Current documentation, checked November 3, 2026 · lifecycle semantics for this API.
  3. LangChain: Improving Deep Agents with harness engineering. Older foundational experiment · company-reported fixed-model benchmark result.