Blog & Insights

How do you evaluate an AI workflow before it goes live?

Measure three things on real cases: how often it is right, what it does with the cases it cannot handle, and whether human review catches its mistakes. Set the passing score before you test.

Before an AI workflow goes live, measure three things on real cases from your own business: how often it is right, what it does with the cases it cannot handle, and whether the human review step catches what it gets wrong. Agree on the passing score with the owner of the process before you run the first test. A demo answers none of these questions, because a demo shows the cases that work.

Why this is different from testing ordinary software

Ordinary software gives the same output for the same input, so a test that passes once keeps passing. A language model can give a different answer to the same input tomorrow, and a wrong answer looks as confident as a right one. So you measure it on a set of cases, and you measure it again whenever something changes. How We Test AI Before It Touches Your Business describes how we do this on our own work. The steps below are for evaluating any workflow, whoever built it.

1. Write down what correct means, and what a wrong answer costs

This comes first because nothing can be measured without it. For each thing the workflow produces, such as a field read from a document, a category, a draft or an action taken in another system, write down what a correct result is in the words the business already uses.

Then list the ways it can be wrong and what each one costs. A workflow that sends a good invoice to a person for review wastes a few minutes. A workflow that pays a bad invoice loses money. Those two errors need different passing scores.

Set the passing scores now, with the person who owns the process, and write them down. If you choose the number after you have seen the results, the number will be whatever the results were.

Q Investments, in Fort Worth, Texas, did this in the right order on a project we built for it. The firm wanted its people to be able to send an email asking for an office or home automation action, such as lights, heating and cooling or shades, and have the request carried out. In his review on Clutch, Kenneth Croft, the firm’s IT Manager, says success was defined at the start as identifying a clear request correctly on the first try 95% of the time, and that Q supplied 100 clear test cases. He reports that the system reached 80% within two weeks and the 95% target by the end of the project.

2. Build the test set from real cases

Collect real inputs from the last several months, with the correct result for each, agreed by the people who do the job today. Real cases matter because invented ones are cleaner than what arrives on a normal day.

  • Include the ordinary cases in roughly the proportion they occur.
  • Add the hard ones on purpose: the scanned page that is hard to read, the email that asks for two things, the record with a field missing.
  • Add cases the workflow should refuse, because they are outside what it was built for.
  • Hold some cases back. Whoever is building the workflow should never see them, so that the final measurement is on cases the workflow was not tuned to pass.

The test set belongs to your company. If a vendor built the workflow, ask for the set and the results, and keep adding to it.

3. Measure accuracy by kind of error

One overall percentage hides what you need to know. Break the result down.

  • By output. A workflow can read the invoice number correctly nearly every time and the tax amount much less often.
  • By kind of case. It can do well on the ordinary cases and badly on one supplier’s format.
  • By kind of error. Count separately the cases it got wrong with no warning and the cases it flagged for a person. The first kind matters most, because nobody knows to check it.

Run the set more than once, because the answers can vary between runs. Then compare the result with how the process performs today. If nobody knows how often people get it wrong now, have someone check a sample of last month’s work, and judge the workflow against that.

4. Test what it does with the cases it cannot handle

A workflow is safe when it stops on a case it cannot handle. Feed it bad cases and watch what it does.

  • An input that is empty, unreadable or in the wrong language.
  • A request it was never built for.
  • Two documents that contradict each other.
  • The same input sent twice.
  • Text inside a document that reads like an instruction to the model, such as a line telling it to approve the request.
  • A system it depends on that is slow or unavailable, including the model service itself.

For each one, the right behavior is the same. The workflow stops, sends the case to a named person with the reason, and leaves a record. It should not guess, and it should not fail without telling anyone.

5. Test the human review step as part of the system

If a person approves the output, that step is part of what you are evaluating. A reviewer who approves everything catches no errors.

  • Plant errors. Put known wrong results into the review queue and count how many the reviewers catch.
  • Look at the screen. The reviewer should see the source next to the result, with what the model was unsure about marked. If checking means opening another system, people stop checking.
  • Measure the time. Time how long a careful review takes and multiply it by the expected volume. If the total is more hours than the reviewers have, the reviews will get faster and worse.
  • Cover absences. Decide who reviews when the usual person is out, and what happens to the queue while it waits.

Decide as well which results need review at all. A person should approve anything that is costly or hard to undo. Routine results that are easy to reverse can go straight through, with a sample checked afterward.

6. Run it beside the current process

Before the workflow acts on anything, let it run on live work while people carry on as they do now, and compare the two. When the comparison holds, let it act for one team or one location, and widen from there.

7. Decide what you will keep checking after launch

Agree on these before launch.

  • Who looks at a sample of results each week, and how large the sample is.
  • That the whole test set runs again whenever the model, the prompt or the code changes.
  • That every case a person corrected is added to the test set.
  • What is logged for each run: the input, the output, what was done with it and who approved it.
  • How the workflow is switched off, who may do that, and how the work gets done while it is off.

Common questions

How accurate does an AI workflow have to be before it goes live? There is no general number. It depends on what a wrong result costs and on whether a person checks the result before anything happens. Set the passing score with the owner of the process, separately for each kind of error, and compare it with how often the process goes wrong today.

How many test cases do we need? Enough to cover every kind of case the workflow will meet, including the rare ones that would cost the most. A set with a few examples of each hard case is worth more than a large set of easy ones.

Who should build the test set? The people who do the job today, with IT organizing the work. They know what the right answer is and which cases are hard.

Do we have to test again when the model changes? Yes. Run the whole test set again whenever the model, the prompt or the surrounding code changes, and compare the result with the last run. A newer model can be better overall and worse on the cases you care about.

If you have a workflow that works in a demo and nobody can say whether it is ready, testing it against real cases before and after release is part of how we build under AI & Automation.

Related service: AI & Automation

More like this, in your inbox. Subscribe for our latest thinking, resources, and events.

Get started

Want results like these?