Before releasing an LLM application, use a repeatable evaluation workflow to test whether its prompts produce accurate, safe, and consistent results. This checklist explains how to define test cases, build a small labeled dataset, select practical AI evaluation metrics, compare outputs, and record regressions as models, prompts, and workflows change.
Overview
LLM evaluation is more than asking whether an answer “looks good.” A production application may need to follow a specific format, cite only approved information, refuse unsafe requests, protect sensitive data, stay within a latency budget, and behave consistently across similar inputs. A prompt that succeeds during a demonstration can still fail when users phrase requests differently or when retrieved context contains ambiguous, irrelevant, or adversarial content.
An effective LLM evaluation framework turns those expectations into observable checks. The framework does not need to be large to be useful. A carefully selected set of representative, difficult, and high-risk examples is often more valuable than a large collection of loosely defined tests.
Start by documenting the application’s intended behavior. Define the input, the expected output, the unacceptable output, and the action the system should take when it cannot answer reliably. For a classification workflow, this may mean an approved label set and an abstention rule. For a retrieval-augmented generation application, it may include evidence requirements and a rule against unsupported claims. For a tool-using agent, it may include valid tool arguments, authorization boundaries, and recovery behavior.
For background on building reusable datasets and rubrics, see the LLM Evaluation Guide. Prompt evaluation also works best when paired with a documented prompt-development process, such as the workflow described in How to Build a Production-Ready Prompt.
Checklist by scenario
1. Define the evaluation contract
- Write the task in one sentence, including what the model is and is not responsible for.
- List required output fields, formats, labels, and validation rules.
- Define what counts as a correct, partially correct, unsafe, or unusable answer.
- Specify when the model should ask for clarification, abstain, or hand off to a human.
- Separate hard requirements from preferences. A valid JSON response may be mandatory, while a particular writing style may be scored separately.
2. Build a small golden dataset
Create a versioned set of examples that represents real usage rather than idealized demonstrations. Include common requests, short and long inputs, incomplete inputs, spelling variations, edge cases, and examples that previously caused failures.
- Typical cases: the inputs the application handles most often.
- Boundary cases: empty fields, unusually long text, mixed languages, ambiguous wording, and unusual formatting.
- Adversarial cases: prompt injection attempts, conflicting instructions, malicious content, and requests to reveal hidden instructions.
- Safety cases: sensitive personal data, regulated or high-impact decisions, and requests that require refusal or escalation.
- Regression cases: every important failure discovered in testing or production.
Store the input, relevant context, expected behavior, evaluation notes, dataset version, prompt version, model identifier, and result. Do not place real confidential data in a test set unless its use has been approved and appropriate safeguards are in place. A guide to PII redaction for LLM pipelines can help teams design safer test fixtures.
3. Select metrics that match the task
Use several metrics rather than one broad quality score. The right combination depends on the application:
- Task accuracy: whether the answer, label, extraction, or action is correct.
- Groundedness: whether claims are supported by the supplied documents or data.
- Completeness: whether required points or fields are present.
- Format validity: whether the response conforms to the required schema and can be parsed.
- Safety: whether the system avoids prohibited actions, unsafe guidance, data exposure, and instruction leakage.
- Consistency: whether equivalent inputs receive equivalent classifications or appropriately similar answers.
- Abstention quality: whether the application declines or escalates when confidence or evidence is insufficient.
- Operational measures: latency, token usage, error rate, and tool-call success, measured according to the application’s requirements.
For subjective tasks such as summarization, use a rubric with explicit dimensions. For example, score factual faithfulness, coverage of important points, readability, and unnecessary detail separately. Human review remains valuable for calibrating the rubric and checking automated graders. An automated judge should be treated as an evaluation aid, not as unquestionable ground truth.
4. Compare prompts and models systematically
Keep the dataset and scoring method fixed while comparing prompt or model versions. Record results in an evaluation matrix rather than relying on a single successful example.
| Version | Task score | Safety result | Format validity | Latency | Notes |
|---|---|---|---|---|---|
| Prompt A / Model X | Record score | Pass, fail, or review | Valid or invalid | Record measure | Known trade-offs |
| Prompt B / Model X | Record score | Pass, fail, or review | Valid or invalid | Record measure | Changed behavior |
Compare failure categories, not only averages. An overall improvement may hide a serious safety regression or a decline in performance for a smaller but important user group. For applications that call tools, test argument validation, permissions, retries, and failure recovery separately; the LLM tool calling guide covers these workflow concerns.
5. Add regression testing to the release process
Run a fast smoke set for every prompt change, a broader suite before release, and a full review when changing models, retrieval logic, tools, or safety controls. Mark each failed case with a category, severity, owner, and disposition. A release candidate should not be judged only by new examples; it must also preserve behavior that the application already depends on.
What to double-check
- Test data quality: Confirm that expected answers were reviewed by someone who understands the task. Ambiguous labels produce misleading scores.
- Context fidelity: For RAG systems, verify whether the retrieved passages actually contain the evidence needed to answer. A generation failure and a retrieval failure require different fixes.
- Prompt injection resistance: Include instructions hidden in documents, user inputs, and tool outputs. Review the dedicated prompt injection defense checklist.
- Long-context behavior: Test inputs near practical context limits, not only short examples. Truncation and compression can remove instructions or evidence; see the context window management guide.
- Structured output: Validate the response with a parser or schema checker. Do not treat visually plausible text as valid structured data.
- Distribution changes: Check whether your dataset still reflects current users, languages, document types, and workflow paths.
- Cost and latency: Measure operational behavior under realistic input sizes and concurrency. Quality gains may not justify a change if the workflow becomes impractical; use a documented cost and latency audit.
- Privacy: Ensure test logs, traces, prompts, and model responses do not expose data that should be masked or access-controlled.
Common mistakes
Testing only happy paths. A small set of polished examples measures demonstration quality, not production readiness. Add ambiguous, incomplete, adversarial, and previously failed cases.
Optimizing for one score. A higher task score can coincide with worse safety, poorer format compliance, or more unsupported claims. Use a scorecard with thresholds and trade-offs that stakeholders have reviewed.
Changing multiple variables at once. If the prompt, model, retrieval settings, and post-processing all change together, the cause of an improvement or regression becomes difficult to identify. Isolate changes where practical.
Using an LLM judge without calibration. Define a rubric, test the judge against human-reviewed examples, and sample outputs for manual review. Judge disagreement is a signal to improve the evaluation process.
Ignoring abstention and escalation. Reliable systems are not expected to answer every request. Evaluate whether the application recognizes uncertainty and routes difficult cases safely.
Failing to version artifacts. Store the prompt, model settings, retrieval configuration, tool schemas, dataset, evaluator version, and results together. Without this record, regression debugging becomes guesswork.
When to revisit
Revisit the evaluation suite before each planned release and whenever a workflow or tool changes. It should also be reviewed when you change the model, system prompt, retrieval source, context-window strategy, tool schema, safety control, or output parser. New user feedback and production incidents should become regression cases after they have been sanitized and reviewed.
During seasonal planning cycles, check whether the dataset still represents current demand, terminology, document formats, and escalation paths. Review thresholds when the business impact of errors changes. A support assistant, an internal search tool, and an automated transaction workflow may require very different tolerance for errors even if they use similar prompts.
Use this short pre-release checklist:
- Confirm the task contract, expected outputs, and abstention rules.
- Run representative, boundary, safety, adversarial, and regression cases.
- Review task quality, groundedness, safety, consistency, format validity, latency, and cost.
- Compare the candidate with the current version using the same dataset and rubric.
- Investigate every severe failure and document accepted trade-offs.
- Version the prompt, model configuration, dataset, evaluator, and results.
- Set a follow-up date and define which production signals will trigger an earlier review.
LLM prompt testing is most useful when it becomes an ordinary engineering practice rather than a final demonstration. Keep the evaluation matrix small enough to run regularly, detailed enough to explain failures, and current enough to represent the application users actually experience.