How Do You Stop a Worse AI Agent From Shipping?
I'm Mahmoud Zalt, an AI architect who ships changes to the agents behind Sistava many times a day, which is exactly why this gate exists.
You put a release gate in the deploy path. Before the release is built, it runs your free eval suites on the exact frozen release, compares every metric with an accepted baseline using a per-metric tolerance and a minimum sample count, and fails the ship if anything got worse, if a suite broke, or if a metric is missing. Overriding it requires a written reason that gets logged and announced.
Ours compares 23 measures from knowledge retrieval, agent trajectories, the red team and memory. In its first runs, 23 of 23 passed against the baseline, a second run gave identical scores, the suites took about 80 seconds, and no paid model was called. It is now wired into every production ship. The first runs are documented in our research issue How We Evaluate AI Employees. This article is how it is built and why it can run for free.
Why Agents Regress Silently
Agents do not fail like normal software. A prompt edit that improves one role can quietly break tool selection in another. A model upgrade can change how often the agent asks before acting. A new skill can conflict with an existing duty. A refactor of the tool layer can change an argument schema. None of these throw an exception, none of them fail a unit test, and a quick manual try usually looks fine.
When you ship many times a day, each change is a small chance of a small regression, and small regressions compound. The answer is the same one we use for performance and security: an automatic check on every release, compared against the last known good state, that blocks rather than warns. A warning you can ignore at 6pm on a Friday is not a gate.
What Goes Into the Gate
Every suite in the gate is one we already ran by hand. The gate's job is to run them all, every time, and compare.
| Family | Measures | Size today |
|---|---|---|
| Knowledge retrieval, two datasets | Answer quality, recall at 5, mean reciprocal rank, evidence recall, isolation leaks, for each dataset | 106 and 163 questions |
| Agent trajectories | Task success, tool precision, tool recall, argument accuracy, no forbidden action on replayed runs, plus task success of the golden scripts | 34 scenarios |
| Red team | Case integrity, product-layer checks, and the tests that prove each check can fail | 61 cases, 4 product checks, 11 check tests |
| Memory | Fact-bearing turns kept, isolation, small talk skipped, recall | 22 fact turns, 4 isolation probes, 9 small-talk turns, 9 recall probes |
That is 10 knowledge measures, 6 agent measures, 3 red-team measures and 4 memory measures: 23 in total. Each family is described in more depth elsewhere: trajectories in how to evaluate AI agents on real multi-step tasks, the red team in prompt injection in AI agents, and the live layer that runs after release in online evals for AI agents.
Why It Runs Free
A gate that costs money per run will be skipped the first time someone is in a hurry. So every suite in the gate runs without a paid model call. Each family gets there differently:
- Agent trajectories use record and replay. A deliberate paid live run saves every model reply as a recording. The gate feeds those recorded replies through today's agent graph, today's tool schemas and today's checks. If someone breaks a middleware, a tool schema or argument validation, the replay fails. The golden scripts run alongside as a second, model-free signal.
- Knowledge uses an offline local embedder and no reranker, which makes retrieval deterministic and free.
- The red team runs product-layer checks and two scripted agents, one always unsafe and one always safe, proving every case can still detect a failure and every product defence is still in place.
- Memory runs the production ingestion gate against a simple store, with no model, checking that facts are kept, small talk is skipped and people stay apart.
The trade-off is worth stating precisely. Free stand-ins catch a drop relative to the last release. They do not measure absolute quality, and replay cannot tell you how the model would decide differently under a new prompt, because it reuses yesterday's decisions. Those questions need paid live runs, which stay a separate, deliberate step. The gate answers one question, and answers it every time: is this release worse than the one it replaces?
Tolerances and Minimum Samples
Comparing against a baseline is easy. Choosing how much worse is acceptable is the real design work. All tolerances live in one file, each with a reason in the commit that changed it. A simplified slice:
metrics:
knowledge_recall_at_5: { max_drop: 0.02, min_samples: 80 }
agent_task_success: { max_drop: 0.03, min_samples: 30 } # 34 scenarios
agent_no_forbidden: { max_drop: 0, min_samples: 30 }
redteam_case_integrity: { max_drop: 0, min_samples: 50 } # 61 cases
memory_isolation: { max_drop: 0, min_samples: 4 }Three rules shaped those numbers.
- Tolerance in the metric's own units, sized to the dataset. One scenario out of 34 is 0.029, so a tolerance of 0.03 on trajectory metrics allows exactly one flip. Anything more fails.
- Zero tolerance where a single failure matters. Forbidden actions, red-team integrity, isolation leaks and golden scripts all have a tolerance of zero. A slightly worse leak rate is not a thing.
- Minimum samples guard against silent shrinkage. Every dataset is fixed, so if a metric measured fewer cases than expected, a suite, dataset or recording broke. The metric fails rather than reporting a confident number about nothing. The minimum sits a little under today's count, so trimming a few cases does not need an edit.
A missing metric is a failure too. A suite that crashes or times out leaves its metrics missing, and missing never reads as a pass.
Pass, Regression, Broken, and the Override
| Outcome | What the ship does |
|---|---|
| Pass | Continues to build |
| A metric beyond its tolerance | Stops before the build, records the failure, notifies me |
| Gate broken, for example no container or image | Stops the same way; a broken gate never passes unchecked |
| Frontend-only change | Skipped and logged, because the backend is unchanged |
Three exits, not two, is deliberate. If the gate can only say pass or fail, someone eventually treats an infrastructure error as a pass to get a fix out. A distinct broken state that blocks the same way removes that temptation.
There is an emergency override, because there are real emergencies. It is refused without a written reason, the reason is written to the ship log, and a notification titled with that reason lands in the deploy ledger. An override you have to explain in writing, in public, gets used rarely.
Some drops are intended: a harder test, a new dataset, a deliberate trade-off in a prompt. For those, the last complete run is accepted as the new baseline with a reason, and the acceptance is appended to a history of who accepted it, why, and at which commit. A broken or partial run cannot be accepted. One practical gotcha: the baseline is tied to the evaluation image. Rebuilding the image can move knowledge scores, for example when the document parser changes, so after a rebuild you re-run and accept if only the image moved.
The Gate Is One Layer, Not the Whole Defence
A release gate answers one question at one moment. Evaluation has to answer four:
- Before release: does it do the job correctly on tasks where we know the right answer? Offline suites.
- At release: is the new version at least as good as the last? The gate.
- In production: is this piece of work good enough to send, and are real conversations ending well? Online evals, with scores compared before and after each release and over the next 24 hours.
- When a new model appears: would switching make the agent better, worse or just different? The same suites, run side by side.
And one loop ties them together: a failure seen in real use becomes a new test case, so the gate catches that mistake before the next release. A gate whose test set never grows protects you from yesterday's bugs only.
What to Ask Any AI Agent Vendor
If you are buying rather than building, you can still demand this. The questions I would ask:
- Is every release tested against the last good version before it ships, or only major ones?
- What is measured: tool use, safety, memory and retrieval, or only reply quality?
- Does a failure block the release, or just warn? Can a broken test run ever count as a pass?
- Who can override, and is the override logged with a reason?
- Do you publish dated results naming the model, the date and the code version, including weak results?
- After release, do you compare live quality before and after, and alert on a drop?
- Who pays for the testing?
A vendor that cannot show you a dated test run is asking you to discover its regressions in your customers' inboxes.
Where the Gate Falls Short
- Relative, not absolute. Free stand-ins detect drops against the last release, not absolute quality.
- Replay reuses old decisions. It catches code regressions around the model, not changes in how the model would behave under a new prompt.
- Tolerances let small drops through. Several drops each inside tolerance can add up across releases. Watch the baseline history, not just the verdict.
- Small, fictional datasets. One test agency, 34 scenarios, 22 memory questions. One flip moves a percentage by several points.
- It does not fix weak spots. Asking before acting on an unclear request (1 of 3 in our scenarios) and changed facts in memory (14 of 21) are still weak. The gate makes sure fixes, once landed, stay landed.
Frequently Asked Questions
What is a regression gate for AI agents?
An automatic step in the deploy path that runs eval suites on the release candidate, compares each metric with an accepted baseline, and blocks the release if any metric got worse beyond its tolerance.
How can an agent eval gate run without paid model calls?
Record model replies during deliberate paid runs and replay them through the new code, use a local embedder for retrieval, and use scripted agents for safety checks. You measure relative drops for free and keep absolute measurement as a separate paid step.
How do I choose tolerances?
Size them to the dataset in the metric's own units, so you know exactly how many flips are allowed. Use zero for anything where a single failure is unacceptable, such as forbidden actions or data isolation.
What if a score drops on purpose?
Accept the new run as the baseline with a written reason and keep a history of every acceptance. Never accept a partial or broken run.
Should the gate block or warn?
Block, with a logged, reasoned override for emergencies. A warning is a suggestion, and suggestions lose to deadlines.
Three Things to Take Away
One. Make the gate free, or it will be skipped. Record and replay, local embedders and scripted agents get you a meaningful relative check with no model spend.
Two. Design the failure modes, not just the pass. Tolerances sized to the dataset, zero tolerance on safety, minimum sample counts, missing means fail, and a broken gate never passes.
Three. Make every exception expensive to explain: a written reason for every override and every accepted drop, kept in a history.
If you want help wiring an eval gate into your own agent's deploy path, that is part of my agent development engagements. The first gate runs and the rest of our evaluation results are in How We Evaluate AI Employees.







