"Deploying AI features safely: feature flags, shadow mode and staged rollout"
A one-line prompt edit can shift behaviour across your entire input distribution. Treating model and prompt changes like risky deploys, eval gates, flags, shadow mode, staged rollout, is how AI features ship without incidents.

Teams that would never merge code without review will happily edit a production prompt in a dashboard at five o'clock on a Friday. The edit looks harmless, it is only words, and nothing objects: no compiler, no type error, no failing build. But a prompt change is a deploy. So is a model version bump, a temperature tweak, a new tool description. Each one changes the behaviour of a production system for every user, and it deserves the same ceremony as any other change that can do that.
Arguably more ceremony, because AI changes are non-local in a way most code changes are not. Change a function and the effect is bounded by its call sites; you can reason about the blast radius. Change a prompt and the effect lands somewhere across your whole input distribution: the line you added to fix Tuesday's edge case quietly degrades a category of inputs you will not see again for three weeks. You cannot reason your way to safety here. You can only measure your way there.
The first gate is offline evals. Before any change goes near production traffic, it runs against a suite of real cases with scoring, exact checks where outputs are structured, an LLM judge or rubric where they are not. Evals are the unit tests of behaviour: not proof of correctness, but a cheap, fast filter that catches the regressions you already know how to describe. If you do not have an eval suite yet, build one before building any of the rollout machinery below; even fifty representative cases change the conversation from "I think this is better" to "it scores better on the cases we care about".

Next, feature flags, from day one, for every AI feature. Not just on/off, but which behaviour: the model id, the prompt version and the parameters should all be flag-controlled configuration, not hardcoded values. This buys you two things. A kill switch measured in seconds rather than deploy cycles, which matters when a model starts misbehaving at 2am. And cohort routing, which is the mechanism everything below runs on.
For changes with real blast radius, shadow mode comes before exposure: run the candidate version alongside the incumbent on live traffic, log what it would have done, act only on the incumbent. You learn how the change behaves on today's actual inputs, not last quarter's eval set, at zero user risk. It is a big enough topic that I have written about it separately; here it is simply the stage between "evals pass" and "users see it".
Then roll out in stages: internal users, one per cent, ten, fifty, everyone. The discipline is not the percentages, it is deciding, before you start, which metrics you are watching and what number constitutes a regression that halts the rollout: guardrail metrics, in the language of experimentation teams. Correction rate, escalation rate, task completion, complaints, latency, cost per task. AI quality metrics are noisier than a latency graph, so each stage needs enough traffic and enough patience to mean something. A rollout that goes from one per cent to one hundred in a day was theatre, not a rollout.
Watch the paired comparison during each stage, cohort against control, and be suspicious of flattering numbers. A falling correction rate can mean the new version is better, or that users trust it more and check it less. Automation bias is real, and it improves your metrics for the wrong reason. Pair the dashboards with a small, sampled human audit of actual outputs before declaring victory at each stage.
Rollback readiness is the quiet requirement underneath all of this. The previous version, model pinned, prompt versioned, parameters recorded, must stay deployable for the whole rollout, so that reverting is a flag flip, not an archaeology project. If rolling back means reconstructing what the old prompt said from someone's memory of a dashboard, you do not have a rollback plan; you have an intention.
An honest caveat: all this machinery slows shipping, and the cost should be proportionate to blast radius. A drafting assistant whose every output a human reviews does not need shadow mode. A system that sends invoices or replies to customers on its own absolutely does. The minimum for anything in production is an eval gate and a kill switch; the full ladder is for features that act. Choosing the right rung is itself an engineering decision, one of the first judgement calls I work through with the teams I lead, and skipping the choice is how teams end up with either paralysis or incidents.
Taking AI features through this safely, evals, flags, shadow, staged rollout, is the work I do. If your prompt changes currently go straight to production on a Friday afternoon, get in touch via the contact form.
Senior engineering roles — or production AI consulting?
I'm open to senior AI and software engineering roles and to selective consulting on agents, RAG, and LLM automation in production. If this post resonates — as a hiring manager or as someone shipping similar work — get in touch.
Get in touch