AssayAssay
03 / 08

Lesson 03 · Foundations · 14 min

Building a harness

Harness engineering is the discipline of building the thing that governs the agent, rather than the agent. The previous lesson named the parts — guides before, sensors after. This one builds a harness for the support agent, in the order that experience says the parts should be added.

  • First, the cheap sensors. Does the reply parse. Is every required field present. Was a forbidden tool called. These are code, cost nothing, and run on everything.
  • Second, the guides those sensors keep firing on. When the shape check fails repeatedly, fix the prompt or the schema — a sensor that catches the same thing every day is describing a missing guide.
  • Third, a precondition on every side-effecting tool. The refund tool refuses until the policy has been read. This is a guide that cannot be argued with.
  • Fourth, one inferential sensor, on the thing that matters most. A checker that reads the reply against a rubric — expensive, so spent where the cost of being wrong is highest.
  • Last, the dataset. Every failure the sensors caught becomes a case, so the harness is tested against the mistakes it has already made.

Notice what is not in that order: a long system prompt. Instructions are the part teams reach for first and they are the weakest guide, because nothing verifies that they are followed. A prompt line that says "never promise a date" is a hope; a regex gate that rejects one is a control.

A harness regulates three different things, and the industry has reached consensus on only one of them.

MaintainabilityDoes the output follow conventions — format, schema, style. Mature. Linters, type checks and schema validation handle most of it deterministically.
Architecture fitnessDoes the system stay within its intended shape — the right tools in the right order, no route it should not take. Emerging. Graphs, preconditions and trace assertions cover it.
BehaviourDid it do the right thing for the right reasons. Unsettled. This is where inferential sensors live, and where every source on the subject admits the answer is incomplete.

That split is useful for deciding what to build next. If the harness has no maintainability checks, add those first; they are the cheapest and most reliable. If it has those and the agent still takes wrong routes, the gap is architectural. If both are in place and the output is still wrong, you are in the hard third, and the honest tools are a rubric, a checker, and a human reading samples.

maintainability   schema_valid · exact_match · no forbidden phrases      code, every call
architecture      must_call lookup before issue_refund · visited policy node   trace asserts
behaviour         checker against a rubric · human reads 20 a week     inferential, sampled

The industry course's blueprints are six harnesses built this way. Each declares its constraints, and the lab checks a trace against them. The one that failed most instructively — healthcare, where every process check passed and the outcome check caught the missed emergency — is a behaviour sensor doing the job no maintainability check could.

One question is worth asking a team every quarter: are we steering the harness, or just steering prompts? Prompt edits feel like progress and do not accumulate. A harness accumulates — every sensor added keeps working, every precondition keeps holding, and the dataset of caught failures only grows.

Checkpoint

Take one checker failure and say whether a code-level guide or sensor could have caught it for free.

maker
checker

“My order 88213 arrived with a cracked base. I'd like a refund please.”

The natural, friendly reply promises the refund — which the agent cannot authorise.

The rubric in this lab is a behaviour sensor; the checker is inferential. Ask which of its catches a cheaper maintainability check — a regex, a schema — could have made instead.

Run once with the verification loop off, then again with it on, and compare the replies.