Skip to content
All posts

Rolling out an AI feature safely: shadow mode, feature flags and a kill switch

How to launch an AI feature without a big-bang release: run it in shadow mode, roll it out behind feature flags, watch the right signals and keep a kill switch ready.

Shubham Somani 4 min read

Most software either works or throws an error. An AI feature can do something worse: give a confident, plausible, wrong answer to a real customer. And because the same input can produce different outputs, a successful test run doesn’t prove it will behave the same way for everyone.

That’s why we’d never launch an AI feature to every user at once. A staged rollout lets you learn from real traffic while limiting who’s affected if something goes wrong. Here’s how we’d roll out an AI feature safely.

Run it in shadow mode first

In shadow mode, the AI runs on real requests but nobody sees its output. Your existing process carries on as before.

  • Run the AI alongside the current process, whether that’s a person, a rules engine or nothing at all.
  • Compare its output with what actually happened. Where they differ, find out which was right.
  • Measure speed and cost on real traffic, which often looks different from your test data.

Shadow mode is especially useful for classification, routing and extraction, where there’s a clear “right answer” to compare against. It costs model calls but carries no customer risk.

Put it behind a feature flag

Every AI feature should be switchable without a deploy.

  • Wrap the feature in a flag that you can turn on per user, per account or for a percentage of traffic.
  • Start with your own team, then a few friendly customers who know it’s new, then a small share of everyone.
  • Increase gradually, checking your signals at each step before widening the rollout.
  • Keep the old path working until the new one has earned its place.

If you don’t have feature flags yet, a simple table in your database is enough to start. The point is control, not tooling.

Keep a kill switch ready

When an AI feature misbehaves, you want to turn it off in seconds, not after a code review and a deploy.

  • Make “off” a safe state. Decide in advance what users see when the feature is disabled: the old behaviour, a manual process or a clear message.
  • Test the kill switch before launch, so you know it works when you need it.
  • Write down who can use it and when, so nobody hesitates during an incident.

The same switch helps when your model provider has an outage or a change you didn’t expect. Our post on deploys that don’t page you covers the wider habits behind calm rollbacks.

Decide what you’ll watch before you launch

Pick the signals that tell you whether to widen, hold or roll back, and agree on them in advance.

  • Quality: your test set results, the share of answers users accept or edit, and thumbs-down rates. See collecting user feedback on AI features.
  • Safety: flagged outputs, escalations to a person and any complaints.
  • Speed and cost per request, compared with what you expected.
  • Errors: timeouts, failed validations and fallbacks taken.

Write down what “bad enough to roll back” looks like for each. Deciding during an incident is much harder.

Change one thing at a time

  • Treat prompt, model and retrieval changes as releases, each behind the same flags and checks as the original launch.
  • Pin the model version so upgrades happen when you choose, not when a provider changes a default.
  • Re-run your test set before every change. We cover how in test your LLM feature before users do.

The short checklist

  • Run in shadow mode and compare with what really happened
  • Launch behind a feature flag: team, friendly customers, then a small share of everyone
  • Keep a tested kill switch with a safe “off” state
  • Agree on quality, safety, speed, cost and error signals before launch
  • Treat every prompt or model change as a new rollout

If you’re about to launch an AI feature and want it rolled out without surprises, see our fixed-scope offers or book a 30-minute call.