All terms
Glossary · Delivery & Engineering

Feature Flag

A feature flag, also called a feature toggle, is a switch in the code that turns a piece of functionality on or off without deploying new code. Teams use flags to ship unfinished work safely, release a feature to selected users first, run experiments and disable a misbehaving feature in seconds instead of rolling back a release.

How Feature Flags Work

The new code path sits behind a condition. At runtime the application asks a toggle router, often a configuration file or a flag management service, whether the flag is on for this request, user or environment. Changing the flag changes behavior with no new build or deployment.

Pete Hodgson's widely cited article on Martin Fowler's site groups flags into four categories:

  • Release toggles hide incomplete features so code can be merged to the main branch early. They should usually live a week or two.
  • Experiment toggles route users into variants for A/B testing.
  • Ops toggles let operators switch off costly or risky behavior, sometimes as long-lived kill switches.
  • Permissioning toggles give certain users, such as beta testers or premium customers, access to features, and can last for years.

Why Feature Flags Matter

Flags separate deployment (putting code into production) from release (making it available to users). That lets engineering practice continuous integration without exposing half-built work, and it lets product teams choose who sees a feature and when. A rollout to 5% of users, then 25%, then everyone limits the impact of a problem, and an off switch is faster than a hotfix.

Flags have a cost. Each one adds a branch to test and reason about. Hodgson recommends treating flags as inventory with a carrying cost and removing them once they have served their purpose, for example by adding a removal task to the backlog when the flag is created. Forgotten flags become a form of technical debt.

Feature Flag Example

A team building a new checkout flow merges code daily behind a flag called new_checkout, which is off in production. When the flow is ready, they turn it on for internal staff, then for 10% of customers while watching payment errors. Error rates stay flat, so they enable it for everyone. Two weeks later they delete the flag and the old checkout code.

Related terms
Continuous Delivery (CD)
An approach that keeps software always releasable, so any change can reach production safely and quickly on demand.
Release Management
The practice of planning, coordinating and controlling how new or changed software reaches users safely and reliably.
A/B Testing
An online controlled experiment that randomly splits users between two versions and measures which performs better on a chosen metric.
Beta Testing
A pre-release test where real users outside the team use a nearly finished product in their own environment and report issues before launch.
Continuous Integration (CI)
A practice where developers merge code into a shared main branch at least daily, with every merge automatically built and tested.
Guardrail Metric
A metric a team monitors to make sure a change does not cause harm while it improves a goal metric.
Put the method into practice.
Prodstack is the AI product operating system that turns terms like this into shipped, evidence-backed work — from discovery to growth.
Start your 7 days free trial
// Newsletter
Field notes, in your inbox.

Evidence‑driven thinking on discovery, prioritization, specs, and shipping — plus new articles the moment they drop. No noise.