An eval that only runs when someone remembers is a report, not a safety net. Eval operations means wiring evals into the places where change happens: every pull request, every model or prompt update, and continuously on production traffic. This lesson covers tiered offline evals in CI, regression gates that account for noise, caching and cost control, online evals on sampled live traffic, the user signals worth collecting, and the loop that turns production failures into new test cases.
- Design tiered eval suites for pull requests, nightly runs and releases
- Write a regression gate that compares against a baseline with noise tolerance
- Control eval cost with caching, sampling and cheap checks first
- Run online evals on sampled production traces
- Close the loop from production failures back into the dataset
Tiered offline evals
| Tier | When | Contents |
|---|---|---|
| Smoke | Every pull request, minutes | 30-100 critical cases, code checks, safety cases |
| Full | Nightly and on prompt or model changes | Whole dev set, judges, several epochs |
| Release | Before shipping a new version | Held-out set, pass^k for agents, human spot checks |
The smoke tier must be fast and stable enough that engineers do not learn to ignore it. Put every safety and policy case in it, because those must never regress. The full tier can be slower and noisier, and runs where cost is less painful. The release tier is the one you use for go or no-go decisions, so it uses the held-out set that nobody tunes against.
Treat the eval suite like production code. It lives in the same repository as the prompts and agent code, changes to it are reviewed, and the results of every run are stored with the commit, model version, prompt hash and dataset version. That history lets you answer questions such as "when did refund accuracy start slipping?" months later.
A regression gate that respects noise
Comparing today's score with yesterday's and failing on any drop will flap constantly, because scores vary from run to run. Store a baseline result from the main branch, compare per case and per slice, and fail only on drops larger than the measured noise, or on any failure in must-pass cases.
import json
import sys
base = {r["id"]: r for r in map(json.loads, open("baseline.jsonl"))}
new = {r["id"]: r for r in map(json.loads, open("results.jsonl"))}
must_pass_failures = [i for i, r in new.items() if r.get("must_pass") and not r["passed"]]
broke = [i for i in new if base.get(i, {}).get("passed") and not new[i]["passed"]]
rate = lambda rs: sum(r["passed"] for r in rs) / len(rs)
drop = rate(base.values()) - rate(new.values())
print(f"pass rate drop: {drop:+.1%}; newly failing: {len(broke)}")
for i in broke:
print(" regressed:", i)
if must_pass_failures or drop > 0.03: # 3 points = measured run-to-run noise
sys.exit(1)name: evals
on:
pull_request:
paths: ["prompts/**", "src/agent/**", "evals/**"]
jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install -r evals/requirements.txt
- run: python evals/run.py --tier smoke --out results.jsonl
env:
EVAL_API_KEY: ${{ secrets.EVAL_API_KEY }}
- run: python evals/gate.py
- uses: actions/upload-artifact@v4
if: always()
with:
name: eval-results
path: results.jsonlAlways upload the results, especially on failure, and print the IDs of newly failing cases so a reviewer can read them directly. A gate that says only "score dropped" sends people back to vibe-checking.
Keeping cost and time under control
- Cheap checks first: run code scorers on everything; run judges only on cases code cannot decide.
- Cache: key outputs and verdicts by (model version, prompt hash, input); unchanged cases need no new calls.
- Trigger by path: only run evals when prompts, agent code or eval files change.
- Sample in the full tier: stratified samples by slice can track trends between complete runs.
- Track eval spend as a line item, so the team sees when a suite grows too expensive.
Online evals on production traffic
Offline datasets age: users change, documents change, new intents appear. Online evals score a sample of real production traces continuously, with the same code checks and calibrated judges, and chart the results by slice and version. Alongside them, collect user signals: explicit thumbs up or down, and implicit ones such as the user rephrasing the same question, abandoning the session, escalating to a human, or editing the agent's draft heavily before sending it.
- Sample traces with personal data redacted and respect retention rules.
- Alert on sustained drops per slice, not on single bad outputs.
- Compare versions during rollouts (canary or A/B) using the same online scorers.
- Watch the distribution of inputs too: a new cluster of questions is an early warning.
Closing the loop
The most valuable output of online evals is new test cases. Route low-scoring and negatively rated traces to a review queue, have someone label the failure cause, and promote representative ones into the offline dataset with a reference answer. Over time the offline suite becomes a record of every way the system has failed, and each fix is protected by a case that will catch it if it returns. Review the suite every few months to retire cases that no longer reflect the product.