Learning path

Learn harness engineering: the 2026 path for AI coding agents

What harness engineering is, and the five-stage path to learning it: typed questions, run routing, tool-call gates, confidence calibration, and audit-grade measurement — built on the LangChain harness pattern and this site's measured numbers.

TL;DR

Harness engineering is building the judged loop around a generative model: the LLM keeps writing and designing while a typed decision layer routes each run, gates every tool call, and escalates on confidence. The learning path is five stages — lock answer shapes (Choice / Score / Noul), route before you generate, gate every tool call with allow / ask / block, calibrate probabilities and set per-action thresholds, then measure like an auditor. It takes an afternoon to build your first gate and a few weeks to make the pattern production-habitual — the LangChain harness that named the pattern shipped two days after Jev launched, and its audited result was a 15.9% faster, 30.1% cheaper pipeline.

Sources: LangChain's "Building a Harness with Jev" (2026-09-17) as recorded in our audited agent-harness guide; TypeSafe claim measurements from the independent 2,000-email test; Laya calibration practice. No certification for harness engineering exists — anyone selling you one is grading their own homework.

What is harness engineering?

The scaffolding around the model — not a better way to talk to it.

An AI agent loop has two kinds of work. Generation — writing code, drafting plans, designing — is what the LLM is built for and what nobody should take away from it. Judgment — the hundreds of tiny yes/no and pick-one decisions a run needs — is expensive to get from a generative model, because every check costs a paragraph of reasoning, seconds of latency, and a self-graded confidence that nobody calibrated.

Harness engineering is the discipline of splitting those two kinds of work cleanly. The harness is everything wrapped around the model: the router that picks small-vs-flagship before a run starts, the gate that vets every tool call before execution, the calibrated thresholds that decide auto / ask / block, and the evals that keep all of it honest. The name comes from LangChain's "Building a Harness with Jev" (September 17, 2026), where Jev — the System One decision model that returns typed answers instead of prose — sits beside the LLM answering the locked questions the pipeline asks.

The economic point, measured: offloading just the yes/no and pick-one steps of a DSPy pipeline made it 15.9% faster (1.958s vs 2.329s per ticket) and 30.1% cheaper ($0.000377 → $0.000263). A guard that costs a fraction of a cent stays enabled; one that costs seconds gets switched off — Sydney Runkle turned auto mode back on only once the check became nearly free.

The five-stage learning path

Each stage has a deliverable you can build in an evening. Do them in order — every stage assumes the one before it.

01

Stop prompting, start typing

Prompt engineering optimizes the words a model reads; a harness locks the shape of what comes back. The first skill is asking questions whose answers your code can act on: one of N options (Choice), a 0–100 rating (Score), or a validated judgement with no generated text at all (Noul). When the answer space is closed, an ordinary if statement can trust it.

Build → Open the Playground, classify three texts with a Choice question, and watch the probability and confidence fields arrive as JSON — no parsing of prose anywhere.

02

Route before you generate

Job 1 of the LangChain harness: before the agent starts, a cheap classifier reads the request and decides small model or flagship. "Fix this typo" should never pay flagship prices. The skill is drawing the line — and measuring it, because the router itself is a decision you can get wrong.

Build → Take ten real requests from your own product, label each small/flagship, and build the router question. Then measure: the audited DSPy pipeline saved 15.9% latency and 30.1% cost per ticket by offloading exactly these locked questions.

03

Gate every tool call

Job 2: in auto mode, a middleware inspects every tool call the agent attempts and returns a locked verdict — allow, ask a human, or block — before execution. The canonical example is rm -rf: no rule in your code can tell routine cleanup from a catastrophe, and asking a chat model means paying for a paragraph that grades its own homework. A gate that costs a fraction of a cent and a few hundred milliseconds stays on; a guard that costs seconds gets disabled.

Build → Wrap one destructive action in your own stack with a three-option gate. Lock the options, set a confidence threshold, and decide in code what each verdict does — the model never sees free text.

04

Calibrate, then gate on confidence

A probability is only useful if it means what it says. Calibration measures the gap (Laya's tutorial calibrates to ECE 0.081), and the production pattern is thresholds per action: auto-execute above 0.85, ask a human in the middle, block below the floor. One number, three behaviors — that is harness engineering in one line.

Build → Collect 50 outputs from stage 3, check how often "94% confident" was actually right, and set your first per-action threshold table.

05

Measure like an auditor

The final skill is distrust. TypeSafe's homepage advertised 193x / 444x; an independent 2,000-email test measured 3x / 12x — still excellent, and still the numbers you should build on. The same audit found a broad "is this phishing?" question scoring 62.6% while five narrow signals with tuned weights reached ~95%. Narrow beats broad, measured beats claimed, every time.

Build → Re-run one vendor benchmark claim on your own data with fixed tasks and fixed thresholds — the method our benchmarks section publishes — and write down the delta.

Resources, in reading order

Five links, not fifty — the pattern named, dissected, and the habits it assumes.

01
LangChain — "Building a Harness with Jev" (2026-09-17)

The post that named the pattern: Sydney Runkle and Hunter Lovell's harness design, two days after Jev's launch. Start here for the two-jobs framing.

02
Jev agent harness guide (video walkthrough)

Our dissected walkthrough of the LangChain harness with the audited numbers: 15.9% faster, 30.1% cheaper, and what the gate really saves.

03
Jev tips: 8 best practices

Object states, computing facts in code, batching questions, and confidence thresholds per action — the habits each stage above assumes.

04
Jev as an LLM judge

Confidence-gated cascades: keep 99% of GPT-6 accuracy at 57% of the fee — the measurement discipline of stage 5, productionized.

05
Support ticket routing recipe

The smallest complete harness: classify, threshold, escalate. Build it once and stages 1–4 stop being abstract.

Everything here is free. The only paid thing in this path is a hosted Jev key when you outgrow the Playground — the arithmetic to decide when is in stage 2.

The mindset: audit-grade or it does not count

What separates harness engineering from prompt folklore is what you are allowed to claim.

Every number in this page's source guide was audited, and the audit is the lesson. TypeSafe's homepage advertised 193x and 444x improvements; the independent 2,000-email test measured 3x and 12x — still genuinely excellent, and the only numbers a production decision should be built on. The same test found a single broad "is this phishing?" question at 62.6% accuracy (below Haiku 4.5's 81.3%) while five narrow signals with tuned weights reached about 95% — narrow, decomposed questions beat broad ones, and the fix was structural, not a better prompt.

So the fifth stage is not optional polish; it is what makes the other four engineering. Fixed tasks, fixed thresholds, your data, your confidence gates — the same method our benchmarks section publishes for every claim we repeat. When you can re-run a vendor number and write down the delta, you are doing harness engineering; before that, you are doing vibes.

Jev benchmarks

FAQ

What is harness engineering, in one sentence?

Building the judged loop around a generative model: routing each run before it starts, gating every tool call before it executes, and escalating on calibrated confidence — so the LLM keeps generating while typed, locked decisions handle the judgment.

Is harness engineering just prompt engineering with a new name?

No. Prompt engineering optimizes the words the model reads; harness engineering wraps the loop around the model — routing, tool gates, per-action thresholds, evals — with answer shapes locked so ordinary code can act on them. The audit case makes the difference concrete: a broad phishing prompt scored 62.6%, while five narrow typed signals reached ~95% — a harness fix, not a wording fix.

What do I need to know before starting?

Comfortable basic web development in TypeScript or Python, REST APIs, and reading JSON. No machine learning background is needed — every concept here is code you already know (an if statement acting on a typed answer) plus one new habit: measuring before trusting.

How long does it take to learn harness engineering?

An evening for your first gate (Playground, then the ticket-routing recipe), a week or two for the full five-stage path at toy scale, and however long your own evals take to reach production thresholds. There is no certification — the deliverable is a repo where the gates are visible in the diff.

Do I need Jev to learn it?

No — the pattern (route, gate, threshold, measure) is model-agnostic. Jev is simply the cheapest way we know to run the locked-question layer: hosted decisions at $0.042 per million input tokens, a fraction of a cent and a few hundred milliseconds per gate, which is exactly why guards built this way stay switched on.

What should I build first?

The support-ticket routing recipe — classify, threshold, escalate. It touches all five stages in miniature. Then wrap one destructive action in your own stack with an allow / ask / block gate, because a gate on your own rm -rf is the moment the pattern stops being theoretical.