Why rollback needs its own plan
Most migration playbooks end at "promote to 100%". Microsoft's six-phase process ends with a Retire step that decommissions the old deployment and archives the evals.1 That is the right ending for a migration that worked. It is the wrong default for the first weeks after cutover, when the old route is the only thing standing between a regression and your users.
The common failure is not a dramatic outage. Answers get a little longer, a JSON field goes missing in 2% of calls, the bill rises with no matching rise in traffic. Because these changes arrive without an error, nobody pulls a trigger. INFRO's own traffic-change findings make the same point: they read request metadata such as token counts, finish reasons and latency, never answers, so they can say something changed and what it costs, but not that answers got worse.2
So the plan has four parts: triggers agreed in advance, an old route that is still usable, a clear view of what moves when you switch back (caches and token counts), and a record of what went wrong. The sections below take them in that order.
Set rollback triggers before cutover
A trigger is a metric, a window, a minimum sample and an owner. Without all four, the argument happens in a chat thread while the regression continues. Write them down in the cutover ticket, next to the go/no-go criteria.
Split triggers into two kinds. Hard triggers are cheap to measure and unambiguous: provider error share, schema-validation failures, tool-call arguments that fail your parser, and answers cut off by the length limit. Soft triggers need judgement: evaluator scores, the thumbs-down share from end users, and cost per successful task. Soft triggers need larger windows, because a judge score on 30 answers is noise.
A small check makes the hard triggers executable. This sketch assumes you already export per-request records with a schema_ok flag your own code sets:
from dataclasses import dataclass
@dataclass
class Window:
n: int # requests in the window
schema_fail: int # requests that failed validation
length_cut: int # finish_reason == "length"
def should_roll_back(new: Window, base_length_share: float) -> list[str]:
reasons = []
if new.n < 500:
return reasons # too few requests to act on
if new.schema_fail / new.n > 0.01:
reasons.append("schema failures above 1%")
if new.length_cut / new.n - base_length_share >= 0.03:
reasons.append("length cut-offs up 3+ points")
return reasonsKeep the baseline from the old model's last stable week, not from the canary. Where the migration rides on a managed prompt version, a rule on the prompt label can move it back to the previous version or only alert when a score, pass rate or thumbs-down share crosses a threshold, checked every five minutes (INFRO's prompt rollback rules). That reverses the prompt, not the model, so use it for prompt-side regressions and keep model routing separate.
Keep the old route warm while its date allows
A rollback target has to exist, be authorised, have quota, and still answer. The retirement date limits how long it stays that way. On Microsoft Foundry, a retired model returns 410 Gone, and the migration guidance says retirement dates are not extendable and have no exception process.31 Work backwards from that date:
- Find the old model's retirement date from the vendor's schedule. Subtract the time a second attempt needs (new eval cycle, prompt rework, canary). The result is your last useful rollback date. After it, rolling back only buys time.
- Check what the old deployment does at retirement. Standard-type Foundry deployments are auto-upgraded on a rolling, region-by-region schedule, and
versionUpgradeOptionset toNoAutoUpgrademeans the deployment stops working. Provisioned deployments are not auto-upgraded.31 An old deployment set to auto-upgrade may quietly become the new model, so your "rollback" lands on what you left. - Keep the old target in the route at weight 0. INFRO's weighted routes treat a weight-0 target as a standby that never takes a first attempt, and a weighted route still fails over through the rest if the first pick fails.4 Switching back is then a weight change, not a deploy.
- Probe it. A standby nobody calls can lose its key, quota or model access unnoticed. Send a few synthetic requests through it on a schedule and alert on failure. For Foundry, keep the old deployment's capacity and region confirmed; the Assess phase says the target should run beside the source so a rollback path remains.1
- Watch the vendor's own lifecycle. INFRO records vendor shutdown dates, warns organisations still sending a retiring model, and refuses it from the shutdown date, naming the replacement. Treat that warning as the countdown on your rollback window.
Flipping weights also has a sharp edge. A weighted route picks the first target per request, not per conversation, so a mid-conversation weight change can alternate models inside one session.4 If your sessions carry tool state or long histories, roll back by route rule on session or end-user identity rather than by a global flip, or let new sessions start on the old model and let open ones drain. A stream that has already started is not restarted on another target.5
Handle prompt-cache differences on the way back
Provider prompt caches live with the upstream that served the request, so hits depend on consecutive requests reaching the same connection.6 After a cutover, the new model's cache is warm and the old one has been idle. Idle is the issue: Anthropic's default cache lifetime is five minutes, with a one-hour option at extra cost,7 and Azure OpenAI's in-memory cache is typically cleared after 5 to 10 minutes of inactivity and always within an hour.8 Azure also does not share caches between subscriptions.8 On rollback the old route starts cold, and the first request per prefix pays the write price.
Writes cost more than ordinary input. Anthropic's table lists Claude Sonnet 5.5 at $2 per million input tokens, $2.50 for a five-minute cache write and $0.10 for a hit.7 Azure OpenAI says cache writes can incur charges on GPT-5.6 and later families, while earlier models charge nothing extra to write.8
Do not keep the old cache warm with constant dummy traffic unless the arithmetic says it pays; a steady trickle costs reads and refreshes forever. Instead, price the cold start, roll back in stages so the hottest prefixes warm first, and check that the cached share recovers. INFRO's traffic findings flag a cached share of prompt tokens falling by 10 percentage points or more, which is the signal both for the cutover and for the rollback.2
One more cache to check: if you use an exact-match response cache with a time-to-live, answers written by the new model can keep being served after rollback until they expire. Keep the TTL short during a migration, and confirm how your cache keys the model before you rely on it.
Separate cost causes before you blame quality
A cost regression after cutover is not always a reason to roll back. Decompose it first, on the same inputs, because each cause has a different fix.
| Cause | How to see it | Roll back or fix forward? |
|---|---|---|
| Token count per input rose (new tokenizer) | Same text, more input tokens | Fix forward: re-forecast, trim the prompt |
| Cached share fell | cached_tokens lower; cache writes higher | Fix forward: stable prefix, cache breakpoints |
| Output per request grew | Output tokens and length cut-offs up | Either: cap output, adjust prompt; roll back if quality is also down |
| Rate per token is higher | Provider rate card for the model | Roll back only if the quality gain does not pay for it |
The tokenizer line is the easiest to miss. Anthropic states that Claude 4.7 and later models use a newer tokenizer, and the same text yields roughly 30 percent more tokens than on earlier models, varying by content. It tells you to recount prompts on the target model.9 At an unchanged per-token rate, a 30% rise in counted tokens is a 30% rise in input cost, with no change in quality. Azure's migration guidance warns that reasoning tokens, cached input and structured-output overhead can swing unit economics by 2x or more, so project cost from your own traffic rather than list price.1
The cache fields differ by vendor and model generation. On Azure OpenAI GPT-5.6 and later, usage reports cached_tokens and cache_write_tokens; a single character change in the first 1,024 tokens misses the cache.8 Compare the old and new models on a replay rather than on live traffic, so the mix of requests is identical. INFRO experiments can run a dataset across up to six variants, with the request count and estimated provider cost shown before it starts and a spend cap it stops at.10
Capture the data for a second attempt
A rollback without a record repeats itself. Microsoft's guidance is blunt that production content capture is opt-in and never retroactive, so you cannot evaluate traffic you did not record.1 INFRO's prompt and completion logging is off by default with a retention window you choose, so decide before the rollback, not after, what to switch on for the affected route and for how long. Keep within your own payload logging policy.
Record these at the moment of rollback:
- The trigger. Which rule fired, its value, the window and sample size, and who approved.
- Reported model ids. The snapshot each provider reported, per connection. A model name that quietly moved to a new snapshot looks like a regression in your model and is not one.2
- Per-request counts. Input, output, cached and cache-write tokens, finish reason, latency and time to first token, for both models. INFRO records model, latency, token counts and estimated provider cost per request, and traces name the route and the connection that served it.11
- Failing cases as a dataset. Pull the requests that failed validation, scored low or drew thumbs-down into a frozen dataset, plus a random sample of passes so the next evaluation is not biased toward failures. Freeze inputs and success criteria for the whole attempt; if they change, source and target are no longer comparable.1
- What changed besides the model. Prompt version, parameters, tool definitions and output schema. Azure's Adapt phase lists these as surfaces a migration touches, and recommends replaying unchanged before you tune.1
- The cost decomposition from the previous section, with the recounted tokens for each prompt.
Scores on a request or a run, from your code, from evaluators or from end-user feedback, let you attach quality to the same records as cost. Runs group requests sharing a trace id, so multi-step agent failures can be read as one unit.
Run the second attempt as a fix, not a retry
Start attempt two from the dataset, not from the calendar. Replay the frozen cases against the new model with the old configuration to confirm you reproduce the failure. Change one surface at a time (prompt, schema, parameters, tool wording), and re-run the same cases. Only when the failing set passes and the passes still pass do you return to a canary.
When you return, narrow the blast radius: a small weighted share, or a route rule scoped to the feature whose cases you fixed, with the same triggers and the old route still at standby. If your last useful rollback date has passed, say so in the plan and either ship with tighter triggers on a route that can fail over to a third model, or choose a different replacement entirely. Microsoft's guidance notes you do not need to wait for a named replacement and can evaluate other candidates, since the vendor-named model is a recommended target, not the only choice.3
If your gateway shows the model, route and prompt version on every request, the rollback itself is a small change and the record is already there. Without that, the fastest improvement is to start storing those fields per request now, before the next cutover.
