Automated Evaluation Workflows
This lesson explains how evaluations run automatically in pull requests, release gates, schedules and continuous evaluation of production traffic.
Learning outcomes
After completing this lesson, you will be able to:
- Describe evaluation in pull request workflows.
- Explain cloud evaluations as release gates.
- Explain the purpose of scheduled evaluation.
- Describe continuous evaluation and its requirements.
Evaluation in pull requests
The first automated layer runs on every pull request that changes prompts, application code, retrieval settings or model configuration. A GitHub Actions workflow signs in with OIDC, runs the application against a regression dataset with evaluate(), compares the metrics with thresholds and with the main branch's last results, and fails the check if any gate is missed.
# eval/run_eval.py (excerpt)
import json, sys
metrics = result["metrics"]
thresholds = {"groundedness.groundedness": 4.0, "relevance.relevance": 4.0, "citations.citation_valid": 0.98}
failures = {k: (metrics.get(k), v) for k, v in thresholds.items() if metrics.get(k, 0) < v}
print(json.dumps(metrics, indent=2))
if failures:
print("Evaluation gate failed:", failures)
sys.exit(1)Pull request datasets are kept small enough to run in minutes, for example 100 to 300 rows, so that developers get fast feedback. Larger suites run before release.
Release gates and cloud evaluation
Before a release reaches production, a fuller evaluation runs: the complete quality dataset, the safety suite and, for public applications, a red teaming scan. These usually run as cloud evaluations in the Foundry project, started from the release workflow with the project client, so that large datasets do not depend on a runner's time limits and results are stored in the project for review.
A cloud evaluation defines its data source and testing criteria; each criterion names a built-in evaluator, such as builtin.groundedness or builtin.violence, or a custom evaluator registered in the project, with its data_mapping and initialization parameters such as the judge deployment. The workflow waits for the run to finish, reads its results, and proceeds to deployment only if the gates pass, often followed by human approval in a GitHub environment.
Scheduled evaluation
Applications can change without a code change: the model behind a deployment is upgraded, the source documents are updated, or the index is rebuilt. Scheduled evaluations rerun a fixed dataset on a recurrence, such as daily, against the production application, so such changes show up as a change in scores. Foundry supports schedules for evaluations and red team scans, and a GitHub workflow with a schedule trigger achieves the same.
Because the dataset is fixed, a score change in a scheduled evaluation points to a change in the system rather than in the questions, which makes it a strong signal for investigation.
Continuous evaluation of production traffic
Continuous evaluation scores real responses as they happen. For agents in a Foundry project, an evaluation rule triggers on completed responses, samples them, randomly or with intelligent sampling, and runs the chosen evaluators, with a limit on runs per hour (100 by default) to control cost. Results appear in the agent monitoring dashboard, where alerts can fire when scores fall.
Continuous evaluation requires Application Insights connected to the project, and the project's managed identity needs the Foundry User role to run evaluation rules. Because live traffic has no ground truth, it relies on reference-free evaluators such as groundedness, relevance, coherence, safety and agent evaluators.
Catching an unannounced change
A RAG assistant passed all release gates in March. In May, users report more unsupported answers. No code or prompt changed, but the documents team reorganized the knowledge base and the index was rebuilt. The team learned about the problem from users and wants to detect such changes itself, both on known questions and on real traffic.
Add a scheduled evaluation that reruns the fixed regression dataset daily against production, so a drop in groundedness on known questions appears the day after the index changes. Add continuous evaluation on sampled production responses with groundedness and relevance, with an alert when the pass rate falls, so problems on new kinds of question are also caught.
Pull request evaluations would not run, because no pull request was opened. Adding more rows to the release gate would not help after release. Monitoring latency and token use would not show unsupported answers.
What must be connected to a Foundry project before continuous evaluation of production responses can run?
Show answer
Application Insights, where traces and evaluation results are stored, and the project's managed identity needs the required role, such as Foundry User.
Exam Tips
Remember for the exam
- Run regression evaluations on pull requests and fail the workflow below thresholds.
- Use cloud evaluations with builtin.* or custom evaluators as release gates before production.
- Scheduled evaluations rerun fixed datasets to catch changes in models, data or indexes.
- Continuous evaluation samples live responses (default 100 runs per hour) and needs Application Insights.