What is a feature flag?
How a team ships code on Tuesday and turns the feature on for customers on Thursday, or off again in seconds.
In short
A feature flag is a switch in an application's configuration that turns a feature on or off, for everyone or for chosen users, without deploying new code. Teams use feature flags to release gradually, test with a few customers first, and switch off a misbehaving feature in seconds instead of rolling back a whole release.
Also called: Feature toggle, Kill switch, Feature switch
Why it matters when your prototype goes to production
Without flags, every release is all or nothing: a feature is live for everyone the moment it deploys, and the only way to stop it is another deploy. Flags separate the two decisions, shipping code and exposing it, which makes releases smaller and incidents shorter.
The four kinds
Pete Hodgson's widely cited article sorts flags into four categories: release flags for unfinished work, experiment flags for A/B tests, ops flags such as kill switches, and permissioning flags that give features to some users only.
An ops flag in practice: every AI call in Bell passes an off switch first, and its spending limits can be tuned without a release.
How they go wrong
Flags are code paths, so each one doubles what can be tested. Give each flag an owner and a removal date, and delete release flags once the feature is fully on.
Common questions
Do I need a feature flag service?
Not at first. A few flags in configuration or the database are enough. A service helps once you target segments or run experiments.
What is a kill switch?
An ops flag that turns a feature or an integration off instantly, used when it misbehaves in production.
Related terms
Read next
Sources
More on this: Production architecture & security · All glossary terms
Built something in Lovable you want people to rely on?
We are the engineers who take it the rest of the way — secured, tested, released and supported.