In 3 lines: what makes an AI assistant accurate and high quality?
- Correct and grounded: its answers are right and rest on your documents or data, without making things up.
- Useful and reliable: it answers the question asked, completely, in the right tone and language, and says "I don't know" or hands over to a person when it lacks the answer.
- Stable over time: these qualities are measured on a fixed test set, hold after every model or prompt change, and are monitored in production.
This article shows how to check this in practice: a golden set, metrics, LLM-as-judge, tools that work with Azure OpenAI and Microsoft 365, regression control and production monitoring.
Why evaluate an AI assistant?
An assistant can sound convincing and still be wrong. Evaluation lets you:
- measure accuracy before deployment instead of learning it from users;
- prevent regressions: a change of model, prompt or source documents can degrade answers that used to work;
- document risks (invented answers, data leaks, sensitive topics), which helps with compliance, especially in regulated sectors.
Four types of tests to combine
| Test type | Content | Purpose |
|---|---|---|
| Golden set | 30 to 50 real questions with the expected answer and source | Measure baseline quality and catch regressions |
| Edge and out-of-scope cases | Ambiguous, badly phrased or off-topic questions, attempts to bypass rules | Check that the assistant refuses or escalates instead of inventing |
| Load tests | Many simultaneous requests | Measure latency and stability |
| Human review | A sample reviewed by a domain expert | Calibrate automatic scores and judge tone and usefulness |
Public benchmarks (SQuAD, GLUE) compare models with each other. They do not measure how your assistant performs on your documents, so your own golden set remains essential.
Which metrics to use
| Metric | Question it answers | How to measure it |
|---|---|---|
| Correctness | Is the answer right? | Comparison with the expected answer, human or LLM judge |
| Groundedness | Is it based on the sources provided? | LLM judge given the question, the answer and the passages used |
| Relevance and completeness | Does it answer the question without missing anything important? | LLM judge or human review |
| Appropriate refusal | Does it decline when it does not know or must not answer? | "Out of scope" cases in the golden set |
| Latency and cost | Is it fast and affordable enough? | Direct measurement per request |
BLEU and ROUGE compare words with a reference text. They suit translation or summarisation, not enterprise Q&A where several wordings are correct, so do not rely on them alone.
LLM-as-judge and groundedness checks (RAG and Copilot-style assistants)
An LLM-as-judge is a language model that scores another model's answer against a precise rubric (for example 1 to 5 with a reason). A groundedness check verifies that each claim in the answer is supported by the retrieved passages; a claim absent from the sources is a hallucination. For a RAG assistant, also evaluate retrieval (were the right passages found?) separately from generation.
Caveats:
- Judge bias: an LLM judge may favour longer answers, its own style or the first answer shown. Use a written rubric, separate criteria (one score per criterion) and, when comparing two versions, swap the order of presentation.
- Calibration: have a human expert score 30 to 50 answers, compare with the judge and adjust the rubric while the gaps stay noticeable. An uncalibrated judge gives precise numbers that are not necessarily right.
- Critical cases: for risky topics (legal, medical, financial), human review remains the reference.
- Confidentiality: the judge sees your questions and answers. Run it under the same contractual setup as the assistant (for example an Azure OpenAI deployment in your own tenant).
Which tools to choose with Azure OpenAI and Microsoft 365
These tools apply to assistants you build (RAG, agents). Microsoft 365 Copilot is a managed service: it is mostly tested with a set of real prompts scored by business users.
| Tool | Use it when... |
|---|---|
| Microsoft Foundry (formerly Azure AI Foundry) evaluations and the Azure AI Evaluation SDK | You are already on Azure: ready-made evaluators (groundedness, relevance, completeness, agent evaluators), custom evaluators, continuous evaluation of production traffic, GitHub Actions or Azure DevOps integration (some features in preview) |
| promptfoo | You want declarative command-line tests, to compare prompts or models and to block a release in CI. Open source (MIT licence), now part of OpenAI according to its repository |
| DeepEval | Your team writes tests in pytest: faithfulness metrics, G-Eval (judge with free-form criteria), open source (Apache 2.0) |
| Ragas | You mainly evaluate a RAG pipeline (retrieval and generation) with dedicated metrics, open source (Apache 2.0) |
| TruLens | You want to trace and evaluate applications and agents with an OpenTelemetry approach, open source (MIT), with an OpenAI / Azure OpenAI provider |
| LangSmith | You already use LangChain or LangGraph and want a hosted platform for datasets, offline and online evaluations (commercial service) |
| OpenAI Evals | You want to reuse model-graded evaluations; designed for the OpenAI ecosystem, less direct for an assistant deployed on Azure |
For a Microsoft customer, a reasonable starting point is: Foundry evaluations if the assistant is already on Azure, otherwise promptfoo or DeepEval in CI. In every case, check in the documentation of the version you use that the judge model works with your Azure OpenAI deployment.
Copy-ready template: a 30 to 50 question golden set
Create a file (CSV or spreadsheet) with these columns:
id,category,question,expected_answer,source_document,must_refuse,criticality,language,validated_by,date
| id | category | question | expected answer | source | must refuse | criticality |
|---|---|---|---|---|---|---|
| Q01 | frequent | How many days of leave for a wedding? | (value from your internal policy) | HR policy, leave section | no | normal |
| Q31 | out of scope | What is my colleague's salary? | Polite refusal, pointer to HR | Confidentiality policy | yes | critical |
| Q38 | ambiguous | And for children? | Asks for clarification | n/a | no | normal |
The rows above only show the format: replace them with real questions from your users and answers validated by a business owner.
Suggested mix for 40 to 50 questions: about half frequent questions, the rest edge cases, ambiguous questions, out-of-scope cases and sensitive topics. Mark as critical the cases where an error is unacceptable.
Pass thresholds (starting points to adjust to your risk, not standards):
| Indicator | Starting threshold |
|---|---|
| Critical cases | 100% pass |
| Overall correctness | at least the current version's score, with a target agreed with the business |
| Groundedness | no unsupported answer on critical cases; judge threshold (for example 4 out of 5) on the rest |
| Appropriate refusals | all "must_refuse" cases pass |
| Latency | threshold set by use case (for example a maximum 95th-percentile time) |
Regression gate in CI: on every change of model, prompt, search settings or source documents, the pipeline runs the golden set and blocks the release if (1) a critical case fails, (2) the overall score drops by more than the agreed margin against the reference version, or (3) a refusal or groundedness threshold is missed. Store the results of each run so you can compare versions. To limit cost, run the full set on relevant changes rather than on every commit.
Illustrative example (hypothetical)
A Swiss SME tests an HR assistant with a 40-question set. Before a prompt change, 34 answers are correct (34/40 = 85%); afterwards 37 are (37/40 = 92.5%). The figures are made up for the example. The honest conclusion: three more correct answers is encouraging but too little to conclude, since one question is worth 2.5 points. Look at which ones changed, check that no critical case regressed and enlarge the test set before deciding.
Production monitoring: drift, feedback and re-testing
Evaluation does not stop at launch. Documents, user questions and models all change.
- Drift: track over time the share of poorly grounded answers, refusals, escalations to a person, latency and cost. A changing trend is a signal to investigate.
- Feedback loop: add a thumbs up/down and a free comment. Each badly rated answer becomes, once validated, a new row in the golden set.
- Production sampling: have a sample of real conversations scored by the LLM judge and a smaller one by a person, respecting data protection (Swiss nFADP, anonymisation where needed). Foundry offers continuous evaluation of production traffic; you can also build this with your own tools.
- Re-test on every change: new model version, deployment change, prompt edit, document base update. Run the golden set before switching and compare with the previous version.
- Alerts: define in advance the thresholds that trigger an alert and who is responsible.
Evaluating AI agents
An agent takes actions (tool calls, searches, writing to a system). Evaluating only the final text is not enough. Measure:
- the task success rate (was the requested task really completed?);
- tool-call errors (wrong tool, wrong parameters, failed or unnecessary calls);
- the human escalation rate: too low can hide errors, too high means a not very useful agent;
- compliance with instructions and action limits, plus the number of steps and cost per task.
Foundry's agent evaluators cover, among others, intent resolution, task adherence and tool-call accuracy. Sensitive actions (payment, sending, deletion) should stay subject to human approval.
Evaluation and monitoring checklist
- Goal, users and scope of the assistant defined, including what it must refuse.
- Golden set of 30 to 50 real questions, answers validated by the business, critical cases marked.
- Metrics chosen: correctness, groundedness, relevance, appropriate refusal, latency, cost.
- LLM judge with a written rubric, calibrated against human scores.
- Pass thresholds and a regression gate in CI.
- Re-test on every model, prompt or document change.
- For agents: task success, tool errors, escalation, human approval of sensitive actions.
- Production monitoring with user feedback, alerts and a named owner.
- Results and decisions documented.
Common mistakes
- Unrepresentative test set: questions invented by the technical team rather than asked by users.
- A single overall score: it hides failures on critical cases.
- A judge that is never checked: without comparing to human scores, you do not know what the score measures.
- One test before launch: without re-testing, quality degrades unnoticed.
FAQ
How many questions should the golden set contain?
Start with 30 to 50 real questions and grow it with production feedback. With so few cases, one question is worth several points, so do not draw conclusions from a small gap.
How often should an assistant be re-evaluated?
Before every change of model, prompt or source documents, then at regular intervals in production. Frequency depends on risk and usage volume.
Can an LLM judge be trusted?
Yes as a large-scale triage tool, provided it is calibrated against human scores, human review is kept for critical cases and its biases are known.
How do I test a WhatsApp chatbot before choosing a platform?
Prepare the same golden set of real questions, run it through each candidate platform and compare correctness, appropriate refusals, language, latency and cost on the same cases.
To set up a golden set, continuous evaluation and controlled agents on Azure OpenAI and Microsoft 365, see our AI agents or contact us.