Eval Gates in CI: Catch Agent Regressions Before Merge
PublicNovember 26, 20268 min read

Eval Gates in CI: Catch Agent Regressions Before Merge

Green unit tests will not catch a quieter failure: a prompt or model change that makes your agent a little worse. Here is how to put a small, versioned golden set in CI, check the grader, and block the merge when behaviour regresses.

Share:XLinkedIn

You changed a prompt. The unit tests are still green. You merged it. A week later, users start reporting that the agent is "a bit worse" — it skips a clarifying question, or picks the wrong tool, or confidently closes a ticket it has not actually finished. Nothing crashed. The regression just never had a test.

If you want a wider view of how public scores can mislead, I walked through a model launch chart by chart in Every Benchmark of Claude Fable 5.2 Explained in Plain English. And if you are already tightening how AI-written code gets merged, this gate sits next to the mechanical checks in How to Secure and Ship AI-Generated Code: A 4-Layer Checklist.

Let's take this step by step.

Why do agent regressions slip through?

Ordinary software tests ask, "does this function still return the right value?" Agent changes fail in a softer way.

You edit the system prompt to "be more concise." Or you bump the model. Or you add a tool. The code still types, the linter is clean, and a couple of manual chats look fine. But three of the cases your users actually care about now go wrong: the agent stops asking a needed follow-up, or it writes a short, confident label that happens to be incorrect.

If those cases do not run on every pull request, you will hear about them from production. That is the gap an eval gate is meant to close.

An eval task, in the sense Eugene Yan uses in his 22 November 2026 teardown of twelve public benchmarks, usually has four parts: an instruction, an environment, a grader, and sometimes a reference solution. Your CI gate is the same idea, pointed at your agent and your failures, not at a public leaderboard.

What goes wrong if the eval itself is broken?

A gate is only as good as the check behind it. Yan's review is useful here because it shows how often the grader, not the model, is the problem.

In eight of the twelve public evals he studied, there was evidence that the grader failed work that should have passed. Reviewers found that 41 of 65 Terminal Bench 4.0 tasks were graded on unstated requirements. On DeepSWE, 23 of 113 tasks marked correct solutions as failures. An outside reviewer reported checks that failed correct work in 23 of 108 OSWorld 2.0 tasks.

The other direction is just as dangerous. On Harvey LAB, Artificial Analysis found material hallucinations in more than 60% of deliverables that had already passed every official criterion. On AutomationBench, a large share of assertions only check whether a message contains or excludes a string — which means a swapped number, or a lucky digit inside a date, can still pass.

The lesson for your repo is not "public benchmarks are useless." It is this: if you would not trust a grader to rank frontier models, do not let an unexamined grader merge your prompt.

A few design habits from the same review transfer well to a private golden set:

  • Prefer deterministic checks over an LLM judge when you can.
  • Grade the outcome, not the exact steps, unless the path itself is the requirement.
  • State in the prompt what the check will test, so you are not failing work for a hidden rule.
  • Add negative cases: known-bad answers should fail.
  • Spot-check passing runs, not only failures. Passes are where silent grader bugs hide.

What should go in the golden set?

Start smaller than you think, and make every case earn its place.

A good starting size is about 15 to 25 cases. That is enough to cover the ways your agent actually fails, and small enough to run on every pull request without a painful bill. Grow it only when a new production miss appears.

Each case should include:

  • A realistic input. A real ticket, query, or repo state, slightly anonymised if you need to.
  • The expected outcome. A label, a tool call, a final file state, a required citation, or a binary rubric item — something a script can check.
  • A reason it exists. "Users reported the agent closed this ticket without calling the refund tool."
  • A version. When you change the case, bump the version. A score quoted without its eval version is not something you can compare next month.

Split the set so it cannot be gamed by one lucky style of answer:

TypePurposeExample
Should passCore behaviour you must not breakRefund ticket → agent calls create_refund and does not mark the ticket done first
Should fail / refuseKnown-bad behaviour the grader must catchAgent invents an order ID and still reports success
Edge casesThe awkward ones users actually sendEmpty input, mixed language, a policy conflict

Write the cases against the agent you ship, in the harness you ship. A public board score is a model-plus-harness result. Your customers meet your harness.

How do you put the gate in CI?

The mechanics are straightforward. The judgement sits in the threshold and the grader.

A typical pull-request check looks like this:

on pull request (and on main):
  1. Build or start the agent the same way production does
  2. Run golden set version X, with the grader and model versions recorded
  3. Write a report: pass/fail per case, overall pass rate, eval version
  4. Fail the job if a critical case failed, or if the pass rate dropped below the threshold

On GitHub, this is a required status check on the protected branch, the same way you already require tests or lint. The important part is that a prompt-only change, or a model bump, still triggers the workflow.

Two threshold styles work well together:

  1. Never break a critical case. A handful of cases are blockers. If any of those fail, the pull request cannot merge.
  2. Do not let the overall rate slip. For example, fail if pass rate drops by more than one case compared with main. A hard 100% target is brittle once you have a slightly noisy check.

If a case is flaky, do not pretend the agent is flaky. Fix the case, or run it a fixed number of times and require it to pass consistently. A gate that fails at random will get bypassed, and then you have no gate.

When should you use an LLM-as-judge?

Use a judge only when a script cannot see the thing you care about — tone, a messy paragraph, a policy explanation. Then keep the judge's job narrow.

  • Score binary rubric items ("does the reply name the refund window?") rather than a vague 1–5 quality score.
  • Keep the judge separate from the agent that produced the work, and do not let the agent grade itself.
  • Freeze the traces when you are evaluating the judge. Change one variable at a time: first measure whether the judge agrees with itself on the same outputs, then use it on new ones.
  • Version the judge prompt the same way you version the cases.

If the judge is noisy, it does not belong in a blocking CI check. Move it to a weekly report until it is stable, and let deterministic cases do the blocking.

What are the trade-offs?

  • Cost. Every pull request now spends tokens. A tight 20-case set is usually affordable; a 500-case set on every commit is not. Put the large set on a nightly run, and keep the merge gate small.
  • Speed. A slow gate gets skipped. Prefer checks that finish in a few minutes.
  • Brittleness. Over-specific string matches fail good answers and pass lucky ones. Check the outcome.
  • Stale cases. If you never add the latest production miss, the gate protects yesterday's agent. Treat a production failure as a request to add a case.
  • False confidence. A green eval means those cases still pass. It does not mean the agent is safe in general.

A short checklist

Before you merge a change to an agent, ask:

  1. Did this pull request run a versioned golden set in the same harness you ship?
  2. Have we recently checked that the grader fails known-bad answers and passes known-good ones?
  3. Is at least one new production miss represented in the set?
  4. If we use a judge, is it separate, binary, and stable enough to block a merge?
  5. If the gate is red, do we know whether the agent got worse — or the eval did?

Conclusion

The question is no longer "do we have an eval?" Most teams have a spreadsheet, a notebook, or a score they quoted once. The better question is: would a quiet regression have been stopped before merge, by a check you still trust? If the answer is no, start with twenty real cases, a honest grader, and a required CI status. That is enough to change the habit from "we found out in production" to "the pull request caught it."

References

Share:XLinkedIn

Related Articles

Comments

Sign in to join the conversation.

No comments yet. Be the first to share your thoughts!