How Do You Roll Out a New Agent Version Safely?
Test offline, then in shadow, then on a small slice of live traffic, with a quick way back, for your AI interview.
In short
Ship a new agent version the way careful teams ship any risky change: test it offline, replay real work with writes blocked, then send a small slice of live traffic through it against limits set in advance. Keep the old version one switch away, so a bad version can be pulled back quickly.
14 min readIntermediateOccasional ยท estimateFacts checked 27 November 2026
Say it out loud
Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.
I never switch every user to a new agent version at once. First I run it against a fixed set of past cases, several times each, because outputs vary. Then I replay real recent work with the write tools in dry-run, so nothing is really sent. Then I send five percent of live traffic to it for a couple of days, with pass or fail limits for wrong refunds, speed and escalations, all set before the test starts. If one limit fails, I move the live alias back to the old version. A version is the prompt, the model and the tool settings together, so they ship together.
The first thing I settle is what counts as a version. For an agent, that is the prompt, the model snapshot, the tool definitions and the config, shipped as one bundle. If I change any one of them, it gets a new version number and goes through the same gates. Otherwise, when something breaks, I can't tell which change caused it.
The gates run in order, and each one is cheaper to fail than the next. First comes an offline run on a golden set, which is a fixed list of past tickets with known good outcomes. I run each case several times, because one pass can be luck. Second comes a shadow replay of last week's real tickets, with every write tool in dry-run, so the new version proposes refunds that nobody pays. I compare its choices with the old version and with the human decisions. Third comes a canary: five percent of live tickets for 48 hours, judged against limits I wrote down before it started.
The last step is the one people forget. Rollback should be a switch that points the live alias back to the old version, which is quick and needs no new build. For a normal promotion, sessions already in flight finish on the version they started with. For a harmful version, stop its write tools first, then move open sessions to the old version. Finally, a golden set goes stale, so I re-run it on a schedule as well as at release. I would tell an interviewer that every gate has a cost, and the aim is to catch each failure at the cheapest step that can see it.
What is a safe rollout of a new agent version, in plain words?
An agent is an AI app that reads a task, uses tools (such as a refunds system or an inbox) and acts on what it finds. A new version is any change to how it works: a new prompt, a new model, new tool settings. A safe rollout finds the problems while they are still small and cheap.
Think of a hospital changing its triage rules. It doesn't switch every ward on the first day. It checks the rules against old case notes, watches them on live patients without acting on them, then tries them on one ward with a clear stop rule. A refunds agent earns its way to full traffic the same way, because one wrong refund costs money and customer trust.
Key words
- Golden set
- A fixed list of past cases with known good outcomes, run the same way on every version.
- Shadow run
- The new version runs on real requests, or on replays of past ones, but its writes are blocked, so nothing real happens.
- Canary
- A small slice of live traffic, for example five percent, sent to the new version first.
- Alias
- A name, such as live, that points at one version. Moving it back is the rollback.
What exactly counts as a new version?
Many bad releases come from a change nobody filed as a change: someone edited the prompt, a newer model snapshot was swapped in, or a tool's input changed its unit. So a version is the whole bundle. It gets one number and ships as one piece.
Prompt
The instructions the agent follows, including its rules for refunds and escalation.
Model snapshot
The exact model it runs on. Models get retired, so this part needs a plan too.
Tool definitions
The names and inputs of the tools it can call, such as refund_order with an order id and an amount.
Config and memory
Limits, timeouts and any saved notes the agent reads back later.
Model retirement has a clock. Anthropic says that once a model is deprecated, you should move all usage to its replacement before the retirement date, because "Requests to retired models fail." So the model goes on the release calendar like any other change.
How do the release gates run, in order?
- 1
Offline on the golden set
Run the fixed past cases, several times each. A case counts as passed only if it passes every run.
- 2
Shadow replay
Replay last week's real tickets with the write tools in dry-run (the tool works out what it would do but does not act). Compare the new choices with the old version and with the human decisions.
- 3
Canary
Send five percent of live tickets to the new version for 48 hours. Watch wrong refunds, slow replies and escalations against the limits.
- 4
Full rollout, or rollback
If every limit holds, move the live alias to the new version in waves. If one fails, move the alias back.
โBecause model outputs vary between runs, we run multiple trials to produce more consistent results.โ
Anthropic
โModels sometimes produce different output from the same input, which makes traditional software testing methods insufficient for AI architectures.โ
OpenAI
Trials matter because one pass proves little. Anthropic's measure, pass^k, is the chance that all k trials succeed. Its own example: an agent that passes 75% of the time on each try passes all three tries only about 42% of the time. A chat tool that needs one good answer can live with a single pass. A refunds agent must behave every time, so the stricter test is the one I gate on.
Tip
Write the limits down before the canary starts. A limit chosen after seeing the numbers will pass whatever happened.
How a new version reaches customers
New agent version
Prompt, model, tools and config
Before any customer
Golden set
Past cases, each run several times
Shadow replay
Real tickets, writes in dry-run
Canary, 5% of tickets
48 hours, limits set in advance
Every limit holds?
Wrong refunds, speed, escalations
Move alias to new
Waves widen until all users
Move alias back
Old version serves again at once
- 1The whole bundle goes through the checks as one version.
- 2Offline results first, then real tickets with writes blocked.
- 3Only a version that passes reaches live customers.
- 4Live numbers are judged against limits set before the test.
- 5If every limit holds, the alias moves to the new version.
- 6If one limit fails, the alias moves back to the old version.
Amazon's production pipeline uses the same caution for live traffic. Each production wave starts with a one-box stage: one server out of the many that run the app. If the change causes a negative impact in that one box, the pipeline rolls back by itself and doesn't promote the change to the rest of the prod stages.
โIf the change causes a negative impact in the one box, the pipeline automatically rolls back the change and doesn't promote it to the rest of the prod stages.โ
Amazon
The canary is judged on live numbers, from real customers and real payments. A dry-run replay can't show what a payment really did.
What makes an agent rollout harder than a normal app?
A normal web service can often roll back by putting the old code back. An agent adds three problems that a code rollback doesn't fix.
Real actions during tests
A test run that really sends a refund or emails a customer is a live incident. Every write tool needs a dry-run switch that the test code sets, so the prompt can't turn it off.
Sessions in flight
For a normal promotion, a chat that began on version 2.3 finishes on version 2.3. For a harmful version, stop its write tools first, then move the chat to the old version. Switching mid-conversation can mix two sets of rules in one answer.
Compatibility
During a canary, old and new versions run side by side, so tool inputs and saved memory must work for both. Amazon's definition of backwards compatible: "A version of software that can be rolled back without errors or disruption to the functionality available in the previous version is called backwards compatible."
- Slow way
Redeploy the old code
A build and deploy takes time, and customers keep meeting the bad version until it finishes.
- Fast way
Move the alias back
Live traffic goes to the old version at once, and the new one stays available for debugging.
Anthropic notes that once you have evals (tests that score the agent's work), you get baselines and regression tests, because latency, token usage, cost per task and error rates can be tracked on a static bank of tasks. OpenAI recommends continuous evaluation, which runs evals on every change, watches for new cases of nondeterminism (the same input giving different outputs) and grows the set over time. OpenAI is also phasing out its Evals platform, so the habit matters more than the tool.
What does a canary catch in practice?
Here is a made-up refunds agent at a mid-size online shop. Version 2.4 rewrites the prompt to sound friendlier about late returns, and nobody meant it to loosen the 30-day policy.
The offline golden set passed. Only one case in a hundred in that set was a late return, but about one live ticket in twenty-five is. The test set never pushed the agent hard on the rule it had just changed. OpenAI calls this a biased design: eval data that misses how real traffic looks.
The shadow replay missed it too. Recorded tickets can't answer back, so the replay saw only the first reply, never the customer pushing for an exception over several turns. Only the live canary showed the problem. The gate script below reads the stable and canary numbers and prints one decision.
# A canary gate for a refunds agent (made-up numbers, simplified).
# Code, not a person, decides the next rollout step.
stable = {"wrong": 0.001, "p95": 8.1, "escalated": 0.110}
canary = {"wrong": 0.009, "p95": 9.4, "escalated": 0.114}
gates = [
("wrong refunds (share)", "wrong", 0.005, "max"),
("p95 seconds per ticket", "p95", 12.0, "max"),
("escalations vs v2.3", "escalated", 0.02, "change"),
]
print("gate limit seen result")
failed = []
for label, key, limit, kind in gates:
seen = round(canary[key] - stable[key], 3) if kind == "change" else canary[key]
ok = abs(seen) <= limit if kind == "change" else seen <= limit
if not ok:
failed.append(label)
print(f"{label:<25} {limit:<8} {seen:<8} {'PASS' if ok else 'FAIL'}")
print("decision: ROLLBACK to v2.3 (move the alias)" if failed else "decision: PROMOTE to the next wave")Output
gate limit seen result wrong refunds (share) 0.005 0.009 FAIL p95 seconds per ticket 12.0 9.4 PASS escalations vs v2.3 0.02 0.004 PASS decision: ROLLBACK to v2.3 (move the alias)
The canary showed 0.9% wrong refunds against a 0.5% limit, so the alias moved back to v2.3. A rate only counts once the slice has enough tickets behind it to trust it, and the team audits a sample of refunds during the 48 hours, because a wrong refund shows up only when someone checks it. The five percent slice is what kept the damage small: refunds it had already paid went onto a manual review list, and the rest of the customers never saw v2.4. The fix went into the golden set first: late-return cases at their real share. Then every gate ran again before v2.4 went back out. The whole check took about three days, and the canary was most of that time.
What does the interviewer want to hear?
A strong answer covers
- A version is the prompt, model snapshot, tool definitions and config, shipped together.
- Offline tests first, run several times, on cases that match real traffic.
- A shadow run with writes blocked, then a small canary with limits set in advance.
- Rollback is a switch that moves an alias back, and write tools stop before open sessions move.
- One named failure a gate caught, and what it saved.
- The honest limit: offline tests can miss what only live traffic shows.
Common traps
Trap"Run the eval suite once and ship when it's green."
BetterOne green run can be luck, and an easy test set proves little. Add trials, and a canary with live numbers.
Trap"Rollback means redeploy the old code."
BetterThat takes time while customers see the bad version. Keep an alias that moves traffic at once.
Trap"Dry-run tests cover the side effects."
BetterDry-run checks what the agent asks for. Only the live canary shows what the payment or email really did.
Can you spot the risky rollout?
Spot the risky rollout
A refunds agent gets a new prompt. Which plan is safest?
Quick check
A new version passes every offline test, but the canary shows wrong refunds at 0.9% against a 0.5% limit. What now?
Can you answer these from memory?
Flash cards ยท tap a card to flip it
What will they ask next?
- Q257How do you regression-test prompts?12 min
- Q256Capability evals vs regression evals?10 min
- Q258How do you A/B test an LLM feature?12 min
- Q190How do you trace and debug an agent run?11 min
- Q247Offline vs online evaluation?11 min
- Q275Eval scores dropped but the model is unchanged. How do you debug?12 min
Last updated on 27 November 2026
Shipping an agent to real customers?
I design and build AI agents with this kind of release discipline: test sets, shadow runs, canaries and rollback switches. Book a short call and tell me what your agent touches and how you would know it had broken.