Back to Learn

Course 9 min read

Specs and evals: writing tickets and tests for an AI feature that is sometimes wrong

Part 5 took an "Ask about this product" assistant apart, layer by layer. Now the awkward bit: you have to write the ticket for it, and decide when it's good enough to ship. I haven't had to do this on a live AI feature at work, so treat this part as a way of thinking I'd use, not a record of what I've done. It borrows heavily from habits I already have from user stories and acceptance criteria.

Why the usual ticket breaks

A normal acceptance criterion is a light switch. "Given an item is out of stock at Cambridge, then the collect option is disabled." Test it once and you know.

An AI answer isn't like that. Ask the same question twice and the wording changes. Ask a slightly different one and the facts might too. One passing example proves almost nothing, and one failing example doesn't mean it's broken every time. So the criteria have to describe the pile, not the single answer.

Acceptance criteria for an answer that's sometimes wrong

LikeA light switch: it either turns the light on or it doesn't

One example, one result. This works when the same input always gives the same output.

  • Given I choose Cambridge, then the page shows Cambridge's opening hours.
  • Given an item is out of stock, then the collect option is disabled.

Pass or fail one test settles it

LikeMarking a stack of exam papers: you judge the whole pile, not one answer

A rate over a test set. The same question can get different wording each time, so you describe how often it must be right, and what must never happen.

  • Given the 100 questions in the test set, then at least 90 get a correct answer about hob compatibility.
  • Given any question, then it never promises a delivery date.
  • Given it can't find the answer, then it says so and offers customer service, every time.

A target plus a short list of hard limits

The numbers are examples. The right target depends on what a wrong answer costs, which is the same question as in Part 2.

Three kinds of criteria

I'd write every AI ticket with three sections.

1. How often it must be right. A rate over a test set: "Given the 100 questions in the test set, at least 90 receive a correct answer about hob compatibility." The target is a product decision. Ask what a wrong answer costs: a wrong hob answer is a return and a cross customer, a slightly clumsy sentence is not. Set higher bars where mistakes cost more.

2. What it must never do. These are not rates. They're rules that should hold on every single answer: never promise a delivery date, never quote a price that didn't come from the catalogue, never offer a discount, never give advice about allergies or safety it can't source. Keep the list short and make each item checkable.

3. What happens when it can't answer. This is the one most tickets forget. Define it as a feature: it says it doesn't know, doesn't guess, and offers a route on (the product page, customer service, a phone number). A good "I don't know" is a pass.

Here it is as a story, in the usual shape:

As a shopper looking at a pan, I want to ask whether it suits my hob, so that I can buy with confidence.

  • Given the 100 hob and size questions in the test set, then at least 90 get a correct answer, based on the product data.
  • Given any question, then the assistant never states a delivery date or promises stock without checking it.
  • Given the product data doesn't contain the answer, then the assistant says so and offers customer service.
  • Given I ask for a refund or a discount, then it explains it can't approve either and offers a person.

Evals: start by reading

"Evals" is the word for how you test all this. It sounds technical, and it can be, but the useful start is not code. It's reading.

From reading answers to a test you can rerun

1. Read real outputs

Collect 30 to 50 real or realistic questions and read what the assistant answered. Slowly, yourself.

2. Mark pass or fail, and write why

One line per answer. The reason matters more than the mark.

3. Group the failures

Wrong size, invented feature, stale stock, rude tone. Count each group and fix the biggest first.

4. Turn them into a test set

Keep the questions, and the notes on what a good answer looks like. Add every new failure you meet.

5. Automate

Code checks first (does it mention a price? a link?). A model marking answers later, checked against your own marks.

Collect 30 to 50 questions, real ones if you have them (search queries and customer service messages are a good source) and realistic ones if you don't. Read the assistant's answers yourself. Mark each pass or fail, and write one line on why. Then group the failures: "invented a feature", "wrong size", "stale stock", "too chatty", "didn't hand over". The groups tell you what to fix first, and they often point at the data or the tools, not the model.

Those questions, plus your notes on what a good answer looks like, become your test set. Add to it every time you meet a new failure, and the set slowly becomes a record of everything you've learnt about how the feature goes wrong.

Automating it

Only once you've read enough to know what you're looking for does automation make sense, in this order:

  • Code checks first. Cheap, exact and boring: does the answer contain a price? A date? A link to a page that exists? Does it mention a competitor?
  • A model marking answers later. For judgement calls ("is this tone helpful?") you can ask another model to mark answers against your notes. It's fast, but it's also sometimes wrong, so check its marks against your own on a sample until the two agree.
  • People stay in the loop. Re-read a sample every release. Real customers will always ask something your set didn't.

Run the set whenever anything changes: the prompt, the data, the tools, or the underlying model. A change that fixes one group of failures can quietly cause another.

Test yourself

Mark each of these Larder & Co answers as pass or fail before you open the reasoning.

Pass or fail?

1Customer: "Will the Tresco 28cm frying pan work on induction?" Assistant: "Yes, the Tresco pan has a magnetic base, so it works on all hobs, including induction." (The product data says: induction compatible.)

Fail. The first half is right, but "all hobs" goes beyond the data. Nothing in the product data supports it, and a wrong claim about another hob type becomes a return. The answer should stick to what was found.

2Customer: "Is the Aldwick blender in stock in Cambridge?" Assistant: "It's usually well stocked in our stores, so you should be fine to pop in today."

Fail. It never checked stock, and it sounds like a promise. A live fact needs a tool call. Even if the blender happens to be there, the process failed, and next time it won't be.

3Customer: "Can I have a refund on the knife I bought last month? It's gone dull." Assistant: "I can't change or approve refunds myself. Our returns policy is on this page, and I can pass you to customer service now."

Pass. It stays inside its limits, points to the policy and offers a human. It doesn't need to solve the problem to be a good answer.

4Customer: "What's the best knife set?" Assistant: "The Harrow 8-piece set is our most popular, with a block, and it's currently in the sale." (The sale ended last week, but the page cache still shows the old price.)

Fail, but not because of the model. The assistant used stale data. This is why you write down the reason: the fix is in how fresh the data is, not in the prompt. Without the note, you'd tune the wrong thing.

5Customer: "Do you do a copper pan for gas hobs under £60?" Assistant: "I couldn't find one that matches in our range. I'd rather not guess, so you may want to browse the copper pans, or ask our team."

Pass, provided there really is no match. Check that: if a £55 copper pan existed, this would be a retrieval failure that looks polite. Admitting it can't answer is only good when it's true.

Try it on your own work

This takes about 20 minutes. Write the three sections of criteria (how often it must be right, what it must never do, what happens when it can't answer) for one AI feature you've imagined for your own product. Then write ten realistic questions for it, and next to each, one line on what a good answer would say. You've just started a test set, and you'll have found out whether you can say what "good" means.

Next, Part 7 looks at what an AI feature should be allowed to do, and where the real money and trust risks sit.

Sources and further reading

I wrote this course with help from AI (Claude). Links and facts were last checked in November 2026.

  • AI
  • Product Management
  • Testing

Published 23 Nov 2026 Updated 23 Nov 2026