Skip to content

What is a feature flag?

A feature flag controls which software features are active, including per user group, so that turning one on or off does not always require a new deployment.

A feature flag is a software switch that determines whether a feature is active or which version is used. The program reads the flag's value and selects the corresponding behavior. When configuration can change while the application is running, a team can deploy the code to the production environment customers use and enable the feature later without redeploying. The value can also depend on context, such as a user's identity or group. Together, these let a team start with a few users and turn a feature off if problems arise. All of this depends on the system's design, though: a hard-coded flag does not offer the same flexibility as editable configuration. Nor does turning a feature off automatically undo completed transactions or data already written. Before adopting flags, an organization needs to decide who can change their values, what the fallback behavior should be on error, and when each switch should be removed.

See also: Technical debtTechnical debt is the potential future cost of expedient software decisions that can make later changes more difficult, expensive, or even impossible.

The toggle taxonomy and the deploy/release split

Deployment puts code into production; release determines when users get the feature. A configurable flag can decouple the two. Pete Hodgson's classification distinguishes release, experiment, operational, and permission flags. Release flags hide changes not yet available to users; operational flags can turn off a problematic feature. Experiment flags assign variants, but an A/B test also requires an experimental design. A canary release, a limited first exposure, is a release strategy that can use a flag; the terms are not synonyms.

OpenFeature, an open specification, describes the context used to determine a flag's value, including identifiers and other attributes. Some systems require an identifier to assign a value to a percentage of users; making sure one is present avoids unpredictable results. The evaluation specification requires a default value and specifies that it be returned on error. The right default depends on the feature: for a new payment flow, falling back to the existing path may be safer.

An enterprise example

A bank wants to launch a new payment module. In this hypothetical scenario it deploys the code with the feature disabled for customers and enables it first for staff assigned to testing. After reviewing results and issue reports, it extends access to a limited group. If errors increase, an authorized person switches the flag back to the previous path and reviews transactions already in progress. The plan also needs to cover what happens if the system supplying configuration does not respond: depending on the tool, the last known value persists or the default applies, and the team must verify that behavior in testing rather than rely on what the documentation says.

Why it matters for decision makers

When choosing a tool, look at controls over who changes flags, an audit trail of changes, behavior during failures, and the ability to export configuration and rules. OpenFeature defines a common interface and the provider contract for connecting to a flag management system, but on its own it does not guarantee that rules and data are portable. Temporary flags need an owner and exit criteria, or they add to technical debt. In a study of 12 open-source Python projects, 75% of the toggle components analyzed were removed within 49 weeks of being introduced, though the sample cannot justify a universal deadline.

Frequently asked questions

It can disable a feature, but it does not automatically undo completed transactions or data already written. Those need a separate plan.

A temporary flag can be removed once the feature is stable and the alternative path is no longer needed. Some operational flags, such as kill switches, can stay in place for years, and so can permission flags.
  • Technical debtTechnical debt is the potential future cost of expedient software decisions that can make later changes more difficult, expensive, or even impossible.
  • CI/CDContinuous Integration and Continuous Delivery: every software change is tested and shipped to production automatically and frequently.
  • Canary releaseA deploy strategy that exposes the new version to a small slice of real traffic before it reaches 100%.
  • A/B testAn A/B test compares two versions, each shown to a randomly assigned group of users, to estimate how a change affects a measurable outcome chosen in advance.

See it in the universe

If it reminds you of a system nobody dares touch anymore, that is what I put back in order.

See Software Rescue

Or write to me.