AI Evals — Advanced
Regression Testing in CI
One-line idea: An eval that only runs when someone remembers to run it catches regressions late; an eval wired into CI catches them before they ship.
Everyday comparison: A smoke alarm that only works when someone manually checks it once a month isn't actually protecting the house — the whole point is that it runs on its own, every time, without anyone remembering to ask it to.
Common mistake + fix: Running the eval suite manually before a release and treating that as "tested." Fix: wire it into the same CI pipeline that runs unit tests — a prompt change is a code change, and it deserves the same automatic gate before merging as any other code change.
Memory line: An eval nobody is forced to run eventually stops being run. Put it in CI, not in someone's memory.
Online Evaluation: Watching Behavior in Production
One-line idea: A golden set tells you how a system performs on inputs you already thought of; online evaluation tells you how it performs on the inputs real users actually send, which is never the exact same set.
Everyday comparison: A driving test covers scenarios an examiner anticipated. How someone actually drives on a random Tuesday commute, in traffic nobody scripted, is a different and equally important kind of evidence.
Cost and Latency Alongside Quality
One-line idea: Two prompt versions with the same pass rate aren't equally good if one costs five times more per request or takes three times as long — a regression suite that only tracks correctness misses this entirely.
Memory line: Track pass rate, cost, and latency together on every eval run — a win on one dimension that quietly loses on another isn't actually a win.
Red-Teaming and Safety Evals
One-line idea: A standard eval checks whether the system does its job correctly; a red-team eval checks whether it can be made to do something it shouldn't.
Everyday comparison: A locksmith testing whether a lock opens with the right key is a functionality test. Trying to pick that same lock is a security test — a different question, asked adversarially on purpose.
Red-teaming isn't a one-time pre-launch exercise — new jailbreak patterns and prompt-injection techniques get discovered continuously, so a red-team set needs the same "versioned and refreshed" treatment a golden set does (see Fundamentals), or it stops reflecting the attacks that are actually being tried. This area changes often — check the [OWASP Top 10 for LLM Applications](https://genai.owasp.org/llm-top-10/) for current attack patterns rather than treating any fixed list as complete.
Common mistake + fix: Running a red-team eval once before launch and considering safety "done." Fix: treat it like the golden set — versioned, refreshed with newly discovered attack patterns, and re-run on every meaningful change, not just once.
Memory line: A golden set checks correctness. A red-team set checks whether the system can be talked into misbehaving — both need to be run regularly, not just once.
Putting It Together
A mature eval setup has all four layers working together: a golden set gated in CI catches known regressions before merge, RAG/agent-specific metrics (Intermediate) catch failures a plain pass/fail can't see, online evaluation catches what the golden set never anticipated, and a refreshed red-team set catches deliberate misuse. Missing any one layer leaves a real, specific class of failure with no check watching for it — a team that only has CI regression tests, for instance, can ship a change that's correct on every known case and still quietly degrades for real users in ways nobody wrote a test for.
Common mistake + fix: Building out one layer thoroughly (usually the golden set, since it's the most familiar) and assuming that covers "evals" as a category. Fix: treat the four layers as answering different questions, not as options to pick one from — a system can pass every CI check and still fail in production, or in a red-team session, for reasons the CI suite was never designed to catch.
Memory line: CI regression tests catch what you already knew to test. Online eval catches what you didn't. Red-teaming catches what someone is actively trying to break.

