Your AI feature needs a test harness before it needs a better prompt
The team kept tweaking the prompt and arguing about whether it got better. They had no way to measure, so the argument never ended.
Your AI feature needs a test harness before it needs a better prompt
An engineering lead at a legal software company told me their AI feature had been in a strange loop for a month. Someone would change the prompt, the team would look at a few outputs, half of them would say it seemed better and half would say it seemed worse, and they would either keep or revert the change based on whose opinion carried the room that day. Every prompt change reopened the same debate, and the debate never resolved anything, because there was no way to actually tell whether the feature got better. They were tuning a system they could not measure, which is another way of saying they were guessing.
Tuning without measuring is guessing
There is a strong pull, when you have an AI feature, to jump straight to improving the prompt. The prompt is where the behavior seems to live, changing it is fast, and every change produces a visibly different output. It feels like progress. So teams pour effort into prompt tuning before they have any way to know whether a given change is an improvement or a regression.
The trouble is that a language model’s output varies, and a human eyeballing a handful of examples cannot reliably tell whether a change helped. You look at five outputs, they seem fine, you ship the change, and you have no idea whether it improved the hard cases or quietly broke them, because you only looked at five and they were probably the easy ones. Two engineers can look at the same outputs and disagree, and neither is wrong, because there is no shared standard to appeal to. Without a harness that runs the feature over a real set of cases and scores the results, prompt tuning is not engineering. It is a series of vibes, and vibes do not compound.
This is why the harness has to come first, before the prompt work that everyone wants to do. The harness is what turns “I think this is better” into “this scored higher on the cases we care about.” It ends the debate by giving it a referee. Without it, you can spend a month tuning and have no evidence you improved anything, which is roughly what that team had done.
Build the harness before you tune
The lesson is to invest in measurement before optimization, even though optimization is the fun part and measurement is the chore. A modest harness beats an elaborate prompt every time, because the harness tells you whether the prompt is working and the prompt cannot tell you anything about itself.
What a minimal test harness for an AI feature includes.
- A set of representative input cases, including the hard ones and the ones that have failed before, not just the easy demo inputs.
- An automatic way to run the feature over all of them and collect the outputs, so you are judging on tens or hundreds of cases, not five.
- A scoring method, from simple property checks to a graded rubric, that turns outputs into numbers you can compare across changes.
- A baseline score, captured before you tune, so every change can be measured against where you started.
- A fast enough run that you can measure a prompt change in minutes, so measuring becomes a habit and not a project.
None of this has to be sophisticated to be transformative. Even a rough harness ends the endless debate, because now a prompt change either raised the score or it did not, and you can stop arguing and look.
How we approach it at Density Labs
The teams stuck in the prompt-tuning loop are almost always missing the harness. They have poured energy into the prompt because it is visible and fast, and skipped the measurement because it is neither, and as a result they cannot tell whether a month of tuning moved the feature at all. The prompt got a lot of attention. The thing that would have made the attention pay off never got built.
Our AI Opportunity Assessment is a fixed two-week engagement, priced at $2,500, that scopes the real work of shipping an AI feature. The harness is one of the first things we look at, because without it every downstream decision about the feature is a guess dressed up as a judgment, and teams burn weeks on guesses.
Build the thing that measures the feature before you spend a month tuning it. Otherwise you will not know if the month helped.