4 min read

A feature flag is a kill switch, not a waiting room

There are two ways to use a feature flag.

The common one is a waiting room. Code ships with the flag off. Someone will turn it on when it feels ready, a few customers first, then more. Often that moment never comes. The feature sits behind its flag for months, working and invisible.

The other way is a kill switch. The feature is ready when it merges. As soon as it’s verified, the flag goes on for everyone. It doesn’t stay to hold the feature back. It stays so you can take it away in seconds if something goes wrong.

I use the second one.

Why a kill switch

Our deploys aren’t fast. Rolling back a bad change means a revert, a build and a deploy. That can take hours. A flag hides whatever exposes the feature - a page, a button or a menu item. That drops rollback to seconds with no deploy at all.

That changes how brave you can be. When turning something off takes seconds, turning it on for everyone stops being a big decision.

So every user-visible feature I ship gets one:

When I turned on a preview feature for our scheduler, every organization in production got it the same day. I checked how it performed for a large customer. I posted where the switch was. Everyone on the team knows how to turn it off.

A flag that stays off isn’t caution - it’s a feature nobody has.

Three traps

A setting is not a kill switch. An organization setting that’s off by default looks like a flag. Once a customer turns it on, only a revert and a deploy can take it away. If you need to pull something back, the switch has to be yours, not theirs.

A large black panel holding a switch labelled their setting, with a cross and a person pointing at it, marked not yours

Don’t hang your feature on someone else’s flag. I once found a feature reusing a flag from a different, older feature. That flag was off for most customers. Our feature was held back by a decision nobody made about it. Give each feature its own switch.

“The flag is off” is not a reason to skip testing. Default-off flags get flipped, often by someone who assumes the code behind them was checked. Verify the flag-on path before it merges, every time. My agents test both sides on their own environments without touching anyone else’s, which needed some setup.

When to remove it

A kill switch is temporary too. When the feature has been on for everyone long enough, you’d never reach for the switch. Delete the flag and the code paths behind it. A flag left around forever becomes a second product you have to keep testing.

A flag planted in a grey mound of leftover code, with a person pulling the pole out of the ground

In short