Evaluation and Validation for Generative AI
Four evaluator families, one selection rule
Every evaluation starts with one question: what can you compare the answer against? That single choice picks which family of evaluator you reach for, so start there rather than with a specific metric name.
Azure AI Evaluation ships its built-in evaluators[1] in four families, each defined by what does the judging and what input it needs:
- AI-assisted quality evaluators (groundedness, relevance, coherence, fluency) use a GPT model as an LLM-as-a-judge[2].
- Textual-similarity (NLP) evaluators (F1, BLEU, GLEU, ROUGE, METEOR) compute token or n-gram overlap against a reference answer, with no model in the loop.
- Risk and safety evaluators (violence, sexual, self-harm, hate/unfairness, and more) call a Microsoft-hosted service to score harmful content.
- Agentic evaluators (intent resolution, tool-call accuracy, task adherence) judge how an agent behaved, not just its final text.
Four data terms decide the rest. The query is the input sent to your app, the response is what the app returned, the context is the grounding or source documents a retrieval step supplied, and the ground_truth is a known-correct reference answer written by a human. An evaluation dataset carries whichever of these four each chosen evaluator needs, and no more.
The selection rule falls straight out of the families. If you have a fixed ground_truth, use an NLP-similarity metric. If you have context but no reference, use groundedness or relevance. If you have neither, use the LLM-judge quality metrics. To screen for harmful content, use the hosted safety evaluators. The figure groups the families and their members so you can see the whole catalog at a glance before the sections that follow drill into each one.
The evaluate() harness: dataset, mapping, logging
One evaluator on one row is a spot check; real evaluation runs a set of evaluators over a whole dataset. That is what the evaluate()[2] API in the azure-ai-evaluation SDK does: it runs many built-in and custom evaluators over one dataset in a single pass and returns both aggregate metrics and per-row scores.
The dataset is a file path, not an in-memory list. JSON Lines (JSONL, one JSON object per line) is the standard format used across the documentation and is required for the results charts to render in your project; the SDK API reference for the data parameter states plainly that "JSONL and CSV files are supported"[3]. Passing a Python list or a bare JSON array instead is the classic mistake.
Mapping columns to evaluator inputs
Evaluators look for specific keywords (query, response, context, ground_truth). When your dataset's column names differ, a column_mapping inside evaluator_config re-aligns them: use ${data.<column>} to point at a dataset column and ${outputs.<field>} to point at a value your target (the app or function under evaluation that produced the outputs) generated. A "default" mapping applies to every evaluator, while a per-evaluator mapping overrides it.
Run several evaluators over one JSONL dataset and log to Foundry
from azure.ai.evaluation import evaluate, GroundednessEvaluator, RelevanceEvaluator
# model_config supplies the GPT judge for the AI-assisted evaluators
# ...
result = evaluate(
data="data.jsonl", # file path; JSONL standard, CSV also supported
evaluators={
"groundedness": GroundednessEvaluator(model_config),
"relevance": RelevanceEvaluator(model_config),
},
evaluator_config={
"groundedness": {
"column_mapping": {
"query": "${data.queries}",
"context": "${data.context}",
"response": "${data.response}",
}
},
# ...
},
azure_ai_project=azure_ai_project, # optional: log the run to Foundry
)
print(result.studio_url) # link to the run in your Foundry project
The data argument is the JSONL file; the evaluators dict pairs an alias with each evaluator; and the evaluator_config block holds the column_mapping that binds the dataset's queries column to the evaluator's expected query keyword. Passing azure_ai_project logs the run so the aggregate and per-row scores appear in the portal, reachable through result.studio_url. The # ... lines mark model setup and further mappings omitted for brevity. Composite evaluators such as QAEvaluator bundle several quality metrics into a single entry when you want them all at once.
AI-assisted quality metrics and the LLM judge
When there is no reference answer to diff against, let a model judge the writing. The four AI-assisted quality evaluators do exactly that, and they share one mechanism: each sends the data to a GPT deployment you name in model_config (an AzureOpenAIModelConfiguration), and each returns a 1-to-5 Likert score where higher is better, with a default pass threshold of 3 and a written reason. Because a language model does the scoring, these are the LLM-as-a-judge metrics.
What differs between them is which inputs each one reads:
| Evaluator | Reads | Measures |
|---|---|---|
| Groundedness | response, context (query optional) | Is the answer supported by the supplied context? |
| Relevance | query, response | Does the answer address the question? |
| Coherence | query, response | Does the answer hang together logically? |
| Fluency | response | Is the text grammatical and readable? |
Two of these form the retrieval-augmented generation (RAG) pair: groundedness and relevance[4] exist to catch a RAG system that either invents facts absent from its sources (ungrounded) or answers off-topic (irrelevant). The other two are general-purpose[5] writing-quality checks. Watch the input requirement that trips people up: coherence requires both the query and the response, while fluency reads the response alone. It is tempting to assume coherence needs only the answer, but it scores the answer as a reply to the question, so it needs the question too. These relevance and groundedness signals also feed straight into RAG tuning; see optimizing RAG performance.
One member breaks the mold. GroundednessProEvaluator (preview) detects ungrounded claims using the hosted Foundry evaluation service rather than your GPT judge, so it takes azure_ai_project instead of model_config and returns a boolean pass/fail rather than a 1-to-5 score. Treat it as a safety-style evaluator that happens to measure groundedness, and do not wire a model_config to it.
Textual-similarity (NLP) metrics
Sometimes you already know the right answer. When a fixed reference (the ground_truth) exists and exact wording overlap is the test, skip the LLM judge entirely and use the textual-similarity NLP evaluators[6]. They score how much the response overlaps the ground_truth by token or n-gram math, need no GPT deployment, and are all generally available. In the SDK they are named F1Score, BleuScore, GleuScore, RougeScore, and MeteorScore (the F1/BLEU/GLEU/ROUGE/METEOR metrics named elsewhere on this page).
| Evaluator | Overlap it scores | Output | Default threshold |
|---|---|---|---|
| F1Score | Shared tokens (precision and recall) | 0-1 float | 0.5 |
| BleuScore | N-gram overlap (machine translation) | 0-1 float | 0.5 |
| GleuScore | Per-sentence variant of BLEU | 0-1 float | 0.5 |
| RougeScore | Recall-oriented n-gram overlap | 3 floats: precision, recall, F1 | 0.5 each |
| MeteorScore | Overlap with synonyms and stemming | 0-1 float | 0.5 |
All five take just ground_truth plus response and return a 0-to-1 float against a default 0.5 threshold, with one exception: RougeScore returns three separate scores (precision, recall, and F1), each judged against its own 0.5 threshold. The selection rule is deterministic: pick a similarity metric when a fixed reference answer exists and exact overlap is the criterion (machine translation, fixed-answer retrieval, NLP benchmarking); when there is no ground truth to compare against, fall back to the AI-assisted quality metrics from the previous section. These metrics also cannot run at all without a ground_truth.
One name trap: SimilarityEvaluator looks like it belongs in this table, but it does not. It measures semantic similarity with an LLM judge, so it scores 1 to 5 and needs a model_config and deployment, exactly like the quality metrics. The math-only evaluators above never touch a model.
Risk and safety evaluation
Quality is not the only risk; a fluent, well-grounded answer can still be harmful. The risk and safety evaluators[7] catch that, and they work differently from every metric so far: they run inside a Microsoft-hosted Foundry evaluation service, not on your GPT judge. You instantiate them with your Foundry project (azure_ai_project) and a credential, never a model_config or deployment_name.
The 0-to-7 severity scale
The four content-harm evaluators (ViolenceEvaluator, SexualEvaluator, SelfHarmEvaluator, HateUnfairnessEvaluator) return a 0-to-7 severity score, bucketed as Very low (0-1), Low (2-3), Medium (4-5), and High (6-7). Read this scale the opposite way to the quality metrics: here a higher number means more harmful. Given the default threshold of 3, a response scores pass when its severity is at or below 3 and fail when it is above. Over a whole dataset the service reports a defect rate: the percentage of responses whose severity exceeds the threshold, which is the intended dataset-level signal rather than a single worst-case score. ContentSafetyEvaluator is a composite that runs all four harms at once for one combined result.
Beyond the four harms: pass/fail evaluators
Not every safety evaluator uses the 0-7 scale. IndirectAttackEvaluator (cross-domain prompt injection, XPIA) returns a boolean pass/fail: fail means the response obeyed a jailbreak instruction hidden inside retrieved context or a source document, not one typed into the user's own prompt. ProtectedMaterialEvaluator also returns pass/fail, flagging text under copyright (song lyrics, recipes, articles) via the Azure AI Content Safety Protected Material for Text service. So do not assume every risk evaluator emits a severity number; several are simple booleans.
One operational constraint: because these run on hosted safety models, the service (and adversarial red teaming) is available only in select regions[8] such as East US 2, France Central, and Sweden Central. Create the Foundry project in a supported region, and check the current region list before you rely on it, because coverage changes over time.
Generating test data and red teaming
You cannot evaluate what you cannot feed the evaluators, and real production traffic is often missing early on. Azure AI Evaluation gives you two ways to manufacture inputs, and they serve opposite purposes.
Non-adversarial: the Simulator
The Simulator[9] class generates non-adversarial synthetic query and response conversations from a text blob or a search index. It gives you consistent, repeatable inputs so you can compare prompt variants without waiting for live users. Reaching for a content filter or a blocklist to build a test set is a category error: filters moderate content at runtime, they do not generate a controlled dataset.
Adversarial: red-team data and the AI Red Teaming Agent
For safety testing you want inputs designed to break the system. AdversarialSimulator produces red-team datasets using a service-hosted model with its safety behaviors turned off; DirectAttackSimulator builds user-prompt injection (UPIA) jailbreak data, and IndirectAttackSimulator builds cross-domain (XPIA) data. All of these need a Foundry project (azure_ai_project) and run only in the supported safety regions.
The AI Red Teaming Agent[10] (preview) automates the whole campaign rather than just building a dataset. Built on Microsoft's open-source PyRIT (Python Risk Identification Tool) framework, it probes a model, application, or agent endpoint with seed attack objectives, converts them with attack strategies (such as Base64 encoding, Flip, and the multi-turn Crescendo escalation) to slip past the model's safety alignment, scores each attack-response pair with the hosted Risk and Safety Evaluators, and reduces the run to an Attack Success Rate (ASR): the percentage of attacks that elicited an undesirable response. It emits a scorecard broken down by risk category to drive a pre-deployment go/no-go decision. Keep the three tools straight: Simulator builds benign data, AdversarialSimulator builds a red-team dataset, and the AI Red Teaming Agent runs the end-to-end scan that produces the ASR.
Agentic evaluation and CI/CD quality gates
Evaluating agents, not just answers
An agent can produce a perfectly fluent final message while calling the wrong tool or ignoring its instructions, so agent quality needs its own agentic evaluators[2]. IntentResolutionEvaluator checks whether the agent correctly understood what the user wanted; ToolCallAccuracyEvaluator checks whether the right tools were called with the right parameters (on a 1-to-5 rubric); and TaskAdherenceEvaluator checks whether the agent followed its instructions and stayed on task. These read the agent message schema, including the tool_calls trace, so evaluating an agent means capturing its tool-invocation trace as input, not only the final assistant message. That is why agent evaluation is tightly coupled to tracing; see observability for generative AI.
Custom evaluators
When no built-in metric fits your domain, write your own and pass it to the same evaluate() run. A custom evaluator[11] is either a code-based Python callable or class (for a deterministic score such as answer length or a regex match) or a prompt-based Prompty file that instructs a judge model with your own rubric. Both slot into the evaluators dictionary alongside the built-ins, so a run can mix built-in and custom metrics in one pass.
From manual check to CI/CD gate
Evaluation earns its keep when it stops being a one-off notebook run. Cloud (remote) evaluation[12] lets you wire evaluation into a CI/CD (continuous integration and delivery) pipeline such as GitHub Actions as an automated quality gate, failing a build or blocking a release when a quality or safety score falls below threshold. Build all of this on the azure-ai-evaluation SDK plus Foundry evaluations. The older Evaluate-with-prompt-flow[13] workflow is on a retirement path, with prompt flow scheduled to retire on April 20, 2027, so it is not the tool to choose for new evaluation work.
Exam-pattern recognition
Most AI-300 questions on this objective test one distinction. Read the stem for the signal, then pick the answer that matches.
- Data shape: 'a fixed correct answer exists' or 'compare against a reference' points to an NLP-similarity metric (F1, BLEU, ROUGE) and a
ground_truth; 'no reference answer' points to the AI-assisted quality metrics. - RAG signals: 'grounded in the retrieved documents' means groundedness (needs
context); 'answers the question asked' means relevance. No context supplied means groundedness has nothing to score. - Coherence vs fluency inputs: coherence needs the
queryand theresponse; fluency needs only theresponse. A stem that supplies just responses and asks about writing quality points to fluency. - Config object: a GPT
model_configmeans an AI-assisted quality metric;azure_ai_projectwith no model means a hosted safety evaluator. Passingmodel_configto a safety evaluator is wrong. - Scale direction: a 1-to-5 score where higher is better is a quality metric; a 0-to-7 score where higher is worse is content-safety severity, with pass at or below the default threshold of 3.
- Dataset-level safety: the intended aggregate is the defect rate (share above threshold), not a single worst-case score.
- Generate vs attack:
Simulatorfor benign test data;AdversarialSimulatorfor a red-team dataset; the AI Red Teaming Agent for an end-to-end scan that reports an Attack Success Rate. Content filters do not generate datasets. - Agents: evaluating an agent needs the
tool_callstrace and the agentic evaluators (intent resolution, tool-call accuracy, task adherence), not just groundedness on the final text. - Automation: 'block a release when quality drops' means cloud evaluation as a CI/CD gate; new work uses the Azure AI Evaluation SDK, not prompt flow.
Built-in evaluator families in Azure AI Evaluation
| Property | AI-assisted quality | Textual similarity (NLP) | Risk and safety | Agentic |
|---|---|---|---|---|
| Example evaluators | Groundedness, Relevance, Coherence, Fluency | F1, BLEU, GLEU, ROUGE, METEOR | Violence, Sexual, SelfHarm, HateUnfairness, IndirectAttack | IntentResolution, ToolCallAccuracy, TaskAdherence |
| What judges | GPT model as LLM judge | Math over token/n-gram overlap, no judge | Microsoft-hosted safety service | LLM judge over the agent trace |
| Required input | query, response, context (coherence: query+response; fluency: response only) | response + ground_truth | query + response | query, response, tool-call trace |
| Score and threshold | 1-5 Likert, higher better, pass at or above 3 | 0-1 overlap, pass at or above 0.5 | 0-7 severity, higher worse, pass at or below 3 | LLM-judge scores, e.g. 1-5 |
| Config object | model_config (AzureOpenAIModelConfiguration) | none | azure_ai_project + credential | model_config |
| Region-limited | No | No | Yes, select regions | No |
Decision tree
Sharp facts the exam loves — give these one last read before exam day.
Cheat sheet
Sharp facts the exam loves — scan these before test day.
- The evaluate() API takes a dataset file path, standardly JSONL
The Azure AI Evaluation SDK evaluate() API takes a test dataset as a file path, not as an in-memory list or a plain JSON array. JSON Lines (JSONL, one JSON object per line) is the standard format used throughout the documentation and tooling, and the current API reference also accepts CSV; each record supplies the fields the chosen evaluators need.
Trap Assuming evaluate() ingests an in-memory Python list or a plain JSON array file; it requires a dataset file path (JSONL standard).
5 questions test this
- An engineer is generating a 500-record evaluation dataset for a Foundry chat app and must hand it to the Azure AI Evaluation SDK evaluate() API so the batch run parses every record. The engineer needs
- A teammate prepares an evaluation dataset for a Foundry app by writing all of the test records into one file as a single, comma-separated JSON array wrapped in square brackets, then points the Azure A
- An engineer on your team writes a Python script that builds the test cases for a Foundry app as a list of dictionaries in memory, then calls the Azure AI Evaluation SDK evaluate() API and passes that
- A data scientist prepared an evaluation dataset for a summarization app as a single .json file containing one big JSON array of all the record objects, then passed it to the Azure AI Evaluation SDK ev
- Your GenAIOps team maintains a set of test cases for a retrieval-augmented chatbot in Microsoft Foundry and wants to run several built-in quality evaluators over the whole set at once with the Azure A
- Evaluation records carry query, response, context, and ground_truth
An evaluation record can contain up to four elements: query (the input sent to the app), response (the app output), context (the grounding/source documents), and ground_truth (a human reference answer). Which are required depends on the evaluator; groundedness and relevance need context, while similarity and F1 need ground_truth.
Trap Omitting context for a groundedness run or ground_truth for a similarity run, so the evaluator scores against empty input.
9 questions test this
- An MLOps engineer configures one evaluate() run that applies two evaluators to the same JSONL dataset for a RAG assistant: GroundednessEvaluator to check the answer against its source, and F1ScoreEval
- A new MLOps engineer asks you what an evaluation record in an Azure AI Evaluation SDK JSONL dataset may contain, because different built-in evaluators need different inputs. You explain that a record
- You run the groundedness evaluator over a JSONL dataset for a Foundry RAG assistant. On some rows the context field is missing or null because those turns had no retrieved passages. The run completes
- A team has a JSONL evaluation dataset for a RAG assistant in which every record contains a query, the app's response, and the retrieved context, but no human-authored reference answer was ever collect
- An MLOps engineer runs the GroundednessEvaluator across a JSONL test dataset for a retrieval-augmented assistant, but every record contains only a query and a response. Because groundedness measures w
- You evaluate a live Foundry app by giving the Azure AI Evaluation SDK evaluate() API a target callable so the app generates each response at run time. Your JSONL dataset contains only a query column;
- Your evaluation dataset for a Foundry chatbot stores each turn under the column names user_question, bot_answer, and source_docs, but the built-in relevance and groundedness evaluators expect the keyw
- You are preparing a JSONL test dataset to evaluate a retrieval-augmented assistant in Microsoft Foundry with the Azure AI Evaluation SDK. You will run the groundedness evaluator, which checks whether
- Your GenAIOps team maintains a set of test cases for a retrieval-augmented chatbot in Microsoft Foundry and wants to run several built-in quality evaluators over the whole set at once with the Azure A
- column_mapping aligns dataset columns to evaluator inputs
When dataset column names differ from the keywords an evaluator expects, you map them with column_mapping inside evaluator_config, using ${data.} to reference a dataset field and ${outputs.} to reference a value produced by a target; a default mapping applies to all evaluators. Comprehensive evaluation is achieved by mapping every required field for each evaluator.
Trap Assuming columns must literally be named query/response; mismatched names without a column_mapping feed the evaluator empty values.
6 questions test this
- An engineer calls evaluate() with a target set to a live askwiki app so the app generates each answer at run time, while the input questions come from a column in the JSONL dataset. In the evaluator_c
- An engineer configures an evaluate() run that applies four different evaluators to the same JSONL dataset, whose columns share the same nonstandard names across every evaluator. Rather than repeat an
- An engineer runs evaluate() with the RelevanceEvaluator over a JSONL dataset whose columns are named user_question and bot_answer rather than the query and response keywords the evaluator expects. Eve
- You run five built-in evaluators over one JSONL dataset with the Azure AI Evaluation SDK. The dataset uses the same nonstandard column names for query, response, and context across every row, and all
- You evaluate a live Foundry app by giving the Azure AI Evaluation SDK evaluate() API a target callable so the app generates each response at run time. Your JSONL dataset contains only a query column;
- Your evaluation dataset for a Foundry chatbot stores each turn under the column names user_question, bot_answer, and source_docs, but the built-in relevance and groundedness evaluators expect the keyw
- Simulator generates non-adversarial synthetic evaluation data
The azure.ai.evaluation.simulator.Simulator class produces non-adversarial synthetic query/response conversations from a text blob or search index, giving consistent, repeatable evaluation inputs when no production data exists. It is the tool for building a controlled dataset to compare prompt variants without live user traffic.
Trap Reaching for content filters or a blocklist to create evaluation inputs; those moderate content, they do not generate a controlled test dataset.
13 questions test this
- Your team is preparing to compare three prompt variants for a new retail-support chatbot in Microsoft Foundry, but the assistant has not launched yet, so no real user conversations exist. You must bui
- Your team wants to score a new knowledge-base assistant by using the Azure AI Evaluation SDK's relevance and groundedness evaluators, but the assistant has no production traffic and you have no labele
- You have only a plain-text export of your product documentation. No Azure AI Search index has been built for it, and there is no production conversation history. To evaluate a knowledge-base assistant
- Before launching a Foundry question-and-answer assistant, your team has a list of candidate questions but no answered examples and no production data. To benchmark two prompt variants, you first need
- A QA lead wants a stable benchmark of user inputs that stays identical on every evaluation run, so that when developers tweak the prompt or swap the model the team can attribute score changes to those
- A safety team must assemble a red-team dataset that measures how often a deployed assistant emits hateful, violent, sexual, or self-harm content across question-answering and summarization tasks. They
- An MLOps engineer needs a red-team dataset of harmful prompts to test how a deployed customer assistant responds, but when the team tries to make their own model deployment produce such prompts, its c
- A GenAIOps engineer must regression-test a Foundry summarization app across weekly builds. Each week the same set of benign evaluation inputs must be reproduced so score changes reflect the model, not
- A healthcare support team must benchmark two system-prompt variants of a new patient-facing assistant before launch. There is no production traffic yet, and compliance rules forbid using real patient
- Two teams share a Foundry project. The quality team only needs a benign set of typical customer questions and grounded answers to benchmark three prompt variants of a travel-booking assistant before l
- You are configuring the Simulator class in the Azure AI Evaluation SDK to produce grounded, non-adversarial query-response pairs for a knowledge-base assistant that answers questions about your produc
- Your team already generates benign evaluation data with the Simulator, which needs no Azure AI project. You now want to add a red-team safety dataset by running the AdversarialSimulator against your d
- An MLOps engineer tries to run AdversarialSimulator to build a jailbreak safety dataset, but the job errors out before generating anything. The Foundry project backing the run lives in the Central Ind
- AdversarialSimulator builds red-team safety datasets and needs a Foundry project
AdversarialSimulator, driven by an AdversarialScenario enum, generates adversarial (red-team) datasets using a service-hosted model with safety behaviors turned off; it requires a Foundry project and runs only in East US 2, France Central, UK South, and Sweden Central. DirectAttackSimulator produces user-prompt (UPIA) jailbreak data and IndirectAttackSimulator produces cross-domain (XPIA) jailbreak data.
Trap Expecting adversarial simulation to run in any region; the hosted safety service is limited to four regions and needs azure_ai_project.
11 questions test this
- You are hardening a generative AI chatbot and need a dataset that specifically tests its resistance to jailbreak instructions that a malicious end user types directly into the chat, a user-prompt-inje
- You have only a plain-text export of your product documentation. No Azure AI Search index has been built for it, and there is no production conversation history. To evaluate a knowledge-base assistant
- A team wants to run AdversarialSimulator to generate a safety-evaluation dataset, but their Azure AI Foundry project is deployed in Central US and the run fails to start. The adversarial capability de
- A safety team must assemble a red-team dataset that measures how often a deployed assistant emits hateful, violent, sexual, or self-harm content across question-answering and summarization tasks. They
- You initialize AdversarialSimulator with your credential and azure_ai_project and now must tell it which category of adversarial content to generate for a summarization app, such as content-harm probi
- An MLOps engineer needs a red-team dataset of harmful prompts to test how a deployed customer assistant responds, but when the team tries to make their own model deployment produce such prompts, its c
- A healthcare support team must benchmark two system-prompt variants of a new patient-facing assistant before launch. There is no production traffic yet, and compliance rules forbid using real patient
- Two teams share a Foundry project. The quality team only needs a benign set of typical customer questions and grounded answers to benchmark three prompt variants of a travel-booking assistant before l
- A retrieval-augmented Foundry assistant answers questions using documents it pulls from an internal knowledge store. Your security team is worried an attacker could hide malicious instructions inside
- Your team already generates benign evaluation data with the Simulator, which needs no Azure AI project. You now want to add a red-team safety dataset by running the AdversarialSimulator against your d
- An MLOps engineer tries to run AdversarialSimulator to build a jailbreak safety dataset, but the job errors out before generating anything. The Foundry project backing the run lives in the Central Ind
- Groundedness, relevance, coherence, and fluency are the core AI quality metrics
Groundedness, relevance, coherence, and fluency are the AI-assisted quality evaluators. Groundedness and relevance are RAG-oriented (groundedness checks the response against supplied context; relevance checks the response against the query), while coherence and fluency are general-purpose language-quality metrics — coherence scores how well the response hangs together as an answer to the query (requires query + response), whereas only fluency judges the response text alone.
Trap Selecting groundedness when no context/grounding documents are provided; without context there is nothing to measure groundedness against.
8 questions test this
- A team tries to evaluate an open-ended brainstorming assistant in your Foundry project by running the BLEU and ROUGE textual-similarity metrics, but every row errors out because the feature has no sin
- A summarization capability in Microsoft Foundry produces multi-paragraph summaries. Reviewers report that some summaries are factually correct and grammatically clean, yet read as disjointed, with ide
- A Principal MLOps engineer operates a retrieval-augmented customer-support assistant in a Microsoft Foundry project. Each answer is generated from passages retrieved from a grounding knowledge base, a
- An internal engineering-support assistant in a Microsoft Foundry project answers each question from wiki articles retrieved into the prompt as context. Reviewers find the replies are on-topic and well
- In a Microsoft Foundry project you must automatically check whether an assistant's answers actually address what each user asked, scoring the accuracy, completeness, and direct relevance of the respon
- A policy-question assistant in a Microsoft Foundry project answers from HR handbook sections retrieved as context. Every reply stays faithful to the retrieved text and invents nothing, but reviewers n
- A question-answering feature in Microsoft Foundry sometimes returns well-written, fluent answers that drift off and never actually address what the user asked. You need an evaluator that scores how di
- In Microsoft Foundry you must evaluate an open-ended brainstorming assistant whose creative responses have no single fixed correct answer, so no ground-truth reference exists. A teammate proposes scor
- Quality evaluators use an LLM judge and a 1-5 Likert score
AI-assisted quality evaluators use an LLM-as-a-judge, so you must supply a GPT model deployment in model_config (AzureOpenAIModelConfiguration). They score on a 1-to-5 Likert scale where higher is better, apply a default pass threshold of 3, and return a reason for the score.
Trap Configuring a model_config for the risk and safety evaluators; only the AI-assisted quality/RAG evaluators use a GPT judge, safety evaluators do not.
7 questions test this
- For an open-ended chat feature in your Foundry project with no reference answers, a stakeholder wants an automated evaluator that not only assigns a quality score to each response but also returns a n
- In a Microsoft Foundry evaluation you already run coherence and relevance with a GPT judge model. You now add the violence and hate/unfairness safety evaluators, and a teammate suggests assigning that
- Your team ships a machine-translation feature in a Foundry project and has a set of human reference translations for each source segment. You want an automated, math-based score of how closely the mod
- A Foundry project already runs the Groundedness and Relevance quality evaluators, which you configured with a GPT judge in model_config. You now add the Violence and Hate/unfairness risk-and-safety ev
- You configure the Coherence, Fluency, Groundedness, and Relevance evaluators from the Azure AI Evaluation SDK to score an open-ended assistant in your Foundry project, where no reference answers exist
- A colleague asks you to interpret the raw output of the coherence and relevance evaluators after a Microsoft Foundry evaluation run, so the team knows how to read the results dashboard. Setting aside
- In Microsoft Foundry you must evaluate an open-ended brainstorming assistant whose creative responses have no single fixed correct answer, so no ground-truth reference exists. A teammate proposes scor
- GroundednessPro uses the hosted safety service, not a GPT judge
GroundednessProEvaluator (preview) detects ungrounded or hallucinated claims using the hosted Foundry evaluation service, so it takes azure_ai_project rather than a GPT model_config and returns a pass/fail label with a reason instead of a 1-to-5 score.
- Textual-similarity NLP evaluators score token/n-gram overlap against a supplied ground truth and need no LLM judge
The textual-similarity evaluators (F1Score, BleuScore, GleuScore, RougeScore, MeteorScore) are built-in, generally available metrics that score a response purely by math-based token or n-gram overlap against a supplied ground_truth, so they take only ground_truth plus response and require no GPT model deployment or LLM-as-a-judge (each returns a 0-1 float against a default 0.5 threshold, except RougeScore, which returns separate precision, recall, and F1 scores). The selection rule is deterministic: when a fixed reference answer exists and exact overlap is the criterion (machine translation, fixed-answer retrieval, NLP benchmarking) choose a textual-similarity evaluator; when there is no ground truth to compare against, choose the AI-assisted quality metrics (groundedness, relevance, coherence, fluency) instead.
Trap Reaching for an AI-assisted quality evaluator, or supplying a model_config, when a fixed ground_truth answer already exists — the textual-similarity evaluators need no LLM-judge deployment; conversely, they cannot run at all without a ground_truth.
7 questions test this
- A team tries to evaluate an open-ended brainstorming assistant in your Foundry project by running the BLEU and ROUGE textual-similarity metrics, but every row errors out because the feature has no sin
- For an open-ended chat feature in your Foundry project with no reference answers, a stakeholder wants an automated evaluator that not only assigns a quality score to each response but also returns a n
- Your team ships a machine-translation feature in a Foundry project and has a set of human reference translations for each source segment. You want an automated, math-based score of how closely the mod
- In a Microsoft Foundry project you must automatically check whether an assistant's answers actually address what each user asked, scoring the accuracy, completeness, and direct relevance of the respon
- You configure the Coherence, Fluency, Groundedness, and Relevance evaluators from the Azure AI Evaluation SDK to score an open-ended assistant in your Foundry project, where no reference answers exist
- A colleague asks you to interpret the raw output of the coherence and relevance evaluators after a Microsoft Foundry evaluation run, so the team knows how to read the results dashboard. Setting aside
- In Microsoft Foundry you must evaluate an open-ended brainstorming assistant whose creative responses have no single fixed correct answer, so no ground-truth reference exists. A teammate proposes scor
- Safety evaluators run in the hosted service and need azure_ai_project
The risk and safety evaluators (ViolenceEvaluator, SexualEvaluator, SelfHarmEvaluator, HateUnfairnessEvaluator) are executed by the hosted Microsoft Foundry evaluation service, so they are instantiated with your Foundry project information (azure_ai_project) and a credential, not with a GPT model_config or a deployment_name.
Trap Passing a GPT model_config to a safety evaluator; harm detection is done by Microsoft-hosted safety models reached through your Foundry project.
5 questions test this
- You are building a mixed evaluation suite in Microsoft Foundry that includes both response-quality checks and harmful-content checks. Some evaluators must be instantiated with a GPT model_config that
- You are operationalizing safety checks for a customer-support assistant in Microsoft Foundry and must run the built-in violence, sexual, self-harm, and hate/unfairness evaluators across a labeled resp
- You build a single Foundry evaluation run that scores each chatbot response for both coherence, an AI-assisted quality metric, and violence, a content-safety metric. You correctly configured the coher
- Your team wants to measure how often a customer-support chatbot emits violent, sexual, self-harm, or hateful content, but your Foundry project has no Azure OpenAI GPT deployment provisioned and procur
- You are adding automated content-safety scoring to your Microsoft Foundry evaluation pipeline. For the coherence and fluency quality evaluators you passed a GPT model_config with a deployment_name, so
- Content safety uses a 0-7 severity scale with a default threshold of 3
Content safety evaluators return a 0-to-7 severity score bucketed as Very low (0-1), Low (2-3), Medium (4-5), and High (6-7). Given a default threshold of 3, a score at or below the threshold passes and a higher score fails, with a reason explaining the level.
Trap Reading the safety scale like a quality score; here a HIGHER number means MORE harmful, the opposite of the 1-to-5 quality metrics.
6 questions test this
- During a content-safety review in Microsoft Foundry, your violence evaluator returns a severity score near the bottom of the 0-to-7 scale for a chatbot response and marks it pass. A teammate who norma
- During a safety review in Microsoft Foundry, your team runs the violence evaluator over model responses and gets per-response severity numbers on the content-safety scale. A reviewer who is used to th
- You run the content-safety evaluators across a 2,000-response test dataset in Microsoft Foundry and must report a single dataset-level safety signal that a release gate can check before the model ship
- You present an evaluation dashboard to stakeholders that shows, for each model build, a fluency score and a violence severity score side by side. A stakeholder notices that build 2 has a higher fluenc
- In Microsoft Foundry, your violence evaluator returns a per-response severity score on the 0-7 content-safety scale together with a configured threshold, and your release pipeline needs a deterministi
- Your release sign-off for a customer-support chatbot in Microsoft Foundry currently reports only the single highest content-safety severity seen across a 2,000-response test dataset. You argue that on
- Safety results aggregate into a defect rate; ContentSafetyEvaluator bundles the four harms
Over a dataset the service reports a defect rate, the percentage of responses whose severity exceeds the threshold, as the aggregate safety signal. ContentSafetyEvaluator is a composite evaluator that runs violence, sexual, self-harm, and hate/unfairness together for a single combined output.
Trap Reporting a single worst-case score instead of the defect rate, which is the intended dataset-level harmful-content metric.
6 questions test this
- Your team has run the AI Red Teaming Agent against two candidate versions of a Microsoft Foundry agent, launching many simulated attacks and scoring each attack-response pair. Leadership wants one hea
- You run the content-safety evaluators across a 2,000-response test dataset in Microsoft Foundry and must report a single dataset-level safety signal that a release gate can check before the model ship
- You need to score every chatbot response for violence, sexual, self-harm, and hate/unfairness content before a release. To keep the evaluation run simple, you want one combined safety result per respo
- You are assembling a safety evaluation in Microsoft Foundry and want the violence, sexual, self-harm, and hate/unfairness checks to run together over your dataset and return one combined harmful-conte
- Your release sign-off for a customer-support chatbot in Microsoft Foundry currently reports only the single highest content-safety severity seen across a 2,000-response test dataset. You argue that on
- You must score every response from a customer-support assistant in Microsoft Foundry for violence, sexual, self-harm, and hate/unfairness content before a release gate. To keep the evaluation run simp
- The safety evaluation service is region-limited
The hosted safety evaluation service (and adversarial simulation) is available only in select regions, so the Foundry project must be created in a supported region such as East US 2, France Central, UK South, or Sweden Central for these evaluators to run.
- IndirectAttack and ProtectedMaterial are pass/fail risk evaluators beyond the four harms
Beyond the four content-harm evaluators, the built-in risk and safety set includes IndirectAttack (XPIA / cross-domain prompt injection), which returns a boolean pass/fail verdict where fail means the response fell for a jailbreak instruction injected into retrieved context or a source document, and ProtectedMaterial, which flags text under copyright (song lyrics, recipes, articles) using the Azure AI Content Safety Protected Material for Text service. Both output pass/fail rather than the 0-to-7 severity score used for hate/unfairness, sexual, violence, and self-harm.
Trap Assuming every risk and safety evaluator emits a 0-to-7 severity score, or that IndirectAttack inspects the user's direct prompt; it is a boolean verdict and targets injections hidden in retrieved or grounding content, not the immediate user turn.
- The AI Red Teaming Agent automates adversarial scans into an ASR risk-category scorecard
The AI Red Teaming Agent (preview) is Microsoft Foundry's automated adversarial-scanning tool, built on the open-source PyRIT framework, that probes a model, application, or agent endpoint with simulated attacks (applying PyRIT attack strategies such as Base64, Flip, or Crescendo across easy, moderate, and difficult complexity), scores each attack-response pair with the hosted Risk and Safety Evaluators, and reduces the run to an Attack Success Rate (ASR), the percentage of attacks that successfully elicit an undesirable response. It emits a risk-category scorecard broken down by harm category and attack complexity to drive a pre-deployment go/no-go decision, and is distinct from the AdversarialSimulator, which only generates a red-team dataset, and from the hosted per-response safety evaluators, which score a single response at a time rather than run an end-to-end attack campaign.
Trap Confusing the AI Red Teaming Agent with the AdversarialSimulator (which only builds the adversarial dataset) or with the hosted content-safety evaluators (which score the harm severity of one response); the AI Red Teaming Agent runs the whole scan, scoring attack-response pairs into the ASR scorecard used for the deployment go/no-go.
4 questions test this
- Before deploying a generative AI agent in Microsoft Foundry, your team must automatically probe its endpoint with simulated adversarial attacks, score each attack-response pair, and roll the run up in
- Your team has run the AI Red Teaming Agent against two candidate versions of a Microsoft Foundry agent, launching many simulated attacks and scoring each attack-response pair. Leadership wants one hea
- A colleague says that one Microsoft Foundry safety tool merely produces a synthetic adversarial dataset of attack prompts, which you must then run against your endpoint and score yourself, whereas ano
- Your safety team plans a manual red-teaming exercise and just needs a batch of realistic adversarial prompts to hand to human reviewers, who will send them and judge the responses themselves. They exp
- evaluate() runs many evaluators over one dataset and can log to Foundry
The evaluate() API runs multiple built-in and custom evaluators over one dataset in a single pass, returning aggregate metrics plus per-row scores, and can log results to a Foundry project (surfaced via result.studio_url). Composite evaluators such as QAEvaluator bundle several quality metrics at once.
Trap Running each evaluator by hand row by row; evaluate() batches all evaluators and produces the aggregated report.
9 questions test this
- An MLOps engineer says your evaluation can only measure what the built-in evaluator catalog already provides, so a domain-specific correctness rule unique to your insurance product simply can't be sco
- Your Foundry generative AI application must return each answer as well-formed JSON that matches a fixed schema, and your quality bar scores every response by whether it parses and conforms - a purely
- Your GenAIOps team has a JSONL test dataset of query-and-response pairs for a retrieval-augmented chat app in a Microsoft Foundry project. You must score every row with the groundedness, relevance, an
- Your team has a JSONL test dataset of query-and-response rows for a generative AI application. You must score every row with several built-in quality evaluators together with one custom metric, obtain
- Your team currently runs its quality evaluation through a prompt flow evaluation flow. Because prompt flow is no longer recommended for new development and is on the retirement path, you must move the
- After you run local evaluation with the Azure AI Evaluation SDK over a dataset, the aggregate metrics and per-row scores stay as JSON files on the engineer's laptop. Reviewers need to open the results
- An engineer on your team is scoring a large JSONL dataset of query-and-response rows and wrote a script that iterates every row, calling the groundedness, relevance, and fluency evaluators individuall
- Your MLOps team measures a chatbot's quality with built-in groundedness and relevance evaluators, but compliance also requires a deterministic, rule-based check that every answer includes a mandatory
- Your GenAIOps team keeps a JSONL file of several hundred test queries for a Microsoft Foundry chat application, but the file holds only the queries and not the application's answers. Before the next r
- Custom evaluators are code-based callables or prompt-based Prompty files
When built-in metrics do not fit, you author custom evaluators either as a code-based Python callable/class (for example a deterministic score like answer length) or as a prompt-based Prompty file that instructs a judge model, then pass them to evaluate() alongside the built-in evaluators.
Trap Assuming only built-in metrics exist; domain-specific criteria are handled by code-based or Prompty custom evaluators.
7 questions test this
- An MLOps engineer says your evaluation can only measure what the built-in evaluator catalog already provides, so a domain-specific correctness rule unique to your insurance product simply can't be sco
- Your Foundry generative AI application must return each answer as well-formed JSON that matches a fixed schema, and your quality bar scores every response by whether it parses and conforms - a purely
- Your GenAIOps team has a JSONL test dataset of query-and-response pairs for a retrieval-augmented chat app in a Microsoft Foundry project. You must score every row with the groundedness, relevance, an
- Your team has a JSONL test dataset of query-and-response rows for a generative AI application. You must score every row with several built-in quality evaluators together with one custom metric, obtain
- Your team needs a custom evaluation metric that is a purely deterministic rule - score each response by whether its length falls within a target character range - with no language-model judgment invol
- Your MLOps team measures a chatbot's quality with built-in groundedness and relevance evaluators, but compliance also requires a deterministic, rule-based check that every answer includes a mandatory
- The built-in evaluators don't cover a domain-specific quality your team needs: a subjective brand-tone judgment that a language model must reason about for each response. You want to add this metric a
- Cloud evaluation wires evaluations into CI/CD as automated quality gates
Cloud (remote) evaluation runs let you integrate evaluation into CI/CD pipelines such as GitHub Actions as automated quality gates, failing a build or blocking a release when quality or safety scores fall below thresholds, which operationalizes evaluation rather than leaving it a manual step.
Trap Treating evaluation as a one-off local check instead of a scheduled or CI/CD-gated automated workflow.
6 questions test this
- Today your team runs evaluation manually on a laptop before each release, and low-quality builds occasionally slip through to production. You want evaluation to run automatically inside the deployment
- A deployed Foundry agent serves live production traffic, and your team wants ongoing assurance that answer quality and safety don't silently drift over time, without an engineer manually kicking off a
- Your team must run evaluation over a large dataset as part of automated pre-deployment testing in the CI/CD pipeline, and you don't want to provision or manage the compute that runs the evaluators. Co
- Before promoting an updated Microsoft Foundry agent to production, your team wants an automated step in their GitHub-hosted pipeline that invokes the agent with a set of test queries, runs selected ev
- Today your team runs quality evaluation by hand on a laptop just before each release, and occasionally a build with regressed groundedness still reaches production. You want evaluation to run automati
- Your team wants every pull request that changes a Foundry agent's prompts to automatically trigger an evaluation, and to block the merge or release when quality and safety scores fall below agreed thr
- The Evaluation SDK replaces prompt flow evaluation for new work
The Azure AI Evaluation SDK is the successor to the retired Evaluate-with-prompt-flow workflow; new automated evaluation should be built on azure-ai-evaluation plus Foundry evaluations, not on prompt flow, whose feature development ended on 2026-04-20 and support ends 2027-04-20.
Trap Selecting prompt flow to author or run evaluation workflows; it is on the retirement path and the Azure AI Evaluation SDK is its replacement.
4 questions test this
- You are standardizing the evaluation tooling for a brand-new GenAIOps project in Microsoft Foundry and must pick the framework your team will build all future automated evaluations on. One option's fe
- Before promoting an updated Microsoft Foundry agent to production, your team wants an automated step in their GitHub-hosted pipeline that invokes the agent with a set of test queries, runs selected ev
- Your team currently runs its quality evaluation through a prompt flow evaluation flow. Because prompt flow is no longer recommended for new development and is on the retirement path, you must move the
- Your platform team is adding an automated pre-deployment evaluation stage for a brand-new Foundry generative AI project. A colleague suggests reusing the organization's existing prompt flow evaluation
- Agent evaluators score intent resolution, tool-call accuracy, and task adherence
Agentic evaluators judge agent behavior beyond final text: IntentResolutionEvaluator checks whether the agent correctly understood the user's intent, ToolCallAccuracyEvaluator checks whether the right tools were called with correct parameters, and TaskAdherenceEvaluator checks whether the agent followed its instructions and stayed on task.
Trap Evaluating an agent with only groundedness/relevance; agent quality also depends on intent resolution, tool-call accuracy, and task adherence.
20 questions test this
- A GenAIOps lead explains to the team that, in Microsoft Foundry, evaluating an agent is tightly coupled to tracing in a way that evaluating a single text response is not. A new engineer asks why captu
- While reviewing a Microsoft Foundry agent that integrates several APIs, an engineer wants a single process-level evaluator that judges the overall quality of the agent's tool calls, whether it chose t
- A team wants to start using the Tool Call Accuracy and Task Adherence evaluators on a Microsoft Foundry agent, but their current logging saves only each user query and the agent's final text answer; t
- A Foundry travel agent is instructed to never book flights over a set price and to always confirm dates first. In testing it books an over-budget flight without confirming. The team wants an evaluator
- A team reuses the evaluation harness from their RAG chat application for a new Microsoft Foundry agent. The harness records each query, the final response, and the retrieved context, and it runs groun
- During evaluation of a Foundry agent, reviewers find the agent frequently invokes the wrong function tool and passes it malformed arguments, even though its final wording is fluent and on-topic. The t
- A GenAIOps team is defining the pre-release acceptance suite for a Microsoft Foundry agent that resolves customer requests by calling several function tools. Beyond content-safety checks, leadership w
- An MLOps engineer reviews a Microsoft Foundry agent that completes tasks by calling internal function tools. Testing shows the agent's final replies read fluently, but it sometimes calls a tool that f
- An engineer configures two evaluators on the same Microsoft Foundry agent output. The Coherence evaluator runs fine against the agent's plain-text response, but the Tool Call Accuracy evaluator return
- A Microsoft Foundry shopping agent replies to a customer who says 'I want to return this and buy the newer model' with a fluent, on-topic message that only processes the purchase and ignores the retur
- A Microsoft Foundry HR-benefits agent answers employee questions by retrieving policy documents. In a pre-release review, the team notices that when an employee asks a two-part question, the agent oft
- A GenAIOps team has been running a Microsoft Foundry customer-support agent in production, where its tool calls and results are captured as traces in Application Insights. Auditors now want to score t
- A QA engineer is assembling the offline evaluation dataset for a multi-tool Microsoft Foundry agent so that the Tool Call Accuracy evaluator can score each recorded interaction. Alongside the user que
- A Microsoft Foundry symptom-triage agent is given a system message stating it must direct users with emergency red-flag symptoms to call emergency services and must never provide a specific diagnosis.
- A GenAIOps engineer maintains a Foundry agent that answers billing questions by calling internal tools. Its final answers already pass the Groundedness and Relevance evaluators, yet reviewers say it o
- A team enabled the Foundry Observability monitoring dashboard and set Azure Monitor alerts, then tried to run the tool-call accuracy agent evaluator on their agent. The evaluator reports it has no too
- In a regulated financial-support scenario, compliance reviewers must confirm that a Microsoft Foundry agent follows the rules and constraints written in its system instructions and stays on its assign
- An MLOps engineer prepares a tool-call accuracy evaluation for a Microsoft Foundry agent that books travel through several function tools. So far the evaluation dataset captures only each user query a
- A team builds an agent with Microsoft Foundry Agent Service. Each user request produces a long thread of assistant and tool messages containing many tool invocations. The team wants to score the run w
- A financial-services team runs a Foundry support agent whose system message forbids giving investment advice and requires escalation of complaints to a human. Before release they must confirm the agen
- Agent evaluators consume the tool-call trace, not just the response
Agent evaluators read the agent message schema, including tool_calls, so evaluating an agent means capturing its tool-invocation trace as input, not only the final assistant message. This is why agent evaluation is tightly coupled to tracing.
Trap Feeding only query/response to an agent evaluator; without the tool_calls it cannot assess tool-call accuracy.
10 questions test this
- A GenAIOps lead explains to the team that, in Microsoft Foundry, evaluating an agent is tightly coupled to tracing in a way that evaluating a single text response is not. A new engineer asks why captu
- A team wants to start using the Tool Call Accuracy and Task Adherence evaluators on a Microsoft Foundry agent, but their current logging saves only each user query and the agent's final text answer; t
- A team reuses the evaluation harness from their RAG chat application for a new Microsoft Foundry agent. The harness records each query, the final response, and the retrieved context, and it runs groun
- An engineer configures two evaluators on the same Microsoft Foundry agent output. The Coherence evaluator runs fine against the agent's plain-text response, but the Tool Call Accuracy evaluator return
- A GenAIOps team has been running a Microsoft Foundry customer-support agent in production, where its tool calls and results are captured as traces in Application Insights. Auditors now want to score t
- A QA engineer is assembling the offline evaluation dataset for a multi-tool Microsoft Foundry agent so that the Tool Call Accuracy evaluator can score each recorded interaction. Alongside the user que
- A team enabled the Foundry Observability monitoring dashboard and set Azure Monitor alerts, then tried to run the tool-call accuracy agent evaluator on their agent. The evaluator reports it has no too
- An MLOps engineer prepares a tool-call accuracy evaluation for a Microsoft Foundry agent that books travel through several function tools. So far the evaluation dataset captures only each user query a
- A team builds an agent with Microsoft Foundry Agent Service. Each user request produces a long thread of assistant and tool messages containing many tool invocations. The team wants to score the run w
- A GenAIOps team asks why agent evaluation in Microsoft Foundry is described as tightly coupled to tracing. Their agent runs several tool calls per user request, and they want the Tool Call Accuracy an
References
- Observability in Generative AI - Microsoft Foundry
- Local Evaluation with the Azure AI Evaluation SDK (classic) - Microsoft Foundry (classic) portal
- azure.ai.evaluation package
- Retrieval-Augmented Generation (RAG) Evaluators for Generative AI - Microsoft Foundry
- General Purpose Evaluators for Generative AI - Microsoft Foundry
- Textual Similarity Evaluators for Generative AI - Microsoft Foundry
- Risk and Safety Evaluators for Generative AI - Microsoft Foundry
- Rate limits, region support, and enterprise features for evaluation - Microsoft Foundry
- azure.ai.evaluation.simulator package
- AI Red Teaming Agent - Microsoft Foundry
- Custom Evaluators - Microsoft Foundry
- Cloud Evaluation with the Microsoft Foundry SDK - Microsoft Foundry
- What is Azure Machine Learning prompt flow - Azure Machine Learning