Sub topic 11
Using Evaluations as Release Gates
Prerequisites and purpose
This chapter assumes that you understand evaluation cases, graders, pass rates, and failure severity. It also assumes that you can read short Python code. You will use those ideas to decide when an AI feature is safe to release.
An evaluation is useful only when it changes a product decision. A release gate turns evaluation results into a repeatable decision: ship, block, or require review. The gate should reflect both overall quality and the cost of serious failures.
What a release gate checks
A release gate usually combines several rules:
- The overall pass rate must meet a minimum threshold.
- Each important quality dimension must meet its own threshold.
- Critical failures must be zero, or below a separately approved limit.
- The new version must not regress on protected test cases.
- The evaluation must run on a fixed dataset before release.
A single average can hide dangerous behavior. For example, an assistant might pass 98% of cases while giving incorrect legal or financial advice in the remaining 2%. A severity rule prevents strong performance on ordinary cases from cancelling out high-cost failures.
The gate should also identify the cases that blocked release. A team needs actionable information, not only a red status.
| Rule | Example | Why it matters |
|---|---|---|
| Overall pass rate | At least 90% | Measures broad quality |
| Dimension threshold | Groundedness at least 95% | Protects a specific quality property |
| Critical failure rule | No contradictory refund deadlines | Prevents unacceptable harm |
| Regression rule | No protected case changes from pass to fail | Preserves known behavior |
Implementing a simple gate
The following program receives graded results and returns a release decision. Each result contains a case identifier, a Boolean pass value, and a severity label.
def release_decision(results, min_pass_rate=0.9):
total = len(results)
pass_rate = sum(r["passed"] for r in results) / total if total else 0.0
critical_failures = [
r["id"]
for r in results
if not r["passed"] and r["severity"] == "critical"
]
ship = pass_rate >= min_pass_rate and not critical_failures
return {
"ship": ship,
"pass_rate": pass_rate,
"critical_failures": critical_failures,
}
results = [
{"id": "refund-001", "passed": True, "severity": "minor"},
{"id": "refund-014", "passed": False, "severity": "critical"},
{"id": "refund-021", "passed": True, "severity": "major"},
]
decision = release_decision(results)
print(decision)This version blocks the release because refund-014 is a critical failure, even though the pass rate might otherwise meet the threshold. In production, add dimension-specific results, dataset version, model version, and the evaluator version to the report.
Design gates around failure severity
Use different responses for different severities:
- A critical failure blocks release automatically.
- A major failure may block release until an owner reviews it.
- A minor failure may be accepted if it stays below a defined rate.
- An unknown or ungraded result should not count as a pass.
A gate can also require improvement before launch. For example, a new retrieval system might need groundedness of at least 95%, no critical contradictions, and no more than a 1 percentage-point decrease in helpfulness compared with the current version.
Write these rules before looking at the new results. Otherwise, the team may adjust the threshold after seeing an inconvenient outcome.
Trace the release decision
A useful release workflow separates evaluation from approval:
An exception process is sometimes necessary, but it should require a named approver, a reason, an expiration date, and a follow-up issue. An exception is a recorded risk decision, not a hidden override.
Exercise
Exercise
A candidate passes 96% of evaluation cases, but one case gives a false medical dosage and is marked critical. Should the release gate allow deployment?
Show answer
No. The critical failure should block deployment unless the product's approved policy explicitly permits that risk and records an exception with an owner and expiry.