What is a feature flag? Definition and use cases
A feature flag is a switch placed in the code so a team can enable or disable functionality with no new deployment. Its value is read at runtime and can depend on the user, their company, their country or a percentage of traffic. This separates shipping the code to production from releasing the feature to users.
Definition written by Alex Dionisio, Senior Product Manager. Updated November 13, 2026.
Why it matters for a PM
Feature flags put the launch schedule in the PM's hands: open to the internal team first, then a few pilot customers, then everyone. They also act as a kill switch when a feature misbehaves, and they underpin many A/B tests. On the other hand, each flag adds a branch to the code that should be removed once the rollout is done.
Example
A team launches a new search engine in an inventory management tool. The code ships switched off, then is turned on for the internal team, then for 10% of accounts. Complaints about relevance rise, so the PM turns the flag off within seconds while the fix is prepared, with no rollback of the deployment.
Key points
- A flag separates the decision to deploy from the decision to launch.
- Targeting by segment or percentage enables a gradual rollout.
- A kill switch should be tested before you need it.
- Every flag needs an owner and a planned removal date.
Common mistakes
- Letting stale flags pile up and complicate the code and the tests.
- Protecting a sensitive feature only with a browser-side flag that users can bypass.
- Forgetting to measure impact during the gradual rollout.
Go further with Module
The courses and lessons that cover this concept:
Guides on this topic
- Claude Code for Product Managers
What a PM can do with Claude Code, the method and the guardrails, with a starter CLAUDE.md.
- Evaluating an AI feature (evals)
Test cases, criteria, LLM-as-a-judge, release thresholds and monitoring, with an evals plan.