Prompt
Should I use feature flags in CI/CD or only in production?
Latest observation
Oct 11, 2026
OpenAI APIWeb search: off
Use feature flags in both CI/CD and production, but for different purposes.
In CI/CD
Feature flags are useful to:
- Test unfinished code safely without merging it behind long-lived branches
- Run dark launches and verify behavior in staging or pre-prod
- A/B test or validate migrations before full release
- Enable/disable flaky or risky features during automated pipelines
This helps keep your deployment pipeline moving while reducing merge risk.
In production
Feature flags are especially valuable to:
- Roll out gradually to a small percentage of users
- Kill switch problematic features quickly without redeploying
- Target specific users/segments for beta releases
- Decouple deploy from release so code can ship before exposure
Best practice
Use them as a lifecycle tool:
- Develop/CI: keep incomplete work off by default
- Staging/UAT: enable to validate behavior
- Production: control exposure and rollback safely
- Cleanup: remove flags once they’re no longer needed
Watch out
Avoid letting flags become permanent:
- Too many flags increase complexity
- Old flags can create confusing code paths
- Always have an owner and expiration date
If you want, I can also give you a recommended feature-flag strategy by environment (dev, CI, staging, prod).