Feature flags for changes
Wrap new behavior in a flag. Ship code disabled. Enable for 1% → 10% → 50% → 100%.
Advertisement
Kill switch
if (featureFlags.isEnabled("new_prompt_v2", ctx.userId())) {
return newPrompt();
}
return oldPrompt(); // fallbackAdvertisement
Auto-rollback
Set thresholds. Error rate >X → auto-disable flag. Manual intervention optional but not required.