Take a billing support agent. It passes its demo in about ninety seconds: it reads a ticket about a duplicate charge, finds the invoice, writes a polite reply, and refunds the right amount. Six weeks later it is draining the overnight queue with nobody watching, and it refunds $940 on an account whose only invoice is $120. This agent is invented: it is the running example this series and its book are built around.
The tempting fix is a newer model.
Nothing in that run needed better reasoning. A customer typed a number, the model believed it, and no line of code compared $940 with the invoices before the payment API ran. The demo never needed that line, because the amount its customer quoted was the amount actually billed.
Teams that see this usually reach for the published proof that harness engineering pays. LangChain's coding agent jumped 13.7 points on Terminal Bench 2.0 with the model held still. The lesson most of them take from it is portable-sounding: add a verify-before-exit step. They copy it into an agent that moves money, and it does much less there than it appears to.
Does harness engineering work outside coding agents?
A newer model will not fix the $940, and the evidence that a harness will was measured somewhere else. LangChain's 13.7 points came from a coding agent scored by the benchmark's own tests. Stripe's thousand agent-written pull requests a week went through the codebase's continuous integration (CI) and then human review. OpenAI's million-line Codex build is the third famous result and the weakest evidence of the three, for a reason covered below. Newer results outside coding, on customer service and legal work, were scored by an oracle someone had to build: a database-state comparison, or a language model judging against per-task criteria.
Justifying harness work in a domain without an oracle, using results measured in one that has it, is what I call Borrowed Evidence. The term names the act, not the results. Clinical trials borrow in the same sense when they extend adult results to children, and the rule carries over: a borrowed result holds only as far as its mechanism is present where you use it.
Where the oracle sat decides how far a result carries, and there are three places it can sit. A measurement oracle scores runs after the fact, which is how a result gets a number. A selection oracle labels runs as successes or failures while the harness is being improved, so the team knows which change to keep. An in-loop oracle gives the agent its verdict during the run, before it stops. Every published quality result I found was scored by an oracle that came with its domain or that a benchmark team built. None came from a domain where nobody had built one. An intervention transfers to a domain without an oracle only if its mechanism did not need an in-loop one.
The three places sit at different times in a harness's life, and each published result used them differently.
grid-rows: 2
grid-columns: 3
grid-gap: 10
p1: "1. Selection oracle\nwhile the harness is improved:\nwhich change to keep" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
p2: "2. In-loop oracle\nduring the run:\na verdict before the agent stops" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
p3: "3. Measurement oracle\nafter the run:\nthe number in the post" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"}}
e1: "IBM's mined guidelines\nLangChain's tuned settings" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
e2: "LangChain's verify step\nruns tests in a sandbox" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
e3: "Every published result\nbenchmark tests, CI, DB check, judge" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
Only the middle column has to exist inside your own agent's run. The other two are how a team learns and how it proves what it learned, and a billing team can supply them later, from incident review, without changing the mechanism.
LangChain's verify-before-exit step needed an in-loop oracle. For that intervention the result fits in one line: the hook transfers once you move it in front of the action, and the oracle its check read does not come with it. LangChain's hook is deterministic code that fires before the agent stops and reminds it to run a verification pass, which in a coding agent means running tests. In a refund queue a check at exit runs after the money has moved, so the hook has to sit in front of each refund instead. What carries over is that interception point, not the reminder. With no external check behind it, the moved hook still makes the model grade its own work. Self-correction "works well in tasks that can use reliable external feedback" (Kamoi et al., 2024), and a refund queue has none wired into the loop by default. Ceilings, such as a cap on refunds per run, need no verdict at all, so they transfer as mechanisms, with thresholds you re-tune. Borrow those first, and rebuild the verify step around an input the model did not produce.
Why a stronger model does not close the demo cliff
The book this series follows calls the gap between the demo and production the Demo Cliff. It is the distance between the inputs a system was shown and the inputs it will meet. Whoever wrote the prompt also chose the demo tickets, so the demo over-samples exactly the inputs the prompt expected. Production sends everything else: the customer who churned and came back under a new billing entity, the charge already disputed with the card issuer, the ticket thread so long that the refund ceiling fell out of the summarised context at turn 30.
Here is the shape I expect a model upgrade to have. It is a model of the mechanism, not a measured curve, and an upgrade moves only one side of it.
grid-rows: 1
grid-gap: 40
before: "Before the upgrade" {
label.near: top-center
grid-columns: 1
grid-gap: 14
style: {fill: "#F4F6F7"; stroke: "#95A5A6"}
d1: "Demo inputs\nhandled" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
d2: "Ordinary production inputs\noften fail" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
d3: "Rare, costly inputs\nfail" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
}
after: "After the upgrade" {
label.near: top-center
grid-columns: 1
grid-gap: 14
style: {fill: "#F4F6F7"; stroke: "#95A5A6"}
a1: "Demo inputs\nhandled" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
a2: "Ordinary production inputs\nmostly handled" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
a3: "Rare, costly inputs\nstill fail, now most of\nwhat goes wrong" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
}
Row by row, an upgrade fixes the middle band, the ordinary cases a weaker model fumbled. It does little for the bottom band, and nothing you can count on, because your customers and your contracts decide what arrives there, not your vendor's release schedule. If that picture is right, failures get rarer and the ones left cost more. On a dashboard that looks like progress, and a postmortem rarely blames an upgrade that visibly helped. Give a stronger model an invoice-lookup tool and it may check more often. More often is a rate, and a refund queue needs a rule.
An upgrade can also break deterministic code that was correct, by changing the contract that code relied on. In July 2026, Discourse users who switched to Anthropic's Sonnet 5 found requests rejected with This model does not support assistant message prefill, and the thread's title names the fix: removing the JSON response setting (Discourse Meta, 2026). A year earlier, developers moving to GPT-5 found that it no longer emitted the markdown a renderer expected (OpenAI Developer Community, 2025). In both cases the deterministic code was correct for the old model and wrong for the new one, and nobody had changed it.
What scored the harness engineering results everyone cites
Whether reliability lives in the code around the model is no longer a matter of taste. In February 2026, LangChain and Stripe put numbers on it. OpenAI also published a build report.
LangChain moved deepagents-cli "13.7 points from 52.8 to 66.5 on Terminal Bench 2.0," which its summary calls going "from Top 30 to Top 5", and the post is explicit about the control: "We only tweaked the harness and kept the model fixed, gpt-5.2-codex" (Trivedy, 2026). Stripe reported that "Over a thousand pull requests merged each week at Stripe are completely minion-produced," built on a fork of Block's goose, and adds that those pull requests are human-reviewed (Gray, 2026). OpenAI described an internal product built by Codex agents over five months, passing a million lines of code (OpenAI, 2026, figures as summarised by Böckeler). Of the three, it says least about how the output was checked. Birgitta Böckeler's review of the post puts it plainly: "What I am missing in the write-up is verification of functionality and behaviour" (Böckeler, 2026).
Since then the evidence has spread beyond coding. IBM's ALTK-Evolve raised gpt-4.1 from 57.5 to 67.5 Pass^4 on the 40 held-out test tasks of the τ²-bench retail domain. IBM's only change was learned guidelines appended to the system prompt (IBM Research, 2026). Harness², from Google Cloud AI Research, reported up to 11.8 points on the LAB Partial score of Harvey's legal benchmark with frozen executor models. It has not been independently replicated, and its authors warn that "execution stochasticity and shared model biases limit the reliability of the evidence" (Chen et al., 2026).
The claim that harnesses only help coding agents is out of date. For your agent, the column that matters is the right-hand one below.
grid-rows: 7
grid-columns: 3
grid-gap: 8
h1: "Result" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
h2: "Domain" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
h3: "What scored each run" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
r1a: "LangChain, +13.7\nTerminal Bench 2.0" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
r1b: "Coding" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
r1c: "Benchmark tests in a sandbox\n(came with the benchmark)" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
r2a: "Stripe Minions\n1,000+ PRs a week" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
r2b: "Coding" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
r2c: "CI, then human review\n(came with the codebase)" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
r3a: "OpenAI Codex build\n~1M lines" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
r3b: "Coding" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
r3c: "Not described in the post\n(Böckeler flags the gap)" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
r4a: "IBM ALTK-Evolve\n+10 Pass^4, tau2-bench" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
r4b: "Customer service" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
r4c: "Final database state vs expected\n(built by the benchmark)" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
r5a: "Harness², +11.8\nHarvey LAB" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
r5b: "Legal work" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
r5c: "LLM judge vs per-task rubric\n(built by the benchmark)" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
r6a: "Your billing agent" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
r6b: "Refunds" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
r6c: "Nothing yet" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
Four of the five published rows name a scorer. In the LangChain row the benchmark supplied it, and in the Stripe row it was the codebase's own CI followed by human review. The OpenAI row is orange because the post does not say. In the two newer rows a benchmark team built the scorer, and IBM's post describes the τ²-bench check as "a strict binary reward." The bottom row is the system you are trying to justify.
The IBM row shows why the three places matter. ALTK-Evolve's guidelines sit in the system prompt, so the agent gets no in-loop oracle, and that mechanism could work in a domain with none. The guidelines were mined from the successes and failures of training tasks, though, and telling those apart needs a selection oracle. The gain was then measured by the database check, a measurement oracle. So the intervention may transfer, while the method that found it and the number that proves it do not. An LLM judge counts as a measurement oracle in the Harness² row for a related reason: it scores against per-task criteria written by someone who knew the right answer, which a model checking its own proposal does not have. Harness² also shows the places coming apart in practice. It improved harnesses using "behavioral contrasts without immediate or delayed correctness labels", so with no selection oracle, and it still needed the judge to measure the gain.
Why coding agent results do not transfer whole: Borrowed Evidence
Software testing calls the mechanism that decides whether an output is correct the oracle (Barr et al., 2015). A coding agent usually inherits one from the codebase. Apply the patch, run the suite, read the exit code. The billing agent gets nothing back unless someone wires the system of record into the loop, and even then only a partial answer.
grid-rows: 1
grid-gap: 50
coding: "Coding agent" {
label.near: top-center
style: {fill: "#F4F6F7"; stroke: "#95A5A6"}
agent: "Agent" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
patch: "Patch" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
tests: "Test suite\nexit code in seconds" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
agent -> patch: "1. propose"
patch -> tests: "2. run"
tests -> agent: "3. pass / fail"
}
billing: "Billing agent" {
label.near: top-center
style: {fill: "#F4F6F7"; stroke: "#95A5A6"}
agent: "Agent" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
refund: "Refund\nmoney moves" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
person: "A person, later:\ncontract, policy, intent\nafter the payout" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
agent -> refund: "1. propose and execute"
refund -> person: "2. maybe reviewed" {style: {stroke-dash: 4}}
}
On the left, the signal returns to the agent before anything ships. On the right, the only judge of whether a refund was right, and not merely possible, is a person, who needs the contract, the refund policy that applied that day, and an idea of what the customer meant. That judgement arrives after the money has gone, if it arrives at all, and nothing feeds it back into the agent's loop.
A team in that position has to borrow, because it cannot yet produce its own number. Borrowing honestly takes one step for each intervention you copy: name where its oracle sat, and what you are putting in that place.
Clinical trials have dealt with this for years. ICH E11A, the paediatric extrapolation guideline adopted in August 2024, ties how far adult trial results may be extended to children to an assessment of "similarity of disease, drug pharmacology, and response to treatment between a reference and paediatric target population" (RAPS, 2024; ICH, 2024). Regulators ask whether the mechanism that produced the evidence is present in the new population. Ask the same of a benchmark.
The transfer test: which LangChain interventions survive losing the oracle
LangChain's post is specific about what changed, which makes it a good test case. A LocalContextMiddleware maps the working directory at startup. A LoopDetectionMiddleware "tracks per-file edit counts via tool call hooks." Time-budget warnings nudge the agent "to finish work and shift to verification." A per-phase reasoning-effort split, "xhigh-high-xhigh," replaced running at maximum effort throughout, which "scored poorly at 53.9% due to agent timeouts." And a PreCompletionChecklistMiddleware "intercepts the agent before it exits and reminds it to run a verification pass against the Task spec."
The verification pass targeted the most common failure, in which "the agent wrote a solution, re-read its own code, confirmed it looks ok, and stopped." LangChain's prompt said "Run tests, read the full output, compare against what was asked (not against your own code)," and told the agent that its "work will be measured against programatic tests." The benchmark's own tests stayed hidden, so the tests the agent ran were, as far as the post shows, ones it wrote, and the model did touch the specification it checked against. What it did not produce was the result of running them. The interpreter produced that, inside a sandbox, and the benchmark then scored the run with its own checks. The verify step was designed to point the agent at execution, although LangChain does not report its gain separately.
Naming the borrowing is only useful if it changes what you copy, and this blog has already sorted these interventions once. The inner-versus-outer harness article asked which ones survive the next model, and put the verification pass and the directory map on the durable side. Loop detection and the budgets landed on the disposable side, because LangChain itself says "As models improve, these guardrails will likely be unnecessary." That sort is correct. It answers a different question from this one: which survive losing the oracle?
grid-rows: 3
grid-columns: 3
grid-gap: 10
c0: "" {style: {opacity: 0}}
ch1: "Needs no in-loop oracle" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
ch2: "Needs an in-loop oracle" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
rh1: "Survives the\nnext model" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"; bold: true}}
x1: "Environment context\ndirectory map, or invoice\nstate and run mode" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
x2: "Verify-before-exit\nthe hook transfers if moved\nbefore the action;\nits oracle does not" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
rh2: "Compensates for\nthis model" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"; bold: true}}
x3: "Loop detection, time budget,\nreasoning-effort split\n(re-tune their settings)" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
x4: "None of\nLangChain's changes" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
Put side by side, the two sorts disagree on one intervention, and it is the one teams most like to copy. The verify step survives model changes and depends on an in-loop oracle. The interventions LangChain expects to delete need no in-loop oracle. Their settings did come from a selection oracle, though: the whole recipe iterated against Terminal Bench 2.0, and running at xhigh throughout was dropped after it scored 53.9% against 63.6% at high. Their mechanisms transfer, and their numbers have to be re-tuned on your own runs. A counter that notices the agent editing the same file for the tenth time needs no verdict on whether the edits were right. A time budget needs a clock, although LangChain's warning also steered the agent towards verification, which in a refund queue has to point at something else. Context injection needs a correct source of facts. For the billing agent that is the invoice table, plus the run's mode, supervised copilot or overnight queue drain, which decides how much it may do alone.
In a billing agent the counter and the clock stay useful even if better models make them less necessary, because they limit how often a wrong action can repeat. A ported verify step keeps its hook and loses the thing the hook pointed at. Kamoi et al. already state the general rule, that self-correction needs reliable external feedback. The claim here is narrower: applied one intervention at a time, that rule moves the verify step across the line that the model-durability sort drew.
Why LLM self-verification fails without an oracle
If the refund tool pays on call, the step cannot wait for exit, because by then the money has moved. Staging refunds and committing them in one batch at exit is the other way to put the hook in front of the action. The port below gates each refund instead. LangChain's instruction was to compare the work "against what was asked." In a billing agent, what was asked is the ticket. Both model functions below are deterministic stand-ins, so the example runs without a key. model_propose does what a real model does with this ticket and takes the customer's number on trust. model_self_check gets the best case a real model offers in that seat: a hunch that a refund over $500 looks wrong. The hunch is real, and it comes from training data, not from any account's ledger. So it can catch a number that looks wrong and has no way to catch one that looks fine. A fourth ticket, T-104, asks for $450 back on an account billed $45.
from collections.abc import Callablefrom dataclasses import dataclass, fieldfrom decimal import Decimal@dataclass(frozen=True)class Proposal: tool: str account_id: str amount: Decimal@dataclassclass Ledger: """The system of record. Only the drain loops write to it, never the model.""" invoices: dict[str, tuple[Decimal, ...]] refunded: dict[str, Decimal] = field(default_factory=dict) def refundable(self, account_id: str) -> Decimal: billed = sum(self.invoices.get(account_id, ()), Decimal("0")) return billed - self.refunded.get(account_id, Decimal("0")) def refund(self, account_id: str, amount: Decimal) -> None: already = self.refunded.get(account_id, Decimal("0")) self.refunded[account_id] = already + amountTICKETS = [ ("T-101", "acct-1", "Charged twice for March, $120 each. Please refund one."), ("T-102", "acct-7", "You charged me $940 last month and I want it back."), ("T-103", "acct-1", "Resending: charged twice for March, $120 each."), ("T-104", "acct-4", "Please refund the $450 annual plan I cancelled."),]LARGE_REFUND = Decimal("500")def model_propose(account_id: str, text: str) -> Proposal: """Stand-in for the LLM. Like the real one, it takes the ticket's number on trust.""" amount = Decimal(text.split("$")[1].split()[0].rstrip(".,")) return Proposal("issue_refund", account_id, amount)def model_self_check(proposal: Proposal, text: str) -> bool: """The borrowed verify step, run before each refund, against what was asked.""" # A real self-check prompt: "Compare this refund against what the customer # asked for: <ticket text>. Reply VERIFIED or REJECTED." The ticket is all it sees. if proposal.amount > LARGE_REFUND: return False # the model's hunch: big refunds look suspicious return f"${proposal.amount}" in textdef drain_self_checked(ledger: Ledger) -> Decimal: moved = Decimal("0") for ticket_id, account_id, text in TICKETS: proposal = model_propose(account_id, text) if not model_self_check(proposal, text): print(f"{ticket_id}: escalated, self-check rejected {proposal.amount}") continue ledger.refund(proposal.account_id, proposal.amount) moved += proposal.amount print(f"{ticket_id}: refunded {proposal.amount} (self-check passed)") return movedLook at the signature of model_self_check. Its inputs are the proposal and the ticket text, and the ticket text is what produced the proposal. A check that sees only the evidence that misled the model has no new information to disagree with. A real model in the checker's seat does not supply that information either. Huang et al. (2024) found that without external feedback GPT-3.5 kept its first GSM8K maths answer 74.7% of the time, and that when it did change an answer it was "more likely to modify a correct answer to an incorrect one than to revise an incorrect answer to a correct one," and Stechly et al. (2025) observed "significant performance collapse with self-critique and significant performance gains with sound external verification." Both studies measure answers to reasoning and question-answering tasks, not checks on actions. Carrying them over to a refund check is my argument, and the inputs in the stand-in are why I think it holds.
direction: down
ticket: "T-104 ticket text\n\"refund the \$450\"" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
propose: "model_propose" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
check: "model_self_check\nunder 500, matches ticket" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
pay: "refund 450 executed" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
ledger: "Ledger: acct-4 billed 45\nnever read" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"; stroke-dash: 4}}
ticket -> propose: "1. read"
propose -> check: "2. proposal"
ticket -> check: "3. compare against\nwhat was asked"
check -> pay: "4. passes"
Both inputs to the check trace back to the same orange box. Meanwhile the ledger, the one source that knows acct-4 was billed $45, sits on the page with no edge into it. Run the full script, both listings together, and the self-checked half prints:
T-101: refunded 120 (self-check passed)T-102: escalated, self-check rejected 940T-103: refunded 120 (self-check passed)T-104: refunded 450 (self-check passed)moved 690The hunch stopped the one number that looked wrong and passed the one that looked fine. $690 left the business, and $120 of it was owed.
How to check an agent's action against the system of record
To port it properly, keep the hook and change what happens there. LangChain's hook only reminded the model to verify, and the model did the verifying. What transfers is the interception point itself: a deterministic place between "the model has decided" and "the system acts," moved in front of the action. In the port, code at that point makes the decision. It checks the ledger, which the model did not write and cannot edit, and it sits next to two ceilings, on how many refunds one run may execute and on how much money they may move.
MAX_REFUNDS_PER_RUN = 20MAX_REFUND_TOTAL_PER_RUN = Decimal("1000")def refund_comparator(proposal: Proposal, ledger: Ledger) -> str | None: """A check whose input the model did not produce: the ledger, not the ticket.""" if proposal.tool != "issue_refund": return f"unknown tool {proposal.tool}" if proposal.amount <= 0: return f"non-positive amount {proposal.amount}" room = ledger.refundable(proposal.account_id) if proposal.amount > room: return f"{proposal.amount} exceeds refundable {room} on {proposal.account_id}" return NoneComparator = Callable[[Proposal, Ledger], str | None]def drain_gated( ledger: Ledger, max_refunds: int = MAX_REFUNDS_PER_RUN, max_total: Decimal = MAX_REFUND_TOTAL_PER_RUN, comparator: Comparator = refund_comparator,) -> Decimal: moved, executed = Decimal("0"), 0 for ticket_id, account_id, text in TICKETS: if executed >= max_refunds: print(f"{ticket_id}: stopped, ceiling of {max_refunds} reached") break proposal = model_propose(account_id, text) refusal = comparator(proposal, ledger) if refusal: print(f"{ticket_id}: escalated, {refusal}") continue if moved + proposal.amount > max_total: print(f"{ticket_id}: stopped, total ceiling of {max_total} reached") break ledger.refund(proposal.account_id, proposal.amount) moved += proposal.amount executed += 1 print(f"{ticket_id}: refunded {proposal.amount}") return moveddef fresh_ledger() -> Ledger: return Ledger(invoices={ "acct-1": (Decimal("120"), Decimal("120")), "acct-7": (Decimal("120"),), "acct-4": (Decimal("45"),), })if __name__ == "__main__": print("-- self-checked --") print(f"moved {drain_self_checked(fresh_ledger())}") print("-- gated --") print(f"moved {drain_gated(fresh_ledger())}") print("-- comparator broken, ceiling of 1 --") broken: Comparator = lambda proposal, ledger: None print(f"moved {drain_gated(fresh_ledger(), max_refunds=1, comparator=broken)}")Proposer and tickets are unchanged. Two things differ: the ledger reaches the decision instead of the ticket, and code makes the decision instead of the model. A ceiling sits beside it now as well.
direction: down
ticket: "Ticket text" {style: {fill: "#FFA07A"; stroke: "#D9785A"; font-color: "#2C2C2A"}}
propose: "model_propose" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
ledger: "Ledger\nsystem of record" {style: {fill: "#98D8C8"; stroke: "#5FA898"; font-color: "#2C2C2A"}}
comp: "refund_comparator\n+ per-run ceiling" {style: {fill: "#7B68EE"; stroke: "#5A4BC4"; font-color: "#FFFFFF"}}
out: "Outcome" {
grid-rows: 1
grid-gap: 16
style: {fill: "#F4F6F7"; stroke: "#95A5A6"}
ok: "T-101, T-103\nrefunded 120" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
esc: "T-102, T-104\nescalated" {style: {fill: "#FFD93D"; stroke: "#C9A800"; font-color: "#2C2C2A"}}
}
ticket -> propose: "1. read"
propose -> comp: "2. proposal"
ledger -> comp: "3. refundable amount"
comp -> out: "4. decide"
The comparator reads an input the model did not produce: the ledger's refundable balance. LangChain's verify step had the same property in a different place, because the model wrote the tests but the interpreter produced the result of running them. The self-check has no such input. Here is the full script's output:
-- self-checked --T-101: refunded 120 (self-check passed)T-102: escalated, self-check rejected 940T-103: refunded 120 (self-check passed)T-104: refunded 450 (self-check passed)moved 690-- gated --T-101: refunded 120T-102: escalated, 940 exceeds refundable 120 on acct-7T-103: refunded 120T-104: escalated, 450 exceeds refundable 45 on acct-4moved 240-- comparator broken, ceiling of 1 --T-101: refunded 120T-102: stopped, ceiling of 1 reachedmoved 120Now the $450 goes to a person along with the $940, and the comparator did not need the $940 to look large. At the defaults neither ceiling fires on four tickets. The last run swaps in a comparator that approves everything, the failure you get when refundable() has a bug, and sets the count ceiling to 1 so the effect fits on the page. Here the count ceiling happens to land before the $940. With a count of 20 alone the broken comparator would have paid it. The total ceiling would not, because $120 plus $940 is over $1,000. A ceiling never decides whether a refund is wrong. It decides how much a broken run can do before someone looks: at most 20 refunds and $1,000 per run, however long the queue is. Count the runs too, because three workers with a ceiling of 20 make a ceiling of 60, and a fallback model's calls may not be counted at all. A wrong comparator fails silently, so give it an owner and its own tests, and keep the counters outside it, so a bug in the comparator cannot disable them. In production the balance check and the refund write also belong in one transaction, a conditional update on the balance. Otherwise two workers can both see the same $120 of room.
Is a balance check an oracle? What partial oracles miss
A skeptical reader will say the billing agent is not oracle-free. "Refund no more than the refundable balance" is a deterministic check, it caught the $940 exactly, and τ²-bench grades refund-issuing agents by database state. Give the verify step a tool that queries the ledger and LangChain's pattern transfers fine.
Half of that is right. Once the check reads the system of record, it is a real check, and calling it self-verification would be wrong: a comparator in code sits in front of the action and fails in different ways. Where the objection goes wrong is the word "oracle". What the comparator gives you is a partial oracle: it checks a property every correct refund must have, and it cannot confirm that a refund which passes is the right one. The term comes from software testing, and The Oracle Problem covers the kinds that transfer to agents.
grid-rows: 5
grid-columns: 2
grid-gap: 8
h1: "What went wrong" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
h2: "refund_comparator" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
f1: "T-102: \$940 on a \$120 invoice" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
v1: "caught" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
f2: "T-103: resent ticket,\nsame refund paid twice" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
v2: "not caught\nbalance allowed it" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
f3: "Charge already disputed\nwith the card issuer" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
v3: "not caught\nnot in the ledger" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
f4: "Contract forbids refunds\nafter 30 days" {style: {fill: "#F4F6F7"; stroke: "#95A5A6"; font-color: "#2C2C2A"}}
v4: "not caught\npolicy, not arithmetic" {style: {fill: "#E74C3C"; stroke: "#A93226"; font-color: "#FFFFFF"}}
T-103 is in the output above for this reason, and the gated run paid it. That customer resent the same complaint, acct-1 had $240 billed and $120 refunded, the balance check saw $120 of room, and the agent paid the duplicate twice. The check was correct and the refund was wrong. A held-out test suite, like the benchmark's, often catches both kinds of error, because it encodes intent. Tests the agent writes in the loop are closer to the ledger check, since they test the agent's reading of the task. What the coding agent still gets free is an interpreter that runs them honestly. An invariant encodes arithmetic. A per-account refund counter, the billing port of LangChain's per-file edit count, would at least flag it. Stopping T-103 needs a key that marks the complaint as already resolved, and the disputed charge and the contract term each need another.
That is why Borrowed Evidence costs something. From a held-out test suite and an interpreter, a coding agent gets four things. Each run gets a verdict. A failing test is a refusal nobody argues with during an incident. A pass is a natural point to stop retrying, and a failure names itself afterwards. The billing agent has to build each one separately.
grid-rows: 5
grid-columns: 2
grid-gap: 8
h1: "A held-out test suite gave" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
h2: "The billing agent builds instead" {style: {fill: "#5D6D6E"; stroke: "#3F4A4B"; font-color: "#FFFFFF"; bold: true}}
g1: "A verdict on every run" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
b1: "Checks derived from past incidents,\nscored after the fact" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
g2: "A refusal nobody argues with" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
b2: "Refusal rules written down\nin advance, with an owner" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
g3: "A point to stop retrying" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
b3: "A ceiling imposed from outside,\non refund count and total" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
g4: "A failure that names itself" {style: {fill: "#6BCF7F"; stroke: "#3F9E52"; font-color: "#2C2C2A"}}
b4: "A record of why each action\nwas allowed, written at the time" {style: {fill: "#4A90E2"; stroke: "#2C6FB0"; font-color: "#FFFFFF"}}
None of the right-hand cells is a prompt. The ceiling and the record need no oracle at all, which is why they are the cheapest place to start. Refusal rules need someone to decide policy. A verdict per run is the expensive one, and a team that cannot yet build it should at least know that every benchmark number it cites was bought with one.
The published proof that harnesses close the demo cliff is real, and citing it for a refund queue is Borrowed Evidence. The hook transfers once it sits in front of the action, and the bounds transfer as mechanisms. Its oracle stayed with the codebase, so you rebuild one from your own system of record.
Checklist: before you copy a published harness result
- Name the scorer. This is the step Borrowed Evidence requires. For every result you cite, write one line saying what decided pass or fail, such as a test suite or an LLM judge, and whether it sat in the measurement, the selection or the loop. If you cannot name it, you cannot judge whether the result transfers.
- Sort each intervention by what it reads. A counter or a ceiling transfers as a mechanism, and its threshold has to be re-tuned on your own runs. Anything that "verifies" transfers only if you can say what external data the check reads.
- Read the self-check's signature. If every input to the verify step is something the model wrote or read before proposing, and nothing comes from running code or querying the real system, it is the model grading itself. Replace it with code that reads the system of record. Handing the model's check that input is the weaker fix, because a comparator in code fails in ways you can test and give an owner.
- Move the hook in front of the action, and replace the check. A deterministic point between the proposal and the action is worth having before you know what to check there. Separate "decide" from "execute" first.
- Ship the bounds that need no verdict. Cap refund count, refund total and wall-clock time per run. My own starting rule is a cap at about twice the busiest run you have logged, tightened once you have a month of data. Caps limit how many times the same wrong action can repeat.
- List what your partial oracle cannot see. For this agent that is resent tickets, which need an idempotency key per complaint, disputed charges, which need a dispute-status lookup, and contract terms, which need a policy rule with an owner. Each needs its own control, and the list is your backlog.
- Before upgrading the model to fix an incident, name the file and line that should have caught it. If you cannot, the upgrade may lower the failure rate and leave the defect in place. Chapter 1 of my book, Harness Engineering for Production AI Systems, turns this question into a fifteen-question audit that accepts only a file and a line number as an answer.
Going deeper
This is Part 1 of a series that follows Harness Engineering for Production AI Systems one chapter at a time. Chapter 1 adds what this article leaves out, chiefly the fifteen-question audit, with a Citation type that refuses prose answers, and the RunState object every later chapter reads. The code for that chapter is the ch01-demo-cliff tag of the companion repository. Its tests need no model and no API key.
For the oracle itself, and the partial oracles you can build when a full one is impossible, see The Oracle Problem: Why Most AI Agent Loops Fail. For the earlier, shorter treatment of the whole harness, see Harness Engineering: The Missing Layer Between LLMs and Production Systems.
References
- Trivedy, V. (2026, February 17). Improving Deep Agents with harness engineering. LangChain. https://blog.langchain.com/improving-deep-agents-with-harness-engineering
- Gray, A. (2026, February 9). Minions: Stripe's one-shot, end-to-end coding agents. Stripe. https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents
- OpenAI (2026). Harness engineering: leveraging Codex in an agent-first world. https://openai.com/index/harness-engineering/
- Böckeler, B. (2026). Harness Engineering - first thoughts. martinfowler.com. https://www.martinfowler.com/articles/exploring-gen-ai/harness-engineering-memo.html
- IBM Research (2026, October 20). ALTK-Evolve on τ²-bench. Hugging Face. https://huggingface.co/blog/ibm-research/altk-evolve-bc
- Chen, Y. et al. (2026). Harness²: Recursive Agent Harnessing for an Open World. arXiv:2610.14224. https://arxiv.org/abs/2610.14224
- Sierra Research. τ²-bench. https://github.com/sierra-research/tau2-bench
- Terminal-Bench. Terminal Bench 2.0 leaderboard. https://www.tbench.ai/
- Block. goose. https://github.com/block/goose
- Huang, J. et al. (2024). Large Language Models Cannot Self-Correct Reasoning Yet. ICLR 2024. https://arxiv.org/abs/2310.01798
- Kamoi, R. et al. (2024). When Can LLMs Actually Correct Their Own Mistakes? A Critical Survey of Self-Correction of LLMs. TACL 12. https://arxiv.org/abs/2406.01297
- Stechly, K., Valmeekam, K., & Kambhampati, S. (2025). On the Self-Verification Limitations of Large Language Models on Reasoning and Planning Tasks. ICLR 2025. https://arxiv.org/abs/2402.08115
- Barr, E. T., Harman, M., McMinn, P., Shahbaz, M., & Yoo, S. (2015). The Oracle Problem in Software Testing: A Survey. IEEE Transactions on Software Engineering, 41(5), 507-525. https://doi.org/10.1109/TSE.2014.2372785
- ICH (2024, August 21). E11A: Pediatric Extrapolation, Step 4. https://database.ich.org/sites/default/files/ICH_E11A_Guideline_Step4_2024_0821.pdf
- Eglovitch, J. S. (2024, August 23). ICH adopts E11A guideline to spur pediatric drug development. RAPS. https://www.raps.org/resource/ich-adopts-e11a-guideline-to-spur-pediatric-drug-d.html
- Discourse Meta (2026, July 8). Discourse AI: Need to remove JSON response to get Anthropic Sonnet 5 working. https://meta.discourse.org/t/discourse-ai-need-to-remove-json-response-to-get-antrophic-sonnet-5-working-in-e-g-semantic-search/407117
- OpenAI Developer Community (2025, August 11). The stupid decision to remove markdowns from the GPT-5 API's JSON response. https://community.openai.com/t/the-stupid-decision-to-remove-markdowns-from-the-gpt-5-apis-json-response/1343335
- Kumar, R. (2026). Harness Engineering for Production AI Systems. Chapter 1, "The Demo Cliff Is Not a Model Problem." https://harness.ranjankumar.in/
Related Articles
- LLM Fallback Models Inherit Authority They Never Earned
- Harness Engineering: The Missing Layer Between LLMs and Production Systems
- Normalization and Input Defense: Hardening the Entry Point of Your LLM System
- LLM Context Window Management: The Policy Nobody Wrote






