Prompt
How do I turn a feature off instantly if production breaks?
Latest observation
Oct 20, 2026
OpenAI APIWeb search: off
Use a feature flag / kill switch.
Best practice
Wrap the risky feature in a flag that can be changed without redeploying:
- Off by default
- Controlled from a remote config service / admin panel / environment-backed config
- Cached briefly for performance, but with fast refresh
- Ideally supports instant global disable
Simple pattern
if (featureFlags.newCheckoutEnabled) {
renderNewCheckout();
} else {
renderOldCheckout();
}
If production breaks, flip newCheckoutEnabled to false in your flag system and the old path is used immediately.
For truly urgent incidents
Have a dedicated kill switch flag separate from normal rollout flags:
disablePaymentsdisableRecommendationEnginedisableNewSearch
That lets you shut off just the broken subsystem.
Important notes
- Don’t rely on a code deploy to disable it.
- Add timeouts, retries, and fallbacks so the flag isn’t your only safety net.
- Test the off path before launch.
- Make sure your flag system is reachable even when parts of production are degraded.
If you need a very fast emergency fallback
You can also:
- route traffic away via load balancer / gateway
- disable a specific API route
- return a safe default response
- turn off background jobs or consumers
If you want, I can show you a production-ready kill switch design for your stack (Node, Python, Java, Kubernetes, LaunchDarkly, etc.).
Brands