BrainyBeeBrainyBee
ExploreBlogStart Studying
HomeDeveloping AI Apps and Agents on Azure (AI-103)Evaluate models and apps, including detecting fabrications, relevance, quality, and safety
Lesson2,678 words

Evaluate models and apps, including detecting fabrications, relevance, quality, and safety

AI-103 › Unit 2: Implement generative AI and agentic solutions › Build generative applications by using Foundry › Evaluate models and apps, including detecting fabrications, relevance, quality, and safety

Evaluate models and apps, including detecting fabrications, relevance, quality, and safety

Evaluation appears twice in this certification for a reason. The responsible-AI objective covers the catalogue of evaluators; this one covers running an evaluation: choosing a model in the first place, building the dataset, generating adversarial cases you did not think of, and reading a result well enough to act on it.

Why This Matters

Fabrication has a specific measurement. "Hallucination" is not an evaluator. What you actually measure is groundedness — is the claim supported by the supplied context — plus ungrounded attributes for inferred properties. Naming the right instrument is the skill.

Model selection is an evaluation stage. Benchmarks and leaderboards shortlist; your own dataset decides. Skipping the first wastes effort, skipping the second ships someone else's benchmark as your quality bar.

You cannot only test cases you imagined. Adversarial simulators and the red teaming agent generate the inputs your dataset omits — which is the whole point of running them.

Three stages, three instruments

Base model selection → benchmarks and leaderboards in the model catalog. Pre-production → your evaluation dataset plus adversarial simulation and red teaming. Post-production → operational metrics, continuous evaluation on sampled traffic, scheduled evaluation on a fixed dataset for drift, and alerts. A question naming a stage is naming its toolset.

Prerequisites

  • The evaluator families and what each requires as input.
  • That groundedness measures support by supplied context, not truth.
  • What a test dataset is: inputs, optionally context, optionally ground truth.
  • Tracing into Application Insights.

Learning Objectives

By the end of this lesson you will be able to:

  1. Run the three-stage evaluation lifecycle and pick the right instrument at each.
  2. Detect fabrication with the correct evaluators, and know their input requirements.
  3. Build an evaluation dataset and decide whether ground truth is needed.
  4. Use simulators and the AI Red Teaming Agent to generate cases you did not author.
  5. Read a result — via cluster analysis and traces — and act on it.

Building Blocks

Stage one: model selection. The model catalog exposes benchmarks and leaderboards comparing models on standard tasks. Their job is to shortlist, not to decide — they measure general capability on public tasks, not your task on your data.

Stage two: pre-production. You supply a dataset and run evaluators against it. Three sources of test cases matter: hand-authored cases capturing known requirements; production-derived cases once traffic exists; and generated cases from adversarial simulators, which produce inputs designed to elicit failure. The AI Red Teaming Agent, built on PyRIT, automates adversarial probing across risk categories and attack strategies and returns a comparable scorecard.

Stage three: post-production. Operational metrics, continuous evaluation on sampled production traffic, scheduled evaluation against a fixed dataset — the mode that detects drift, because the inputs are held constant — scheduled red teaming, and Azure Monitor alerts on quality thresholds and harmful content.

The fabrication toolkit.

InstrumentMeasuresNeeds
GroundednessSupport by supplied context, scored 1–5A judge model deployment
Groundedness ProSame, binary pass/fail with reasoningNo model deployment
Ungrounded attributesProperties inferred and not supportedContext
RelevanceDoes the response address the queryQuery and response
Response CompletenessDoes it cover what was askedQuery and response
RetrievalDo retrieved chunks address the queryRetrieved context, no ground truth
Document RetrievalRetrieval quality against labelsGround truth labels

Evaluation level. evaluation_level is "turn" (default) or "conversation", and levels cannot be mixed in one run.

Cluster analysis groups failing cases so a pattern is visible rather than a list of individual low scores.

Where test cases come from

Attribute
Covers

Known requirements

Real usage

What you did not imagine

Available

Immediately

Only after traffic exists

Immediately

Bias

Your assumptions

Current users only

Adversarial by design

Tooling

Manual

Traces and sampling

Simulators; red teaming on PyRIT

Deep Dive

Naming the fabrication problem precisely

A scenario rarely says "measure hallucination". It describes a symptom, and the symptom names the evaluator.

"The assistant states facts not present in the source documents" → groundedness. This is the core fabrication measure, and the choice between the two variants is decided by the deployment constraint: the AI-assisted evaluator scores 1–5 and requires a judge model, while Groundedness Pro returns binary pass/fail with reasoning and requires none.

"It attributes characteristics to people that the source never stated" → ungrounded attributes, which targets inferred properties specifically rather than unsupported statements generally.

"It answers a different question" → relevance. "It answers part of the question" → response completeness. Neither is fabrication; both are frequently offered as distractors alongside it.

And the framing to keep: groundedness is not truth. A response faithfully grounded in a stale or wrong document scores well. Content correctness is an ingestion and freshness problem, not something these evaluators measure.

Running an evaluation

  1. 1

    Shortlist

    Benchmarks and leaderboards in the model catalog — they narrow the field, they do not decide.

Datasets, and the ground-truth question

The first question about any dataset is whether reference answers exist, because it eliminates whole families.

With ground truth, the similarity evaluators (F1, BLEU, ROUGE, METEOR, GLEU, Similarity) and Document Retrieval become available. These are cheap, deterministic, and appropriate where a canonical answer genuinely exists — a lookup, an extraction, a classification.

Without ground truth, which is the common case for open-ended generation, you rely on reference-free evaluators: groundedness against supplied context, relevance and completeness against the query, coherence and fluency on the response alone, and the risk and safety set. This is not a lesser option — for a generative assistant there often is no single correct answer to compare against.

The mistake to avoid is manufacturing ground truth by having a model write the reference answers and then scoring against them. That measures agreement with the reference-writing model, not quality.

Simulators and red teaming: testing what you did not think of

A hand-built dataset has a structural blind spot: it contains the failures the author anticipated.

Adversarial simulators generate inputs designed to elicit unsafe or incorrect behaviour, giving coverage of cases nobody wrote down. The AI Red Teaming Agent systematises this — built on PyRIT, it scans across risk categories and applies attack strategies, returning a scorecard that is comparable between runs and across model versions. That comparability is what makes it useful as a release gate: the same scan before and after a change shows whether risk moved.

Because risk can reappear when a model version, system prompt, or tool set changes, red teaming also belongs on a schedule in production, not only at release.

What it does not do: replace content filters, or replace safety evaluation on ordinary traffic. It measures what the filters and prompt are letting through under provocation. An application can be adversarially robust and still produce harmful output on innocuous prompts — which is why the risk and safety evaluators apply to every generative application, not only ones in obviously sensitive domains.

Reading a result

A score tells you something changed; it does not tell you what.

Cluster analysis groups failing cases so a pattern emerges — fifty scattered low scores are noise, fifty that all involve date arithmetic are a defect with an address. Traces then supply the mechanism: which tool ran, what it returned, whether retrieval came back empty. Evaluator reasoning — the explanation attached to an AI-assisted score, or Groundedness Pro's pass/fail rationale — is often the fastest route to the cause.

Reading two evaluators together is especially diagnostic in RAG. Low retrieval with low groundedness means the content was never found. Good retrieval with low groundedness means it was found and not used — a prompting or context-window problem, not an indexing one.

A leaderboard is not an evaluation

Benchmarks compare models on public tasks, which is exactly what makes them useful for shortlisting and useless as a quality bar. Two models a point apart on a leaderboard can be far apart on your data. A scenario where a team selects a model on benchmark rank alone and is surprised in production is describing a missing pre-production evaluation on their own dataset.

Worked Examples

Example 1 — unsupported claims, no judge allowed. A policy assistant occasionally states requirements absent from the retrieved documents. Governance forbids deploying an additional model.

Groundedness Pro — it measures support by supplied context, returns binary pass/fail with reasoning, and requires no model deployment. The AI-assisted evaluator would give a 1–5 trend but needs a judge. Relevance measures whether the answer addresses the question, which is a different failure.

Example 2 — surprised after a model upgrade. A team selects a model from leaderboard rank, ships it, and finds domain quality worse than the previous model.

Benchmarks shortlist; they do not decide. The missing step is pre-production evaluation on their own dataset. Going forward, a scheduled evaluation against that fixed dataset makes the next version change measurable, because the inputs are held constant and any score movement is attributable.

Example 3 — coverage of what nobody wrote down. A team has 200 hand-authored test cases and wants confidence before release that unsafe outputs cannot be provoked.

Adversarial simulation plus the AI Red Teaming Agent on PyRIT, producing a scorecard across risk categories and attack strategies — repeatable, so before-and-after comparison is meaningful. Adding more hand-authored cases extends only the coverage the team already imagined.

Visual Explanations

The lifecycle and its instruments:

Loading Diagram...
Figure 1 — Mermaid diagram

Naming the failure:

Loading Diagram...
Figure 2 — Mermaid diagram

Common Mistakes

Looking for a "hallucination" evaluator. Fabrication is measured by groundedness and ungrounded attributes.

Reading groundedness as factual accuracy. It measures fidelity to the supplied context.

Choosing Groundedness when a judge deployment is excluded. Pro requires none.

Selecting a model on leaderboard rank alone. Benchmarks shortlist; your dataset decides.

Generating ground truth with a model and scoring against it. That measures agreement with the reference writer.

Relying only on hand-authored cases. Simulators and red teaming cover what you did not imagine.

Treating red teaming as a substitute for filters or safety evaluation on ordinary traffic.

Using continuous evaluation to detect drift. Drift needs a fixed dataset.

Mixing evaluation levels in one run. Not permitted.

Practice Exercises

  1. Which evaluators measure fabrication, and which measures inferred properties specifically?
  2. A judge deployment is forbidden. Which groundedness option, and what does it return?
  3. What does a benchmark leaderboard legitimately decide, and what must not be skipped after it?
  4. Why can a large hand-authored dataset still leave a release under-tested?
  5. Retrieval scores well, groundedness poorly. Where is the defect, and what would the reverse mean?
▶Answers
  1. Groundedness (and Groundedness Pro) measure whether claims are supported by the supplied context. Ungrounded attributes targets inferred properties that the source never stated. Relevance and Response Completeness are different failures and common distractors.
  2. Groundedness Pro — preview, powered by Azure AI Content Safety, returning binary pass/fail with reasoning and requiring no model deployment.
  3. It legitimately produces a shortlist of candidate models on public tasks. What must not be skipped is pre-production evaluation on your own dataset, since benchmark rank does not predict performance on your data.
  4. Because it contains only the failures the authors anticipated. Adversarial simulators and the AI Red Teaming Agent (PyRIT) generate cases outside that imagination and produce a comparable scorecard for before-and-after release gating.
  5. Good retrieval with poor groundedness means the content was found and not used — a prompting or context-window problem. The reverse means it was never found — ingestion, chunking, or query mode.

Summary & Concept Map

Evaluating an application is a three-stage practice. Benchmarks and leaderboards shortlist models and decide nothing. Pre-production runs your dataset — hand-authored, production-derived, and crucially simulated adversarial cases — through evaluators chosen by their required inputs, with red teaming on PyRIT producing a comparable scorecard as a release gate. Post-production splits into continuous evaluation on sampled traffic and scheduled evaluation on a fixed dataset, which is what detects drift, plus scheduled red teaming and alerts. Fabrication specifically is groundedness — 1–5 with a judge, or Pro, binary and judge-free — plus ungrounded attributes for inferred properties, remembering that groundedness measures fidelity to context and not truth. Then cluster analysis finds the failing class and traces supply the mechanism.

Loading Diagram...
Figure 3 — Mermaid diagram
Loading flashcards…

Sources and freshness

Written against current Microsoft Learn documentation for the AI-103 skills measured (16 April 2026), reviewed 2026-08-20. Microsoft Learn controls every changing product contract — availability, preview status, quotas, limits, regional support, naming, and retirement dates all move independently of this lesson. Where a scenario turns on a specific number or a GA/preview boundary, confirm it against the product's own page before relying on it.

All Developing AI Apps and Agents on Azure (AI-103) Study Resources

Related Notes

  • Choose an appropriate method for retrieval and indexing2,778 words
  • Quick Note — Choose an appropriate method for retrieval and indexing888 words
  • Choose an appropriate model for each task, including LLMs, small language models, multimodal models, and Foundry Tools3,097 words
  • Quick Note — Choose an appropriate model for each task, including LLMs, small language models, multimodal models, and Foundry Tools1,041 words
  • Choose appropriate memory, tool, and knowledge integration services for agent solutions2,815 words
  • Quick Note — Choose appropriate memory, tool, and knowledge integration services for agent solutions949 words
  • Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing2,733 words
  • Quick Note — Choose the appropriate Foundry services for generative tasks, grounding, vector search, agent workflows, or multimodal processing901 words
  • Apply responsible AI instrumentation, including evaluators, safety evaluations, and explanation tooling2,891 words
  • Configure safety filters, guardrails, risk detection, and content moderation2,795 words
  • Govern agent behavior with oversight modes, constraints, and tool-access controls2,863 words
  • Implement auditing through trace logging, provenance metadata, and approval workflows2,624 words

Ready to study Developing AI Apps and Agents on Azure (AI-103)?

Practice tests, flashcards, and all study notes — free, no sign-up.

Start Studying

Ready to study Developing AI Apps and Agents on Azure (AI-103)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free
Developing AI Apps and Agents on Azure (AI-103) ResourcesExplore All HivesBlogHome

© 2026 BrainyBee. Free AI-powered exam prep.

Loading Diagram...
Flowchart, top to bottom. Stage 1: model selection connects to Benchmarks + leaderboards<br/>SHORTLIST only. B connects to Stage 2: pre-production. S2 connects to Your dataset:<br/>hand-authored + production + SIMULATED. S2 connects to AI Red Teaming Agent - PyRIT<br/>scorecard = release gate. DS connects to Stage 3: post-production. RT connects to S3. S3 connects to Continuous: sampled traffic. S3 connects to Scheduled: FIXED dataset = drift. 2 more statements.
Loading Diagram...
Flowchart, top to bottom. Observed symptom connects to States facts not in the source. Observed symptom] --> A[States facts not in the source connects to Infers characteristics not stated. Observed symptom] --> A[States facts not in the source connects to Answers a different question. Observed symptom] --> A[States facts not in the source connects to Answers only part. A connects to Groundedness 1-5 - needs a judge<br/>OR Groundedness Pro - none. B2 connects to Ungrounded attributes. C connects to Relevance. D connects to Response Completeness.
Loading Diagram...
Flowchart, top to bottom. Evaluate models and apps connects to Stages. Evaluate models and apps] --> ST[Stages connects to Fabrication. Evaluate models and apps] --> ST[Stages connects to Datasets. Evaluate models and apps] --> ST[Stages connects to Reading results. ST connects to Selection: benchmarks SHORTLIST. ST connects to Pre-production: dataset + red teaming. ST connects to Post-production: continuous /<br/>scheduled = drift / alerts. FAB connects to Groundedness 1-5, needs a judge. 10 more statements.

Evaluating apps — retrieval

Card 1 of 6

Front of flashcard 1 of 6

How fabrication is actually measured

hard

Groundedness — support by the supplied context, 1–5, requires a judge model — or Groundedness Pro — binary pass/fail with reasoning, no deployment required. Ungrounded attributes covers properties the model inferred but the source never stated.

fabrication

Evaluating apps — retrieval

Card 1

Front

How fabrication is actually measured

Back

Groundedness — support by the supplied context, 1–5, requires a judge model — or Groundedness Pro — binary pass/fail with reasoning, no deployment required. Ungrounded attributes covers properties the model inferred but the source never stated.

Card 2

Front

What benchmarks are for

Back

Shortlisting models on public tasks. They do not decide — pre-production evaluation on your own dataset does. Selecting on leaderboard rank alone is the modelled failure.

Card 3

Front

Why simulators and red teaming

Back

A hand-authored dataset contains only the failures its authors anticipated. Adversarial simulators generate the rest; the AI Red Teaming Agent on PyRIT scans risk categories and attack strategies, returning a comparable scorecard usable as a release gate.

Card 4

Front

Ground truth: what it unlocks and blocks

Back

With it: the similarity family (F1, BLEU, ROUGE, METEOR, GLEU, Similarity) and Document Retrieval. Without it: reference-free evaluators — groundedness, relevance, completeness, coherence, fluency, risk and safety. Never manufacture references with a model and score against them.

Card 5

Front

Continuous vs scheduled evaluation

Back

Continuous — sampled production traffic, live quality. Scheduled — a fixed dataset, which is what detects drift because inputs are held constant and score movement is attributable.

Card 6

Front

Reading retrieval and groundedness together

Back

Both low — content was never found (ingestion, chunking, query mode). Retrieval good, groundedness low — found and not used (prompt, context window). Then cluster analysis for the failing class and traces for the mechanism.

Evaluating apps — retrieval

Card 1

Front

How fabrication is actually measured

Back

Groundedness — support by the supplied context, 1–5, requires a judge model — or Groundedness Pro — binary pass/fail with reasoning, no deployment required. Ungrounded attributes covers properties the model inferred but the source never stated.

Card 2

Front

What benchmarks are for

Back

Shortlisting models on public tasks. They do not decide — pre-production evaluation on your own dataset does. Selecting on leaderboard rank alone is the modelled failure.

Card 3

Front

Why simulators and red teaming

Back

A hand-authored dataset contains only the failures its authors anticipated. Adversarial simulators generate the rest; the AI Red Teaming Agent on PyRIT scans risk categories and attack strategies, returning a comparable scorecard usable as a release gate.

Card 4

Front

Ground truth: what it unlocks and blocks

Back

With it: the similarity family (F1, BLEU, ROUGE, METEOR, GLEU, Similarity) and Document Retrieval. Without it: reference-free evaluators — groundedness, relevance, completeness, coherence, fluency, risk and safety. Never manufacture references with a model and score against them.

Card 5

Front

Continuous vs scheduled evaluation

Back

Continuous — sampled production traffic, live quality. Scheduled — a fixed dataset, which is what detects drift because inputs are held constant and score movement is attributable.

Card 6

Front

Reading retrieval and groundedness together

Back

Both low — content was never found (ingestion, chunking, query mode). Retrieval good, groundedness low — found and not used (prompt, context window). Then cluster analysis for the failing class and traces for the mechanism.