To evaluate an LLM app before it goes live, write down what good behavior looks like, turn it into scenarios with clear pass rules, and run them against the real system with its tools and data, including attack attempts as well as normal use. Then run the set again on every change. That’s how I work: Posific runs an evaluation suite on every change, and the mustashar.ae shop assistant faced 240 normal scenarios and 40 attack attempts before launch.

Why is LLM evaluation different from normal testing?

LLM evaluation means measuring whether a system built on a language model does what it should, using a fixed set of test cases, clear pass rules and runs you can repeat. It’s closer to product testing than to research benchmarks.

Normal software tests expect the same input to give the same output. LLM apps break that assumption. The same question can be answered in different words each time, many answers can be acceptable, and the worst failures look fine at a glance: a fluent, confident reply that is simply wrong.

So you test behavior rather than exact text. Did it use the right data? Did it call the right tool with the right inputs? Did it stay in scope, refuse what it should and hand off when it should? Did it reply in the user’s language?

Ordinary tests still matter. On mustashar.ae, CI runs lint, type checks, 239 automated tests, the build and a browser test of the chat. Evaluation sits on top of that foundation, not in place of it.

What does good look like? Write it down first

You can’t evaluate against a feeling. Before writing scenarios, write a short behavior spec with three parts:

  • Must do: for example, quote prices and stock from live data, reply in the user’s language, and show references when citing sources.
  • Must never do: invent a number, reveal hidden instructions, act without approval, or discuss another customer.
  • When unsure: ask a clarifying question, say it doesn’t know, or hand off to a person.
  • Tone and length: how formal it should sound, and how long a reply may run.

Every line should become something you can check. Noor AI is a good example of a checkable promise: it answers from Quran and hadith search with references, so an evaluation can confirm that references are present and point to real sources. Posific is another: because fixed rules calculate every figure, any number the AI mentions has an exact right answer to compare against.

Keep the spec next to the code and update it when the product changes, so the evaluations change with it.

How do you build an LLM evaluation scenario set?

A scenario is a realistic input, the context around it, and a rule that decides pass or fail. A useful set mixes four kinds:

  • Normal use: the questions and requests real users bring, in the words they actually use.
  • Edge cases: missing data, vague requests, out-of-stock items, very long or very short messages.
  • Language cases: every language you support, plus mixed-language messages if your users write that way.
  • Attacks: attempts to override instructions, pull out hidden ones, misuse tools or run up costs.

Where do good scenarios come from? Start with the questions your team answers every week, past support messages and the edge cases staff warn you about. If the product is new, ask the people who do the job today to write down what they hear most often.

For the mustashar.ae shop assistant, that meant 240 normal scenarios and 40 attack attempts before launch. Both halves matter. Attacks show the assistant can’t be pushed around; normal scenarios show the defenses haven’t made it useless. An assistant that refused everything would pass every attack test and fail every customer.

Write pass rules before you run anything. “The reply is good” isn’t a rule. “The quoted price matches the catalog, and the reply is in Arabic” is.

Which LLM evaluation metrics matter?

Generic text-similarity scores say little about an assistant that has to be right about your business. Track measures tied to the job:

  • Task success: the share of scenarios that pass their rule. This is the headline number.
  • Groundedness: whether every claim is supported by the data or sources the app retrieved.
  • Numeric accuracy: whether figures match the system of record exactly.
  • Tool-call accuracy: the right tool, with the right inputs, in the right order, and no calls that shouldn’t happen.
  • Refusal and handoff accuracy: declining what it should, helping with what it should, and handing off at the right moments.
  • Language and format: replies in the right language, script and structure.
  • Cost and latency: what each conversation costs and how long people wait. Noor AI, for example, has cost tracking built in.

Report each metric by category, not only as one average. A strong overall score can hide a category that fails badly, such as every Arabic edge case. A short list of measures you review every release beats a long one nobody reads.

How should you grade LLM outputs?

Use the cheapest grader that is reliable for each check:

  1. Code checks firstNumbers, tool calls, required fields, language, banned content and format can all be checked by ordinary code. These checks are fast, cheap and never change their minds.
  2. Model graders for judgmentTone, helpfulness and whether a reply actually answers the question are hard to code. A second model with a clear rubric can grade them, as long as you calibrate it against human judgments and never let it grade numbers or actions.
  3. People for the final wordRead a sample of conversations yourself, especially failures and narrow passes. Someone who knows the business will spot problems no rubric anticipated.
Grade what it did, not only what it said

A friendly reply that called the wrong tool, or changed a record without approval, is a failure however good it sounds.

How do you evaluate an AI agent, not just a chatbot?

When an LLM app can act, the reply is only part of the result. An agent scenario has to check the path it took and the state it left behind:

  • Which tools it called, in what order and with which inputs.
  • Whether an action that needs approval actually stopped and waited.
  • What changed in the system, compared with what should have changed.
  • Whether the audit trail recorded every step.
  • What happens when a tool fails, times out or returns something odd.

Run agent scenarios against a test copy of the system, never against live records. For an agent shaped like Wakeel, which calls a fixed rules engine through tools and waits for approval, a passing scenario is one where the rules engine supplied the answer, the approval step held, and the audit trail shows each step in order.

Why run evaluations on every change?

An LLM app changes more often than it seems. A prompt edit, a model update, a new tool, a rule change or fresh data can each shift behavior in ways nobody intended. That’s why Posific runs an evaluation suite on every change. Treat evaluations like any other test: if they fail, the change doesn’t ship.

Run two kinds. Offline runs use fixed scenarios and can use stand-ins for slow or costly parts, so they’re cheap enough to run constantly. Live runs exercise the real system end to end, with the real model, tools and data. Wakeel passed 11 of 11 live evaluation scenarios. Live runs are slower and cost more, but they catch what stand-ins hide: timeouts, tool errors and the model reacting to real data.

Set the bar per category. Attack and safety scenarios should pass in full before launch. For open-ended helpfulness, agree a standard with the people who run the business and watch the trend between releases.

After launch, turn every real failure into a new scenario. The set should grow from experience, so the same mistake can’t return unnoticed.

An LLM evaluation checklist before go-live

  • A written behavior spec: must do, must never do, and what to do when unsure.
  • Normal, edge, language and attack scenarios, each with a pass rule.
  • Code checks for numbers, tool calls and format, with model graders only where judgment is needed.
  • Agent scenarios that check tool calls, approvals and the audit trail, not only the reply.
  • A live, end-to-end run against the real system.
  • A browser test of the chat itself, so the interface works as well as the model.
  • Budget limits tested, so the app behaves sensibly when it reaches its cap.
  • Handoff tested, so a real person actually receives the conversation.
  • Evaluations set to run on every change.

Frequently asked questions

How many test scenarios does an LLM app need?

Enough to cover every behavior in your spec, every tool and every language, with attacks alongside normal use. There’s no universal number. I ran the mustashar.ae shop assistant through 240 normal scenarios and 40 attack attempts before launch, and Wakeel cleared 11 of 11 live evaluation scenarios. Start with what you can grade well, then grow the set from real failures.

Can I use an LLM to evaluate another LLM?

Yes, for qualities code can’t check, like tone or whether a reply really answers the question. Give the grader a clear rubric, compare its scores with human judgments on a sample, and recheck it when you change models. Never rely on a model grader alone for numbers, permissions or actions. Those deserve exact checks in code.

What is the difference between LLM evaluation and model benchmarks?

Benchmarks measure a model on general tasks someone else designed. Evaluating an LLM app measures your whole system on your tasks: your data, your tools, your languages and your rules. A model can score well on public benchmarks and still quote the wrong price in your shop. Benchmarks help you shortlist models; your own evaluations tell you whether to launch.

What should I do when an evaluation fails?

Find the layer that failed before changing anything. Was the data wrong, a rule wrong, a tool returning something unexpected, or the model misreading good inputs? Each has a different fix, and only the last one is a prompt or model problem. Fix it, add the case to your set if it isn’t there already, and run the full suite again.

An AI agent, an app, a platform or a growth problem. Tell me what you want to achieve and I’ll tell you how I’d build it.

Start a project