AI Engineering · 2026-10-21 · 8 min read
Evals as CI Quality Gates for AI Agents: What Blocks a Merge
Evals as CI quality gates for AI agents: what to block on, where to set the pass rate, and what a gate costs per commit.

An eval quality gate is a step in your CI pipeline that runs a defined set of evals against a change and blocks the merge or release when the score falls below a threshold you set in advance. Unlike a unit test, the result is a pass rate over many cases, so the gate is a decision about acceptable risk, not a green check.
What is an eval quality gate in CI for an AI agent?
A gate has three parts: a set of cases, a way to score them, and a rule that turns the scores into pass or fail. The rule is the part people skip. "We run evals on every pull request" tells you nothing until you can say what result stops the merge.
Here is why that rule matters. A unit test is binary and deterministic: the function returns 4 or it does not. An agent eval runs the agent through a task, often several steps with tool calls, and scores the outcome. Some cases pass, some fail, and a few flip between runs. So the honest output of an eval run is a rate, and the gate is where you decide what rate you will ship on. We covered the difference in why evals are not software tests; this post picks up at the point where you wire them into the merge.
A gate needs no special platform. A script that runs the cases, writes a results file, and exits non-zero when the number is too low is a gate.
Why does the agent harness need a gate, not just the model?
Because the part of an agent you change most often is not the model. It is the harness: the prompts, tool definitions, context handling and loop logic wrapped around it.
A July 2026 arXiv paper makes this concrete. In "Don't Blame the Large Language Model" (Ben Sghaier, Li, Adams and Hassan, submitted 4 July 2026 and revised 20 July 2026, per arxiv.org/abs/2607.03691, fetched 2026-10-21), the authors held the model fixed and varied only the harness. They studied 35 sequential releases of the Qwen Code CLI, scoring each on 50 stratified SWE-bench Verified tasks, and linked individual pull requests to measured changes in effectiveness and efficiency. The abstract also reports harness release rates exceeding two releases per day across the open-source coding harnesses they looked at.
The abstract page does not give per-release effect sizes, so we will not quote any. The takeaway does not need them: quality moved from release to release even though the model did not, and the movement traced back to specific changes. When a quality drop follows a harness update, blaming the model is a habit, not a diagnosis.
That is the case for a gate. If prompts, tools and context logic change daily, something has to check each change before it reaches users.
Which evals should block a merge and which should only warn?
Not every eval deserves the power to block. A gate that blocks on everything gets bypassed, and a gate that blocks on nothing is decoration. We think in three tiers, ordered by cost and by how much we trust the signal.
| Tier | When it runs | What it checks | Authority |
|---|---|---|---|
| Deterministic checks | Every commit | Output schema, tool-call shape, forbidden actions, step limits | Hard block |
| Regression set | Every pull request | Known failures that were fixed, plus cases that must keep passing | Hard block on regressions |
| Full suite | Nightly or before a release | The broad set, including judge-scored quality | Warn on drift, block a release on a clear drop |
Deterministic checks on every commit. These are cheap and exact. Does the agent return valid structure? Did it call a tool with the right argument shape? Did it try an action it is never allowed to take? None of this needs a model to grade it, so there is no noise. Anything that fails here is a bug, and the merge should stop.
A small regression set on every pull request. This is the set of cases your agent has failed before and now passes. The rule is simple: block on any regression of a case that used to pass. A case that fails now but never passed is a known gap, not a regression, and it should not stop unrelated work.
The full suite on a schedule. Broad evals with fuzzy, judge-scored quality are slower and noisier. Warn on movement there, and block a release only when the drop is clear and repeated. The aim is a gate whose every block is worth a person's attention.
We teach the tiers because the tiers are the transferable part. Our own eval sets and prompts stay ours, and your cases should come from your own workflow anyway, since a generic set tells you little about your agent.
Where do you set the pass-rate threshold?
Look at what a tool's own docs show. Promptfoo's CI/CD documentation (promptfoo.dev/docs/integrations/ci-cd, page marked last updated Oct 21, 2026, fetched 2026-10-21) includes a quality gate example that computes a pass rate from the results file with jq and runs exit 1 when the rate is below 95. The same page shows a simpler option, an eval run with the --fail-on-error flag, commented as failing on any test failure.
Those are two different philosophies, and both are examples, not recommendations. One tolerates a band of failures; the other tolerates none. Neither number is universal.
Our approach is to pick the threshold per tier:
- Regression and deterministic checks: near-total. If a case used to pass and a rule is never negotiable, one failure is a finding.
- Judge-scored quality: a band, because the signal is noisy and a few cases will wobble run to run.
Two habits make thresholds hold up. First, compare against the last good run rather than an absolute number. Your eval set grows as you add cases, so "95 percent" this month is not the same bar as "95 percent" next quarter. A gate that says "no worse than the last good run on the regression set" stays meaningful as the set changes.
Second, set the bar before you look at the result. If you pick the threshold after seeing the score, it will land just under the score.
What does a flaky judge do to trust in the gate?
It destroys it, slowly. A gate that fails at random gets overridden, then re-run until it passes, then ignored. Once a team learns that red sometimes means nothing, red stops meaning anything.
Flakiness usually comes from the grader, not the agent. When an LLM scores another LLM's output, the same answer can score differently on two runs. We wrote about when a judge works and when it lies, and the short version for gating is to limit the judge's authority:
- Keep deterministic checks as the hard block. They do not wobble.
- Run judge-scored cases more than once and look at the rate, not a single verdict.
- Let a judge warn, and let a person decide on release when a judged score moves.
- Track the gate's own false alarms. If a block was overridden as wrong, that is data about the gate, and the case or the grader needs fixing.
What does it cost to run agent evals on every commit?
More than a unit test suite, and the cost shows up in two places: tokens and minutes. An agent eval is not one model call. It is a multi-step run with tool calls, and each case can take many calls.
We are deliberately not putting dollar figures here, because they depend entirely on your model, your step counts and your set size. Measure your own: tokens and wall-clock time for one full run, then multiply out. The tiers exist to keep that number sane. Cheap, exact checks run constantly because they cost almost nothing. The regression set is small enough to run per pull request. The expensive broad suite runs nightly or before a release.
One more habit pays for itself. When something fails in production, turn it into a test case. A failure that reaches a user is the best case you will ever write, because it is real. Over time the regression set becomes a record of everything your system has gotten wrong, which is exactly what you want guarding the merge. This is the same loop behind eval-driven agent development: the set grows from reality, and the gate enforces it.
FAQ: quality gates for AI agents
Do I need an eval platform to gate a build? No. A script, a results file and a threshold is a gate. Platforms add storage, history and dashboards, which help once you have a lot of runs.
Should the gate block on a judge score? Rarely. Let deterministic checks and regression cases block, and let judged scores warn or trigger a human look.
Can a gate replace human review? No. A gate catches regressions against cases you thought of. A person catches the thing nobody wrote a case for. Keep both, especially for changes that touch what the agent is allowed to do.
How big should the regression set be? Start small, a few dozen real cases, and grow it from every failure you find. Real cases beat invented ones.
What do we do when the gate is wrong? Fix the gate. Record the false block, find out whether the case, the grader or the threshold was at fault, and change it. Do not train the team to override it.
Where should you start?
Pick the cheapest tier first. Add deterministic checks to your pipeline this week, then turn your last five production failures into a regression set. That alone puts a real barrier between a harness change and your users. We build these into the custom software for AI workflows we ship, so the gate lives in your own pipeline rather than in a tool you rent.
If you want a second set of eyes on where your gate should sit, you can book a $250 consultation, or read how we build agents.
Liked this?
Want this built for your team, or want to learn it yourself? Either way, start here.
Next read →
Runtime Guardrails for AI: Check the Output Before Users Do