Feature Flags

What are Feature Flags?

Feature flags are switches in code that turn functionality on or off at runtime without deploying new code, letting teams separate deployment from release, roll out changes gradually and disable problems quickly.

Updated November 2026 · 5 min read


Traditionally, deploying code and releasing a feature were the same event. If the code reached production, users saw it, so teams held finished work back until everything was ready and tested together, then released it all at once and hoped for the best. Feature flags break that link. A flag wraps new functionality in a condition that can be switched on or off while the software is running. Code can be deployed to production in a dormant state, turned on for internal users, then for a small share of customers, then for everyone, and switched off instantly if something goes wrong. The decision about who sees a feature moves from deployment time to run time, where it can be changed in seconds.

Feature flags, also called feature toggles, have been used at large web companies for many years. Pete Hodgson's article on feature toggles, published on Martin Fowler's website in 2016, described the main types and the discipline needed to manage them. Today, flags are often managed through dedicated platforms that let product and engineering teams control releases without code changes. For developers, product managers and release managers, feature flags make frequent deployment safe and give the business direct control over when users see new features.

Definition of Feature Flags

Feature flags are conditional controls in software, managed through configuration or a flag management service, that determine at runtime whether a feature or code path is active for a given user, group or environment, without requiring a new deployment.

They make trunk-based development practical, enable gradual rollouts such as canary deployment and support continuous delivery by separating deployment from release.

Types of Feature Flags

Release flags hide unfinished or untested features in production until they are ready. They should be short-lived and removed once the feature is fully released.

Experiment flags show different versions of a feature to different groups of users to measure which performs better, as in A/B testing.

Operational flags let teams turn off expensive or risky functionality during incidents or heavy load. A kill switch is a common example.

Permission flags enable features for specific customers, plans or user groups, such as beta programs or premium tiers, and may last a long time. Knowing which type a flag is matters, because it determines how long the flag should live and who is allowed to change it.

How Flags Are Targeted

Flags can be turned on for everyone, no one or specific groups, such as internal staff, beta customers or users in one region.

Percentage rollouts expose a feature to a growing share of users, such as 1%, then 10%, then 100%.

Targeting rules are evaluated at runtime, so changes take effect within seconds without a deployment. Flag values are usually cached by the application, so the flag service being slow or unavailable does not stop the application from working.

Importance of Feature Flags in Delivery and Engineering Operations

Feature flags reduce release risk. Problems can be contained by turning a flag off in seconds instead of rolling back a deployment.

They enable frequent deployment. Unfinished work can be merged and deployed safely, so teams no longer need long-lived branches or large batch releases.

They also give the business control over timing. Product and marketing teams can launch features when it suits customers and campaigns, independent of engineering deployment schedules. Flags also support learning. Experiment flags let teams measure how a change affects user behavior before committing to it fully.

Feature Flags and Financial Management

Turning off a failing feature quickly limits lost revenue and incident costs.

Experiment flags let teams measure the business impact of features before full rollout, avoiding investment in changes that do not perform.

Operational flags can switch off costly functionality, such as heavy AI or data processing features, when budgets or capacity are under pressure.

Flag management platforms carry license costs, and old flags add maintenance effort, so both should be managed actively.

Common Challenges

Flags that are never removed accumulate as technical debt, making code harder to read and test. Every release flag needs an owner and a removal date.

Many flags in combination create many possible states, which complicates testing. Teams should test the combinations that matter most.

Flag changes can cause incidents just like code changes, so they need access controls, audit logs and monitoring. Relying on flags to hide incomplete security or data changes is risky, since a misconfigured flag can expose them. Some changes should not be deployed until they are ready.

How to Use Feature Flags

Using feature flags well involves choosing a management approach, defining flag types and naming conventions, rolling out gradually, monitoring results and removing flags when they are no longer needed.

Treat flags as part of the delivery process, with the same care given to code and deployments.

Setting Up Flags

Choose a flag management service or a well-designed in-house system that supports targeting, audit logs and fast changes.

Define which types of flags the organization uses and how long each type should live.

Give every flag a clear name, an owner and a planned removal date when it is created. Decide who may change each type of flag in each environment, so production changes are controlled and recorded.

Rolling Out and Cleaning Up

Release new features to internal users first, then to a small percentage of customers, increasing exposure while watching error rates and business metrics.

Connect flags to monitoring and incident management processes, so on-call engineers know which flags can be turned off safely.

Review flags regularly and remove release flags within weeks of full rollout. Track the number of active flags and their age, and treat a growing count of old release flags as a warning sign.

Examples of Feature Flags in Practice

The examples below show feature flags in practice.

Both use illustrative figures. The first contains a failed release, and the second runs a pricing experiment.

In each, flags gave the team control without a new deployment.

Containing a Failed Release

An online travel company releases a new search feature to 10% of users using a percentage rollout.

Error rates for that group rise sharply within 20 minutes, and the on-call engineer turns the flag off.

Only a small share of users is affected for a short time, and the team fixes the problem and resumes the rollout the next day. No emergency deployment is needed, and the rest of the release, deployed in the same build, stays live throughout.

Running a Pricing Experiment

A SaaS company wants to test a new onboarding flow but is unsure whether it will improve conversion.

It uses an experiment flag to show the new flow to half of new sign-ups for four weeks.

Conversion to paid plans rises by 6% in the test group, and the company rolls out the new flow to everyone and removes the flag.

Conclusion

Feature flags are runtime switches that turn functionality on or off without deploying code. Common types include release, experiment, operational and permission flags, and they can be targeted to specific users or rolled out by percentage.

In delivery and engineering operations, feature flags reduce release risk, enable frequent deployment and give the business control over launch timing. Choosing a management approach, defining flag types, rolling out gradually, monitoring results, controlling access and removing old flags help teams get the benefits without the clutter.