Feature Flags
Runtime controls that change product behavior for selected contexts, allowing teams to separate code deployment from user-facing release decisions.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/feature-flags/
01What it means
Feature flags, also called feature toggles, route users or requests between code paths according to configuration and context. A flag can hide incomplete work, progressively expose a release, support an experiment, grant a permission, or disable risky behavior. The control is evaluated without requiring a new deployment for every change.[1][2]
- OffSafe default path
- InternalStaff or test cohort
- ProgressiveSelected users or percentage
- BroadMonitor product and technical outcomes
- RemoveKeep winner; delete flag and dead path
Disable quickly when monitored risk exceeds guardrails
Flags need a safe default, owner, audit trail, fallback behavior, and removal date to avoid permanent branching debt.
02Why it matters
Separating deployment from release reduces the pressure of all-or-nothing launches. Teams can integrate code earlier, expose changes to a small audience, observe operational and product signals, and stop a rollout quickly. Flags also let product and engineering coordinate release timing without maintaining long-lived branches.
03When to use it
Use flags for progressive delivery, short-lived release control, experiments, operational kill switches, or entitlement rules. Choose the simplest mechanism that meets the risk. A permanent business rule may deserve an explicit policy or permissions system rather than an ambiguously named boolean toggle.
04How it works
- Define the flag’s purpose, owner, safe default, target population, and intended removal date.
- Place the decision at a well-understood boundary and preserve secure server-side enforcement where needed.
- Test important enabled, disabled, fallback, and interaction states.
- Release gradually using cohorts or percentages while monitoring technical and product outcomes.
- Provide fast rollback and audit changes to sensitive flag configuration.
- Remove temporary flags and dead code promptly after the decision is complete.
05A practical example
A marketplace deploys a redesigned checkout behind a release flag. Employees use it first, then one percent of eligible buyers. The team watches payment errors, latency, completion, and support contacts. It pauses exposure after a regional tax issue, fixes it, and resumes without reverting unrelated code.
06Where it breaks
Every flag adds states that can interact and become difficult to test. Client-visible flags may leak upcoming features or be manipulated, and a remote flag service can become a dependency. Stale toggles create code complexity, so ownership and cleanup are essential rather than optional housekeeping.
Common mistakes
- Creating flags without an owner, expiry condition, or cleanup task.
- Assuming a client-side flag provides authorization or protects confidential code.
- Rolling out without monitoring guardrails or a tested fallback.
- Allowing many overlapping flags to create untestable combinations.
07Sources
- Feature Toggles (aka Feature Flags)Martin Fowler · Foundational technical articleFeature Toggles (aka Feature Flags)
- OpenFeature SpecificationOpenFeature · Open standard specificationOpenFeature Specification