A hospital ward at 8 pm
Picture a hospital ward. The day nurse is going home and the night nurse is arriving. The night nurse has never met these patients.
Now imagine two ways this could go.
In the first, the day nurse says, "Everything is fine, just keep an eye on things." The night nurse has no chart, no list of tasks, no rule about what to do if something goes wrong, and no way to check that the 8 pm medicine was actually given. Whatever happens next depends on luck and on how good the night nurse is.
In the second, the night nurse walks in and finds: a ward manual (hand-washing rules, who may give which drug), a chart at the end of each bed (what was done, what is still to do, what failed last time), a checklist that must be ticked with proof before a task counts as done, and a rule that says "do one task at a time". The nurse is the same person. The outcome is far more reliable, because the ward is set up so that a good nurse can work safely.
That second ward is a harness. The nurse is the AI model. This whole post, and the two that follow, use this one ward as the example. Every piece of the harness maps to something on the ward, and the Java code at the end is named after it.
1. Prompt engineering versus harness engineering
Prompt engineering answers one question: what should the model do? You write a clear instruction.
Harness engineering answers a wider one: under what instructions, state, environment, tools, verification, scope and lifecycle should the model operate? The model is one component. The harness is everything around it.
In ward terms: the prompt is "give the 8 pm medicine to bed 4". The harness is the manual, the chart, the checklist, the lock on the drug cabinet, and the handover procedure.
Why it matters: a coding agent that works on a real repository for hours, or across many sessions, fails in predictable ways that a better prompt does not fix.
| Failure mode |
What it looks like on the ward |
What it looks like for an agent |
| Context loss across sessions |
New nurse does not know bed 7 was already treated |
New session redoes or undoes yesterday's work |
| Scope creep |
Nurse "helpfully" rearranges the whole ward |
Agent refactors files unrelated to the task |
| Premature completion |
"Dressing changed" (it was not) |
"Done, looks correct" with no test run |
| Stale assumptions |
Chart says bed 3 is empty; it is not |
Agent trusts old notes about the repository |
| Unverified work |
No one checked the dose |
Code never compiled or tested |
| Repeated failed approach |
Same treatment tried three times |
Same failing fix tried in a loop |
| Dirty handoff |
Shift ends mid-procedure, nothing written |
Session ends with half-edited files and no record |
| Tool misuse |
Wrong drug from the cabinet |
Destructive command run against the wrong target |
| Conflicting parallel agents |
Two nurses treat the same patient |
Two agents edit the same files |
You've reached the free preview of this post.
Subscribe to the Blogs plan (₹99/mo) — or use any Algomi Suite, Career, Investor, or Trader plan — to keep reading.
See plans