practiceDelivery & agility

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)

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]

Runtime path selection One deployed codebase can expose different behavior by context
  1. OffSafe default path
  2. InternalStaff or test cohort
  3. ProgressiveSelected users or percentage
  4. BroadMonitor product and technical outcomes
  5. 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

  1. Define the flag’s purpose, owner, safe default, target population, and intended removal date.
  2. Place the decision at a well-understood boundary and preserve secure server-side enforcement where needed.
  3. Test important enabled, disabled, fallback, and interaction states.
  4. Release gradually using cohorts or percentages while monitoring technical and product outcomes.
  5. Provide fast rollback and audit changes to sensitive flag configuration.
  6. Remove temporary flags and dead code promptly after the decision is complete.

05A practical example

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

  1. Feature Toggles (aka Feature Flags)Martin Fowler · Foundational technical articleFeature Toggles (aka Feature Flags)
  2. OpenFeature SpecificationOpenFeature · Open standard specificationOpenFeature Specification
View saved topics

Start typing to search titles, definitions, categories, and frameworks.