AI-native
How do you roll out a new AI model or prompt safely?
Put the change behind its own feature flag, with the old model or prompt as the off path. Turn it on for your own team first, then a few named customers, then widen by a sticky percentage, and keep a kill switch that turns it off for everyone in seconds without a deploy. A new model, prompt or tool changes how a product behaves as much as new code does, and it's harder to test before release.
Updated November 19, 2026
Why does an AI feature need a flag?
Tests can't tell you everything about a new model or prompt. It may answer most questions better and a few much worse, or call a tool in a way nobody expected. You find out from real use, so the safe question isn't "is it ready?" but "how fast can we turn it off?" A flag answers that: the new behaviour runs for the people you choose, and the old behaviour is one switch away. Flagger.gg's guide to feature flags for AI agents treats this as half of what the phrase means, next to flagging the code coding agents write. See what a feature flag is.
What should each flag wrap?
One behaviour change per flag: the new model, the new prompt version or the new tool, each in its own check, so you can turn off one without rolling back the others. The off path should be the old model, the old prompt or no tool at all. The check runs in your app with no network call:
// Node
if (flagger.flag("support_agent_refunds", ctx)) {
tools.push(refundTool);
}
// Go
if client.Enabled("support_agent_refunds", sub) {
tools = append(tools, refundTool)
}In Flagger.gg, an unknown flag, or one checked before the rules have loaded, is off, so a failure falls back to the old behaviour rather than the new one.
In what order should you turn it on?
- Your own team. The admins state turns it on only for your admins, who try it on real work.
- Named users or workspaces. Targets add a few friendly customers who agreed to try it.
- A sticky percentage. Widen from, say, 5% to 25% to everyone. Each user keeps the same answer as the percentage grows, so you compare like with like and nobody flips between models.
- Everyone, then remove the flag and the old path once it has been stable for a while; see cleaning up stale flags.
For how to pick the steps and what to watch at each, see how to plan a percentage rollout.
What do you do when the new model misbehaves?
Kill the flag. If the new behaviour gives bad answers or calls a tool it shouldn't, flagger kill, the flag_kill MCP tool or the console turns it off for everyone, and the SDKs get the change within a second. Kill is exempt from per-agent rate limits, so it is never blocked when you need it. That's faster than a rollback, which needs a build and a deploy; see kill switch or rollback and how to stop an AI agent that's going wrong.
Rollouts tied to metrics that pause or roll back on their own are listed as in development on Flagger.gg. Today a person, or an agent watching your checks, does the kill.
Can an AI agent run the rollout?
Yes, with limits. In Flagger.gg each agent gets its own token for one project, chosen environments and chosen actions, and every agent write needs a note saying why. By default a project runs in auto-live mode, where an agent's changes apply at once. Turn approvals on and agents in production can roll out only up to a cap, 10% by default, and turning a flag on for everyone becomes a request a person approves; agents have no approve tool. Flags for payments or sign-in can be marked protected, so agents can only kill them. See adding human approval to AI agent actions.
Frequently asked questions
Should a new prompt get its own feature flag?
Yes. One flag per behaviour change, whether it's a model, a prompt version or a tool, so you can turn off one without undoing the others.
What should the off path be for an AI feature flag?
The old model or prompt, or no tool at all. In Flagger.gg an unknown flag, or one checked before rules load, is off, so failures fall back to the old behaviour.
How fast can you turn off a bad AI feature?
With a kill switch, within about a second: Flagger.gg's SDKs get a kill within a second, with no build or deploy.
Can Flagger.gg roll back a model automatically when metrics drop?
Not yet. Metric-tied rollouts are listed as in development; today a person or an agent watching your checks does the kill.