- 01. The retry architecture that cuts drift by roughly 60%. And why most teams implement it backwards. (Interception + Orchestration clusters.)
- 02. Why structured output is a reliability pattern, not a formatting convenience. And what changes the moment you treat it that way. (Interception cluster.)
- 03. The narrow-gate principle for tool design: fewer tools, sharper agent. Reveal tools as needed through skills. (Memory Policy cluster.)
- 04. The meta-move that turns these three into a compounding program. The feedback flywheel that converts every production failure into a new eval. (Observability & Evals cluster.)
- 05. The numeric thresholds that make each move measurable. Shopify's 20-50 tools heuristic, the calibration sample size for LLM-as-judge, and the audit cadence that keeps tool sprawl in check.
The Team That Fixed Their Agent Without Touching the Model
An engineer at one of the labs told me this over coffee last month: "We fixed reliability by removing three lines of code and adding two. Nothing touched the model."
His team had spent a quarter chasing a better model. They tried Opus, Gemini 2.5, a fine-tune of their own. Drift stayed. Then a new hire, on week two, rewrote the retry loop, turned on strict JSON mode, and cut the tool list from thirty-one to nine. Drift dropped by over fifty percent in a week. The model they ended up keeping was the one they started with.
Quick check on where we are before we go further. Episode 1 started at 2 AM and reframed the problem, the model is one part, and the real system is four layers standing side by side. Episode 2 opened those four layers into a street map; the harness got its own five-part anatomy because that is the layer you own. So the map is drawn. What has been missing until now is the answer to the obvious next question: what do I actually change on Monday?
This episode provides answers. Three small changes on the map you just built, each pinned to a specific cluster inside the harness, Interception, Memory Policy, Orchestration, plus one meta-move in Observability & Evals that turns the three into a compounding program instead of a one-week win. It is also the exact sprint the reconciliation team from Episode 2 runs the week after their whiteboard session, which is why you will recognize their invoices in every code block below. The fastest way to learn these patterns is to watch them land on the workflow that was failing at 2 AM.
One rule from Episode 1 still holds while you read: the user stays outside the stack. The request did not change, the task did not change, the user did not change. The moving part is always in the harness. A change you cannot locate on the map is a change you cannot make twice.
The idea in one boxReliability is bought with small deterministic changes. A retry that learns, an output space that is bounded, a tool gate that is narrow, an artifact you can replay. None of them touch the model. And they compound only when the meta-move wires them into a flywheel that turns every production failure into a permanent eval.
Why Small Harness Changes Beat Big Model Upgrades
What are the highest-leverage harness moves a team can make this sprint?
Not this quarter. Not after the next offsite. This sprint. The changes I'll walk through are small enough to implement in two days, large enough to show in your eval dashboard by Friday. None require a new model. None require a platform migration. All are counterintuitive, which is why most teams neglect them.
And the evidence has caught up with the intuition. The May 2026 survey of 170+ agent projects measured exactly this: simple harness tweaks, better tool formats, sandbox changes, automated verification loops, delivered larger reliability gains than model upgrades in the same environments. The cheapest moves on the board are also the highest-return ones. That is rare in engineering.
Take it while it lasts.
Every small harness change in this episode is a calibration, not a permanent law. Anthropic's own team learned that the hard way: a context-reset they built for Sonnet 4.5's "context anxiety" behavior became dead weight the next model cycle on Opus 4.5. , July 2026). A workaround with no expiry is technical debt.
Structured retry beats naive retry.
Here's what most teams do when their agent produces a malformed output. The model returns broken JSON. The hThe harness sends the exact same prompt back, hoping for a different result., hoping for a different result.
On retry number two, it does the same thing. By retry three, the team logs a failure and pages someone.
This is the retry pattern almost every harness ships with on day one. It's also the wrong pattern.
The model did not fail because it was lazy. It failed because something specific broke. A missing field, a trailing comma, a string where a number was expected. When you resend the same prompt, you are asking the model to guess what went wrong with no new information.
The retry is a coin flip. Sometimes the coin lands the right way. Most times it fails, burning tokens and emptying your error budget.
The structured retry works differently. It treats the failure as a signal. It parses the error, extracts the violation, and feeds it back as context.
Same model. Same tools. Same temperature. Different information.
# Naive retry. What most harnesses ship with def call_model(prompt, max_retries=3): for attempt in range(max_retries): response = model.generate(prompt) try: return json.loads(response) except json.JSONDecodeError: continue # Resend identical prompt. Hope. raise MaxRetriesExceeded() # Structured retry. What works def call_model_with_context(prompt, schema, max_retries=3): last_error = None current_prompt = prompt for attempt in range(max_retries): response = model.generate(current_prompt) try: parsed = json.loads(response) validate(parsed, schema) # raises on schema violation return parsed except (json.JSONDecodeError, SchemaError) as e: last_error = e current_prompt = augment( prompt, failed_output=response, error=str(e), # the specific failure signal ) raise MaxRetriesExceeded(last_error)
The augment function is the whole game. It writes something like: "Your previous response failed validation." The error was: expected 'amount' to be a number, got string '$42.50'. Return a corrected response that fixes only this field."
That is the structured retry. It cost two engineers one afternoon to build. In teams that deploy it, drift (the rate at which sessions fail) dropped by about sixty percent. Same model. Same prompt. New feedback loop.
The retry is only useful if the model learns something between attempts. If your harness sends the same prompt twice, you have one attempt and a repetition.
Harness Engineering · Episode 3Three specifics most teams miss when they go to implement this.
Cap the feedback window at the actual violation. Do not dump the full failed output back into the retry prompt. Bloating tokens and confusing the model with irrelevant context. Feed only the broken field, the specific error, and the expected shape. "The amount field was a string." Return a number in cents." That is it.
Retry budget is separate from retry behavior. Three retries is a sensible cap, but the retry logic on attempt one should be the same on attempt two. Do not escalate to a "bigger model" on retry three, that hides the harness bug under a more expensive model call. Fix the feedback, not the compute budget.
Log every retry with the error context you fed back. This is your dataset. Working structured retries teach nothing. Failed structured retries reveal errors your augmentation prompt can't fix. Feed those findings back into the prompt template. This is how the retry loop compounds over months.
The error signal isn't specific enough to learn from.
Structured retry assumes the error signal is informative. If your schema violation says internal error 500, the model has nothing to act on, and you're back to the coin flip. Spend the engineering time to make your error messages specific. A well-written schema violation is a prompt's worth of guidance.
The same principle now has a higher-altitude expression, and it shipped while I was revising this episode. In June 2026, LangChain shipped rubric support in deepagents. You hand the agent an explicit, machine-checkable definition of done, and the harness forces the loop to continue until the rubric is satisfied.
It is the structured-retry idea lifted from output validation to goal validation, and it works for any agent, not just code generation. The underlying requirement does not change between altitudes: the harness must give the model a clear, checkable signal of progress or completion, or the loop has nothing to optimize against. A loop without a rubric is a treadmill.
The Ralph Loop lives next door. If structured retry is the Interception-cluster version of the retry pattern, the Ralph Loop is the Orchestration-cluster version. It catches the model's exit attempt rather than its malformed output attempt, checks progress against a completion goal, and restarts with a clean context and a progress file pointer.
Episode 2 named Ralph as an Orchestration pattern; Episode 8 treats it as a concrete example of the feedback flywheel. Here, the point is only that retry logic has two altitudes. Output-level, which is what structured retry does, and run-level, which is what Ralph and rubrics do. And they live in two different clusters and fail in two different ways.
Structured output is a harness pattern, not a formatting choice.
Most PMs think of structured output as a polish layer. "Oh, that's what we'll turn on before shipping to Enterprise." They treat it like a designer treats a loading skeleton. It's a finishing touch.
This is exactly the wrong mental model.
Structured output is not a formatting feature. It is a reliability feature. When you tell the model "return JSON matching this schema" and the provider enforces strict mode, you are not making the output easier to parse. You are shrinking the set of things the model is allowed to say. Every token the model generates is schema-checked before leaving the model.
Invalid paths are pruned at generation time, not at parse time.
The difference is substantial.
In free-form generation, the model can produce any string. Most strings parse. A dangerous fraction look correct but silentAn `amount` field becomes a string with a dollar sign, a `date` becomes a human-readable phrase, an enum takes an unrecognized value.stream system doesn't recognize.
Your tests pass. Production fails.
With strict JSON schema enforcement, those drifts cannot happen. The model is only allowed to return something your code already knows how to read. It went from "can hand you literally any text" to "can only hand you a shape you have already agreed to accept." That is a much smaller room to fail in.
# The schema is your contract. Be specific. invoice_schema = { "type": "object", "required": ["vendor", "amount_cents", "due_date", "status"], "properties": { "vendor": {"type": "string", "minLength": 1}, "amount_cents": {"type": "integer", "minimum": 0}, "due_date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" # ISO-8601 only }, "status": {"enum": ["paid", "pending", "overdue", "disputed"]}, "line_items": { "type": "array", "items": {"$ref": "#/definitions/line_item"}, }, }, "additionalProperties": False # The part most teams forget. } response = model.generate( prompt=prompt, response_format={ "type": "json_schema", "schema": invoice_schema, "strict": True, }, )
Three specifics separate a reliability schema from a formatting schema.
additionalProperties: False Without this, the model can invent fields your downstream code will silently ignore. Insist on it. Every ignored field is a latent bug.
Use regex-bounded strings. A date field typed as string is a hand grenade. A date field typed as string with pattern ^\d{4}-\d{2}-\d{2}$ is a contract. The regex is the contract.
Enums everywhere you can. Any field with a small, finite set of valid values should be an enum, not a string. Free-form status: "paid" is a free-form status: "PAID" waiting to happen. Free-form strings introduce drift.
Structured output is not about the shape of the output. It is about the shape of the failures the model is permitted to make.
Harness Engineering · Episode 3One more thing teams forget. The schema is not just a contract with the model. It is a contract with every downstream consumer of the model's output. When your schema changes, every parser, pipeline step, and report must change. Treat the schema like a public API. Version it.
Write a migration when it changes. Loose versioning hides costs for three months, then crushes in month four when new fields are silently dropped and nobody can reconstruct the timeline.
Strict mode trades wrong answers for empty ones.
Strict mode adds generation latency. Sometimes noticeably; usually not. Tight schemas can cause the model to bail out and emit empty results rather than wrong ones. That's the right trade in most cases. Empty is debuggable, wrong is not. If your UX can't handle empty, build a graceful-degradation path. Build it. The pattern I use: strict mode in production, a schema-optional debug endpoint for eval, and a telemetry metric that counts how often the model is bailing. When bail rate climbs, the schema has gotten too tight for the underlying capability, and it's time to either widen a field or upgrade the model.
The narrow gate. Tools your agent can reach for, tools it can't.
Give an agent forty tools, and it must check all forty each turn before acting. Most tools are wrong for this turn. A few are near-duplicates. A few sound right but behave subtly differently. The model often picks incorrectly.
Give the same agent eight carefully chosen tools, and its reliability increases. Its reliability increases, not because the model improved. It's because the choice surface became sharper.
Vercel removed roughly eighty percent of their agent's tools in a recent rewrite. The result: fewer steps per task, fewer tokens, faster completion. The agent did more with less because less was available.
This is the narrow-gate principle: the tools an agent can reach for are the tools that define its behavior, and every tool you add is a tax on every decision it makes.
Here's how most teams end up with forty tools. In sprint one, you add five. In sprint two, someone needs an edge case, so add three more. In sprint five, you have an internal tools library, so add fifteen for completeness.
In sprint twelve, a new team member sees the mess, proposes consolidation, and gets told "we don't have time for tool hygiene." In sprint twenty, your agent's accuracy is stuck, and you're blaming the model.
The fix isn't a platform migration. It's a spreadsheet. List every tool the agent exposes. For each, answer:
- How often is this tool used? If used in less than five percent of sessions, it's a candidate for removal.
- Does it overlap with another tool?
search_documents- Is the tool name specific enough? Tools named
query_dataorrun_analysisare magnets for misuse. Rename to what they actually do:get_invoice_by_id,list_overdue_invoices.- Does the input schema constrain the agent, or invite hallucination? Free-form string arguments invite hallucination. Typed, enum-bounded arguments do not.
- Is the tool name specific enough? Tools named
# Wide gate. Invites misuse tools = [ {"name": "query_data", "args": {"query": "string"}}, {"name": "run_analysis", "args": {"type": "string", "params": "object"}}, # ...38 more vaguely-named, free-form tools ] # Narrow gate. Each tool has one job, constrained inputs tools = [ { "name": "get_invoice_by_id", "args": {"invoice_id": {"type": "string", "pattern": "^INV-\\d{8}$"}}, }, { "name": "list_invoices_by_status", "args": {"status": {"enum": ["pending", "overdue", "disputed"]}}, }, { "name": "mark_invoice_paid", "args": { "invoice_id": {"type": "string", "pattern": "^INV-\\d{8}$"}, "payment_date": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"}, }, }, # A few more, each equally specific ]
The second list isn't shorter because the agent does less. It's shorter because the tools were named and typed for what the agent actually needs. Every rule you write into a tool's inputs is one fewer thing the model can get wrong.
Every tool is a decision the model has to make on every turn. You are not restricting the agent. You are freeing it from choices it was getting wrong.
Harness Engineering · Episode 3A harder truth teams discover on the third tool-cut pass. Tool sprawl is almost always an organizational, not technical, problem. Tools accumulate because different teams own different agent capabilities, each shipping a tool that fits their mental model.
The narrow-gate rewrite is, in practice, a negotiation. Who gets to keep their tool, who has to consolidate, whose API gets fronted by someone else's name. If you do the cut as pure engineering, you will get it reversed by the next sprint. If you do it as a product decision, with the tool registry as a single owned surface, it sticks.
Narrowing too aggressively strands the agent.
Narrowing the gate too aggressively can strand the agent on edge cases your tool set doesn't cover. The fix is not to re-add tools speculatively. It's to watch eval traces, see where the agent is stuck, and add the specific, named capability. Design tools reactively, not proactively. The second, subtler failure mode: the agent uses the wrong tool becauTraces will show the agent contorting general-purpose tools for specific tasks.e tool to do something specific. When you see that three times, the signal is clear. Add the specific tool; do not widen the general one.
Reveal tools as needed. One upgrade to the narrow-gate pattern deserves a name. Instead of dumping the full tool catalog into every prompt, show the agent only tools relevant to the current task. This is what skills do, a piece of the harness whose job is to hide tools the agent does not need this turn. "Skills are a harness level primitive that solve [tool sprawl] via progressive disclosure" (Vivek Trivedy, LangChain, The Anatomy of an Agent Harness, March 2026).
The model never sees the forty-tool catalog on any single turn because the skill wrapper filters it to the eight relevant for the task class. This is the same naTeams reach for this upgrade after running pattern 3 and realizing the tool set can be narrow and context-dependent. and context-dependent.
How narrow is sufficient? Andrew McNamara at Shopify gives a number: "somewhere between 20 and 50 tools the boundaries start to blur" (InfoWorld, April 2026). The threshold is not exact. The pattern is useful. Beyond fifty tools, the model often picks incorrectly, measurably dropping the agent's reliability. Beyond twenty, audit the bottom third every quarter.
Does this discipline The best evidence suggests it makes multi-agent production survivable.lti-agent production survivable. In May 2026, FactoryAI described a multi-agent system that ran continuously for 16 days. Orchestrators, workers, and dedicated validator agents, with validation contracts written before implementation and adversarial verification that checked behavior, not just code.
Sixteen days. No human monitoring was needed. Teams shipping at that reliability level treat tool scope and verification contracts as first-class design artifacts, decided before agent code, not patched in after incidents. The narrow gate is not a single-agent training wheel.
It's the discipline that scales.
The other Shopify principle worth borrowing: build very low-level tools and teach the system to translate natural language to that low-level language. This is counterintuitive. Most teams build "smart" tools doing many things at once, because it feels efficient. Smart tools also fail in many ways at once. A library of small, sharp tools, composed by an agent, beats clever tools with surprise modes.
Regarding context: do not paste everything into the system prompt. Reveal context as the task needs it. McNamara again: "Just-in-time context delivery is key." "Rather than overloading the system prompt, we return relevant context." The prompt is the first place context goes wrong. Keep it lean.
A tradeoff quietly died in May. Delete the code that managed this. For a year, teams choosing between preserving prompt cache and refreshing mid-session instructions had to pick one. No longer. Opus 4.8 accepts role: "system"Append updated instructions late in a long run without restating the system prompt, and earlier cache hits survive.e hits on earlier turns survive. The minimum cacheable prompt dropped from 2,048 tokens to 1,024 in the same release. If your harness has a component whose entire job was juggling cache-versus-freshness, schedule its retirement review this sprint. This is the dissolving ladder frAnd the discipline it rewards is deleting components the week the model makes them unnecessary, not a year later.unnecessary, not the year after.
One last detail from the frontier, because it shows how precisely this discipline is now practiced. OpenAI's Codex team ships skills as versioned bundles and tunes how reliably the agent picks the right one. And the highest-leverage tuning move they published was adding negative examples to skill descriptions: explicit statements of when not to use a skill, which lifted routing accuracy measurably.
Read the principle underneath the tactic: the narrow gate is not only about how many tools exist. It is about how unambiguously each one announces its boundaries. A tool that says what it is not for is a decision the model no longer gets wrong.
The fourth change. Emit artifacts, not answers.
There is a fourth change that has earned its place since this episode first ran, and it comes from a May 2026 research thread with an unusually practical punchline (Code as Agent Harness, arXiv).
For any agent task whose output will be consumed by another system or verified against criteria, prefer an executable artifact. For example: a function, a structured query, a diff, or a test. Rather than a prose answer or even a JSON blob.
The reasoning is mechanical, not aesthetic. A prose answer cannot be replayed. A JSON blob can be replayed but not executed. An executaAn executable artifact provides three properties nothing else does: stateful checkpointing (progress survives a crash, as the artifact is the progress), formal verification (the output can be tested, not just read), and deterministic replay (the exact path to a failure can be reconstructed, step by step, on demand).ucted, step by step, on demand). These three properties distinguish a debuggable agent from one you can only restart.
The change is small in scope, yet large in consequence. Replace the final tool call that emits a string with one that emits a function. Pair it with a verification hook that runs the function and feeds the result back.
You have now wired Orchestration and Interception into the output. The agent does not need a separate eval for this step, because the artifact is the eval.
Artifacts demand a sandbox you may not have built yet.
Artifacts demand an execution sandbox, an Environment investment some teams haven't made yet. If your agent's outputs are only consumed by humans reading prose, this change benefits you little. Apply it where outputs flow into systems. Which, in enterprise, is most relevant contexts.
The feedback flywheel.
The three patterns above work. They work this sprint. They land on a dashboard by Friday. None of that is why I am writing this episode.
I am writing it because the three patterns compound only with a fourth move that turns them into a program. The fourth move is the feedback flywheel, and it lives in the Observability & Evals cluster on the Episode 2 map.
Here is the mechanism. Every production run leaves a trace. Every failing trace (agent exited early, retry attempts exhausted, wrong tool picked, output validation failed) is a candidate for an eval.
When you mine the failure into a concrete eval case and add it to the suite, the next time that failure shape appears, the suite catches it on a pull request instead of in production. Over quarters, your eval coverage grows based on the exact distribution of user failures.
Not the failure distribution a vendor might expect.
"Every trace contains valuable data to produce a potential eval." And every (good) eval makes the harness better." (Vivek Trivedy, LangChain, Better Harness, Practitioners shipping these primitives in June 2026 state it bluntly: correct, efficient verification is key to a semi-long-running agent.kes a semi-long-running agent work. Injecting human priors where the model is weak holds the line while agents improve native verification.
Without good verification signals and proper context exposure, even sophisticated orchestration yields bad outcomes, just faster. The flywheel turns every verification failure into a permanent, reusable harness edit. That is the entire system.
The structured retry reveals vague error messages. The hardened schema reveals where downstream consumers silently absorb drift. The narrow gate reveals inconsistent tool naming.
Without the flywheel, those findings scatter across Slack threads and incident reviews, and are forgotten. With the flywheel, each becomes a concrete eval that remains in the suite, continuously firing on relevant changes.
This makes the three tactical moves durable rather than episodic. You aren't fixing three bugs. You are installing three feedback loops that accumulate evidence weekly. That is the difference between a team that ships these patterns once and a team that ships them every sprint.
The three moves improve your reliability this month. The flywheel ensures it keeps improving in month nine.
Harness Engineering · Episode 3(Vivek Trivedy, LangChain, April 2026). Don't race to a thousand eval cases.
Start with the twenty that cover actual user failure modes. Mine them from real traces. Tag them by cluster. Which harness cluster did this failure occur in? That tagging allows closing the loop from eval to edit to validation.
There's a specific moment when LLM-as-judge stops being a rough proxy and becomes an unattended primitive you can ship behind. The graduation threshold is >90% agreement with human raters on a 50-case calibration sample, scored on the same rubric the judge will use in production. Below that bar, the judge is a triage tool. Useful for ranking, but dangerous for gating.
At or above it, the judge can sit in CI, blocking merges without human intervention for that decision class. Calibrate per workflow, not per model: a judge clearing tool-selection correctness isn't automatically cleared for tone, safety, or factual grounding.
Recalibrate when the rubric changes, when the model changes, or when production drift starts to outrun the sample.
Episode 8 provides the full operating guide for this flywheel. The four-phase loop, the four verbatim examples of harness edits that came out of it, and why the winning enterprises will be the ones whose evals are proprietary in the way their customer data is proprietary.
For this episode, the point is you cannot ship patterns 1-3 and call it done. You must ship them with the fourth, or you are renting reliability instead of building it.
A prompt edit and a middleware upgrade are not the same ticket.
Enterprise change management breaks the feedback flywheel if run on one cadence. A prompt edit and a middleware upgrade look like the same ticket to a security review board. They are not. A prompt edit is a content change; a middleware upgrade is a platform change. If you run both through the same multi-week review cycle, the flywheel slows, and the three patterns compound in quarters instead of weeks.
The enterprises that have already built harnesses have learned to carve the release surface into two cadences. A content layer. Prompts, skill additions, memory policies, eval cases. On a weekly track with a lightweight review. A platform layer. Middleware, hooks, orchestration changes, infrastructure touches. On a quarterly track with full security and legal review. JPMorgan's LLM Suite launched to 60,000 employees in August 2024 and expanded to roughly 250,000 by late 2025; public reporting describes a portal pattern. Teams plug in different models while a governed control plane keeps the data boundary intact. The split-cadence is a key observation at large banks: the control plane has a different SDLC than its underlying infrastructure, and pretending otherwise freezes the flywheel.
The PM move is to negotiate this split before it's needed. Agree with security and legal on what constitutes a content vs. platform-layer change. Document the review path for each. The first time a prompt edit moves from a "two-week review queue" to a "48-hour content review," you will have bought your program a year of compounding.
How Three Tickets Make Any Model Look Smarter
Here's what took me two years of watching teams to understand.
When you ship a structured retry, you haven't made the model smarter. You've given it a second attempt with better information, so the average output across attempts has fewer errors. The user sees a more reliable agent. They credit the model.
When you turn on strict JSON mode, you haven't made the model smarter. You've shrunk the space of outputs the model is allowed to produce, so the ones it does produce are more likely to be valid. The user sees a more on-brand, consistent agent. They credit the model.
When you narrow the gate from forty tools to eight, you haven't made the model smarter. You've reduced the choice space it navigates each turn, making its action selection more correct. The user sees a more decisive agent. They credit the model.
From the outside, every one of these wins looks like a better model. Internally, nothing about the model changed. The harness did the work.
This is the meta-insight most PMs miss when evaluating vendors. Anyone can show you a demo running on the frontier model. Very few can show you the harness that makes the frontier model reliable.
If you evaluate on the demo, you are buying the model. If you evaluate on the second and third hour of continuous use, you are buying the harness.
The best harness changes make the model look measurably smarter without retraining it. The user cannot tell the difference. Neither can the leaderboard. You and your CFO can.
Harness Engineering · Episode 3This is why the labs are quietly investing more in harness work than in model work right now. The marginal dollar into model pre-training buys a decimal point on a benchmark. The marginal dollar into harness design buys reliability the user can feel. Guess which one the enterprise buyer renews.
There is also a second-order effect. A team that ships these three patterns gets faster at shipping every subsequent pattern. The structured retry reveals vague error messages, which you then fix.
The hardened schema reveals where downstream consumers silently absorb drift, which you then standardize. The narrow gate reveals inconsistent tool naming, which you then rename.
By the time you complete the three tickets below, your agent's infrastructure will be measurably cleaner than a sprint ago, and the next improvement will cost half as much.
That is compounding. The thing most PMs claim to want, but few build the prerequisites for.
Three tickets. Two days each. Measurable by Friday.
A PM and a staff engineer, pair-working. Not a roadmap. Actual tickets your team can close.
-
1
Convert one naive retry to a structured retry.
Pick the agent workflow that fails most often with a retry-exhaust error. Rewrite the retry to parse the validation error, augment the prompt with the specific failure signal, and retry. Measure drift before and after. Expect a roughly fifty to sixty percent drop.
Done when: new retry is in prod behind a flag · A/B eval shows measurable drift reduction · flag becomes default-on next sprint -
2
Harden one schema with strict mode, additionalProperties: false, and regex-bounded strings.
Pick your agent's highest-volume output shape. Turn on strict mode at the provider level. Set `additionalProperties: false`. Replace every free-form string with a regex-bounded type or enum. Redeploy. Watch downstream parsing errors decrease from daily to monthly.
Done when: one schema is fully hardened · parse-error metrics drop · pattern is the default for all new schemas this quarter -
3
Cut the tool list in half.
List every tool your agent exposes. For each, answer the four narrow-gate questions. Remove or merge tools that fail these criteria. Aim for a fifty percent reduction this sprint. Rename every remaining tool to describe its exact action.
Done when: tool count is halved · each remaining tool has a specific name and a constrained input schema · eval shows steps-per-task down and success rate up
That is the sprint. Three changes. None require a new model, vendor, or committee. All are measurable by Friday. (And if your team finishes early, rubrics are now a shippable primitive, not a research idea. Author one rubric for your highest-value journey and wire it to the loop. Episode 6 makes that a full working day in the kit.)
Stretch ticket for the ambitious pair: stand up one containerized eval environment for your highest-value workflow using the Harbor × LangChain stack. Fresh sandbox per trial, with runs landing in observability as datasets with traces attached. Definition of done: a failing production trace becomes a reproducible, sandboxed regression eval within one sprint. That single wire is the flywhIf you pick only one metric, watch drift recovery rate.is drift recovery rate. It's the fraction of sessions that hit an error and return to a valid output without human intervention. If you do not have this metric today, build it this sprint too.
It's the closest single number to "how reliable is my harness." Before the three changes, expect thirty to fifty percent, depending on workflow complexity. After the three changes, expect the number to climb into the seventies or eighties, and, more importantly, to stay there as you add new features. More importantly , to stay there as you add new features. A harness that does not regress drift recovery is a harness you can build on.
A harness that does is a harness you are renting.
These patterns work. They are cheap. They are measurable. Every engineer described could implement them in a sprint. So why are most teams still running naive retries, free-form outputs, and forty-tool agents?
Because their design principles are counterintuitive. Removing tools feels like removing capability. Constraining outputs feels like restricting the model. Spending engineering time on retry logic feels like plumbing, not product work. Every one of these moves goes against PM instincts rewarded in the software era but punished in the agent era.
The best harness engineers I have met think in paradoxes. They think of intelligence versus reliability. Constraints versus autonomy. Demo versus production. They keep both sides of each paradox in view, then make a deliberate call on which to favor for each decision.
Sources & Further Reading
Vivek Trivedy, LangChain. The Anatomy of an Agent Harness (March 2026)
Vivek Trivedy, LangChain. Better Harness: A Recipe for Harness Improvement with Evals (April 2026)
JPMorgan LLM Suite. CNBC coverage (August 2024)
JPMorgan LLM Suite expansion. CEFPro coverage (late 2025)
Previous in this series: Episode 2. Inside a Production Agent Harness
Key Takeaways
- WaitinThe biggest, cheapest, longest-lasting wins come from small changes to how you run today's model, not from next quarter's release.o today's model, not next quarter's release. Teams that pin their roadmap to the model calendar mostly stand still.
- Retrying the same call gets the same answer. A retry only helps if the second attempt sees something the first didn't: the specific error, the missing field, what went wrong. Design the feedback, not the retry.
- Ask for the shape of the answer, not just the answer. When you require a specific format, whole categories of mistakes stop being possible. It is the cheapest way to move a bug out of English and into code.
- Every extra tool makes every decision harder. The model reads every option you give it, every single time. Fewer, sharper, clearly-named tools raise quality before they save money; a seldom-used tool quietly hurts the ones that are used.
- Ship things you can check, not paragraphs you can only read. A structured output can be tested, replayed, and compared over time. A blob of text can only be re-read. When another system uses the output, the structure is the quality gate.
- Improvements slide back unless you protect them. Any fix that is not measured and reviewed quietly drifts back to how things were. You need a simple loop (real traces in, evals out, patterns tested), or the same bugs return.
- Small and big changes need different speeds. Prompts and content should move in days; platform changes, in months. If your review process treats them the same way, everything slows to the pace of the slowest.
How this episode connects to the rest of the stack
Each link points to the same problem, told from a different seat.
- Agentic · T15. The Harness DecisionChoosing the simplest harness that could work.
- Agentic · T09. Structure as ControlWhy constraints raise reliability.
- Agentic · T08. Tools Shape BehaviorThe narrow-gate principle, from the tool side.
- Evals · T24. The Eval FlywheelHow traces become permanent eval coverage.