Nobody has merged anything since Friday, and on Monday your AI feature fails on every call. On the Claude API, the error is a 404 with not_found_error. The code is the same as last week. The model it calls is gone.

That failure is why I write the way back before the way in. An AI feature can break without a code change, so before the first user sees it, write a one-page rollback plan in the repo: what you pin, what stays switchable, who flips the switch, and proof that the flip works.

Three things move under you

I used to plan the way back for code only: a bad release, a revert, a redeploy. An AI feature has three more parts that can change while your code sits still. The model, the prompt and the shape of the data you feed it. A plan that covers only one of them leaves you facing the other two with nothing written down.

The model is the one with a public calendar. Anthropic says it regularly retires older models, and that applications relying on them may need occasional updates to keep working. Its lifecycle has four states: Active, Legacy, Deprecated and Retired. A retired model is no longer available, and requests to it fail.

About 0 months

between notice and retirement for Claude Sonnet 4 and Opus 4

Two months is plenty if someone owns the date. It is very little if the model name lives in three services and nobody is watching the list.

Pin the model, then write down when the pin expires

OpenAI's prompt engineering guide recommends pinning production applications to specific model snapshots. Do it. A pin stops a silent upgrade from changing your feature's behaviour. But a pin doesn't stop a retirement. It has an end date, and the plan should say what it is.

  • One place for the model name. A config value, not a string copied into every call site.
  • Find every caller. Anthropic's page shows how: export usage from the Console as a CSV, broken down by API key and model.
  • Test the next model early. Anthropic advises testing with newer models well before your current model's retirement date. OpenAI's guide recommends evaluation suites that measure prompt behaviour, and says they cover upgrading model versions too.

Keep the prompt and the data shape switchable

A prompt is behaviour. If someone can edit it outside code review, it can change your feature with no deploy at all. Keep it in the repo, versioned, so the previous version is one switch away.

Data shape is the quieter one. A field gets renamed, a document arrives in a new format, and the model still answers, just worse. Nothing throws. Keep the previous shape readable, or the previous path runnable, behind a switch.

Martin Fowler describes long-lived kill switches that let operators gracefully degrade non-vital functionality. That is the right tool here. He also warns that toggles carry a cost, so keep few of them and remove the ones you no longer need. For an AI feature I'd keep one kill switch for the feature and one switch each for the prompt version and the model. Not twelve.

Name the person who flips it

A switch without an owner is a switch nobody flips at the right moment. The SRE Workbook describes a canary that sends only a small fragment of traffic to the new version. If its error rate is far from the control's, you pause and roll back, or perhaps contact a human. Your plan should say which human, by name, and who covers when that person is offline.

Write down what "bad" looks like, too, so nobody argues about it in the moment. In the Workbook's worked example, the team had no rollback option, and the page says fixing the errors without one will almost certainly prolong the user impact.

Flip it once before launch

Fowler says you must validate every codepath that may end up live in production. You don't need every combination: test the expected configuration, plus the fallback with the new toggles off. For an AI feature, that means the named owner turns the feature off in staging, following the written page, and checks what the user sees.

A switch nobody has flipped is a hope, not a plan.

What I'd put at the top of every AI feature's plan

The one page

  1. 1PinnedThe model snapshot, where its name lives, its retirement date if one is announced, and who watches the vendor's list.
  2. 2SwitchableThe kill switch, the prompt version switch, the previous data path, and what the user sees when each one is off.
  3. 3WhoThe person who flips it, their backup, and the signal that means flip now.
  4. 4TestedThe date the fallback was run with the new toggles off, by whom, and what happened.

It fits on a page because it should. Keep it in the repo next to the feature, so it changes when the feature changes. Write it before launch, while you still remember every moving part.

Free playbookThe AI SDLC PlaybookFrom a spec to production when AI agents write most of the code: spec, plan, build, review that reproduces bugs, gates, ship with a way back, and the lesson loop. Seven parts, the way I work.Get the playbook Building with AI?Let's talk about your appBook a free intro call