LLM Eval Gates in CI, Not Slide Decks
· 23 min read
Demo-quality prompts do not survive production traffic. Staff engineers version eval datasets like migrations, gate merges on regression against a frozen baseline, keep expensive judges off every pull request, and publish eval trends beside latency and cost so model swaps are a product decision—not launch-night roulette.
Evals are release infrastructure
Teams that only eyeball outputs before launch discover failures in support tickets. Eval harnesses turn subjective "looks fine" into comparable scores across prompts, tools, and locales—if those harnesses run where code merges, not where executives present slides.
Treat eval suites like unit tests with fixtures, owners, and flake quarantine. When someone edits a golden case without review, you lose the ability to tell model regressions from intentional policy changes. Eval datasets belong in the repo beside prompts and tool schemas, reviewed in the same pull request that changes behavior.
Partition work by customer impact: smoke cases that must pass on every commit touching AI routes, broader regression suites on a schedule, and exploratory buckets that never block production. CI time and token spend are finite; prioritization should reflect revenue and compliance paths, not whichever demo impressed leadership last.
Link eval configuration to deployment artifacts—record dataset hashes or version tags in release metadata so incident responders know which gate approved a build. Without that linkage, postmortems debate memory instead of reproducible commands developers can re-run locally.
Expo and Worker-hosted MVPs benefit from the same discipline as large platforms: a twenty-case golden set with clear pass criteria beats a hundred vague marketing prompts nobody maintains. Speed comes from templates and shared graders, not from skipping gates on write tools.
Eval infrastructure includes the runners, secrets handling, and artifact storage—not only JSON files. If eval jobs cannot run on a fresh laptop with documented env vars, your gate is fragile when on-call runs it at 3 a.m.
When product asks to "skip eval just this once," treat that like skipping migrations: possible with a waiver, never silent. Undocumented skips become undeclared policy and erode trust with legal and support.
Golden sets need ownership
Start with a small, high-signal golden set tied to revenue or compliance paths—not hundreds of vague prompts copied from marketing decks. Each case should assert tool shape, citation presence, refusal behavior, numeric bounds, or locale-appropriate tone—not poetic similarity alone.
Every golden case needs an owner team, last-reviewed date, and explicit pass criteria. Orphan cases rot when models change and nobody knows whether failure is a bug or outdated expectation. Quarterly reviews prune cases that no longer map to shipped product.
Golden sets should include adversarial and missing-context scenarios your policy already defines: jailbreak attempts, empty retrieval, conflicting instructions, and partial tool failures. Happy-path-only evals green-light incidents waiting in production.
| Signal | Example assertion | Why it gates | | --- | --- | --- | | Tool shape | Required fields present | Prevents silent API abuse | | Refusal | Policy decline without harm | Safety and trust | | Grounding | Citation or "unknown" | Reduces confident hallucination | | Locale | Correct language script | Protects i18n launches |
Pair golden cases with contract tests where tools are involved—eval judges phrasing; schemas enforce shape. Failures should route to the right on-call skill: platform for schema, applied AI for prompt, product for policy wording.
Import production failures into golden sets after scrubbing PII—incident-driven cases keep evals honest. Cap growth so suites stay maintainable; merge duplicates instead of adding a new file per ticket.
Human spot checks calibrate automated graders weekly, not only after outages. Disagreements between judge models and staff labels feed rubric updates, not shrugged shoulders in Slack.
Sample online, gate offline
CI should run fast eval subsets on every pull request that touches prompts, tools, routing, or retrieval configuration. Expensive judge models and full corpus replays belong in scheduled jobs, not every push—otherwise teams skip local runs and gates become lottery tickets.
Use recorded model outputs or deterministic stubs for pull request gates when live calls are flaky or costly. Schedule live-model shadow runs against the same fixtures to detect provider drift; shadow complements offline gates but does not replace them because incidents are already user-visible.
Mirror production constraints in eval harnesses: same tool schemas, latency budgets, retrieval indices, and rate limits—not a sandbox with god-mode API keys and infinite context. Eval that lies about production conditions green-lights failures customers see on day one.
Cache embeddings for static corpora in nightly jobs, but invalidate caches when document stores change. Record token spend per eval run so finance notices CI creep; uncapped judge loops can exceed inference cost of the feature they protect.
Separate flaky eval cases into quarantine with owners, mirroring flaky end-to-end tests. A gate that fails randomly trains engineers to bypass it—worse than no gate. Fix or delete quarantined cases on a deadline.
Online sampling feeds dataset backlog: sampled failures become candidate golden cases after review. Automate export from observability with redaction; do not ask support to paste transcripts into spreadsheets.
Mobile clients and edge Workers should not be the only place policy is enforced—offline eval proves the server-side path before traffic hits. Client-only checks are bypassed by older app versions and scripts.
Make regressions visible
Publish eval trends beside latency, error rate, and cost on one dashboard product and finance already read. When a model upgrade wins on quality score but doubles token spend, that trade should be visible before merge, not discovered in the invoice week later.
Failed eval gates should block deploy by default. Waivers need named owners, expiry dates, linked tickets, and customer impact accepted in writing—permanent exceptions are undeclared policy changes. Track waiver count like security findings or flaky test debt.
Show per-intent regression deltas, not only aggregate accuracy. A flat headline score can hide catastrophic failure on checkout assistance while trivia prompts improve. Slice reports by locale when you ship multilingual assistants.
Alert when eval duration crosses budgets—slow trains encourage skipping locally. Trend p95 eval runtime beside unit test times; platform teams optimize runners when product teams complain gates are "too heavy."
Connect eval failures to synthetic probes: when a gate catches toxic output or broken JSON, add a lightweight probe so production drift surfaces before users report it. Post-incident reviews append regressions to golden sets, not only wiki pages.
Eval gates earn the right to change models without heroics on launch night—when executives trust the dashboard more than a live demo. Demos still matter for narrative; CI matters for truth.
Version datasets like code
Store golden prompts, expected constraints, grader configuration, and judge prompts beside application code with pull-request review. When product changes tone or refusal policy, update datasets in the same merge that ships the behavior—not in a quarterly spreadsheet attached to a slide deck.
Use semantic versioning or content hashes for dataset bundles so CI can pin "eval v3.2" against a release branch. Breaking changes to pass criteria require changelog entries reviewers read, same as API semver.
Record which model route and provider version each baseline assumed—upgrading the base model without rebaselining produces fake regressions. Document rebaseline procedures: who approves, how many cases must be re-labeled, and how long dual baselines run.
Branch protection should require eval jobs for paths that affect AI behavior. Monorepos need path filters so unrelated frontend changes do not skip gates when shared prompt packages changed.
Dataset reviews include privacy: no raw user transcripts in git without legal sign-off. Prefer synthetic or heavily redacted fixtures; link to secure stores for rare real examples with access controls.
Tag datasets by risk tier in folder structure so engineers know which failures block merge versus inform research. Exploratory sets must never accidentally wire into required CI jobs—configuration mistakes here have shipped bugs.
Gate on regressions, not vanity scores
Absolute accuracy numbers drift when vendors upgrade base models. CI should compare against a frozen baseline and fail on statistically meaningful regressions on critical intents, safety refusals, and tool-call formats—not on whether you hit ninety-five percent in a deck.
Document tolerance bands product and legal sign explicitly: acceptable delta on support deflection, hard stop on disallowed content categories, and neutral bands for cosmetic phrasing. Ambiguous thresholds cause merge fights and quiet waivers.
Automated graders need calibration hooks. pytest-style tests can assert schema validity and forbidden phrases while LLM judges handle nuance—combine deterministic and model graders instead of choosing one religion.
Use MLflow or equivalent run tracking so teams share eval history without exporting sensitive rows to chat. Each run should store git sha, dataset version, model route, and aggregate deltas for diff review.
When baseline and candidate tie within noise, default to blocking if variance affects high-risk intents—even small regressions on payments or medical disclaimers may be unacceptable regardless of aggregate score.
Rebaseline after intentional policy changes with a labeled event in the dashboard so future readers know the discontinuity was planned, not provider drift.
Eval gates that block merges, not meetings
Slide-deck evals rot the week presenters change teams. The authoritative release contract should be CI replay on merge requests: same commands locally, in GitHub Actions, and in release pipelines—no "works on my laptop" judge notebooks.
Require eval pass (or documented waiver) before squash merge to main. Nightly full suites catch drift that smoke tests miss; block promotion to production if nightly fails even when daytime smoke was green.
Integrate eval status into pull request checks with actionable logs: failing case id, expected constraint, actual snippet redacted, and link to rerun artifacts. Vague "model failed" messages waste reviewer time and encourage rubber-stamping.
Platform teams provide a `pnpm eval:smoke` (or equivalent) that finishes in minutes on developer machines—parity with CI commands matters more than fancy UI. Developers who never run evals locally will not trust gates.
For Teams shipping on Cloudflare Workers and static export, eval runners live in GitHub Actions with secrets scoped read-only—no requirement to invoke production Workers for offline gates. Production shadow remains scheduled.
Eval gates should run when dependency bumps change tokenizer or context limits—even if application code diff is empty. Lockfile-only PRs have shipped silent behavior changes.
Treat eval debt like test debt: failing cases with no owner get deleted or fixed within a sprint. Accumulated red builds erode the culture you built gates to create.
Operational checklist for eval CI
Before calling LLM evals "done," confirm these items have owners and dates—not slide bullets.
Golden set covers top journeys, refusals, tool writes, and each shipped locale sample. Dataset version pinned in CI config and recorded on release artifacts. Smoke eval on every AI-touching PR; full regression nightly or on main only.
Regression thresholds signed by product and legal; waivers expire. Dashboard shows eval trend, duration, token cost, and waiver count beside SLOs. Flaky cases quarantined with deadlines.
Shadow runs scheduled against live models; results diffed to offline baselines. Post-incident failures imported as new cases after redaction. Contract tests and eval gates both green for tool-heavy flows.
Runbooks link failing case ids to rollback steps—revert model route, prompt version, or dataset hash without guessing. On-call can re-run eval locally with one documented command.
Review checklist after each model swap retrospective; add one item that would have caught the last regression faster. Share checklist updates in the same pull request as prompt changes so reviewers see eval as part of shipping.
Publish a single internal page listing eval job names, expected runtime, and who to ping when gates fail—onboarding engineers should not hunt three wikis to unblock merge.
Frequently asked questions
Can we rely on manual review instead of CI eval gates?
How large should a golden set be?
Should pull request CI call live LLM APIs?
When is waiving a failed eval gate acceptable?
Sources
- OpenAI — Evals guide — openai.com
- NIST AI RMF — nist.gov
- pytest — Documentation — pytest.org
- MLflow — Tracking — mlflow.org
Related on this site
Related service
AI-powered product development
Ship AI features to production: tooling, retrieval, evaluation, safety boundaries, and operable backends.
Published on October 25, 2026 by Berktug Berke Ates.