Shaf Lab

Feature flags

Runtime switches that turn features on or off without a full deploy.

Feature flags are runtime switches that turn a behavior on or off without a full deploy. You can release the code dark, enable it for your team, roll it out to a percentage of users, and shut it off if it misbehaves. They are one of the simplest ways to reduce the risk of shipping, especially when agents are writing some of the code.

Keep the flag list short and name each flag after the behavior it controls. A flag should have an owner and a planned time to die. Flags that linger become a second, unofficial configuration language, and nobody knows which combination is the real product.

Evaluate flags close to the edge of the request so you do not have to redeploy to change a rollout. Log the flag state with the request, otherwise a bug report cannot be reproduced. For agent-written changes, a flag is a good default wrapper around anything that is not a pure refactor.

If the change is a trivial fix and you can revert with a forward deploy in minutes, you may not need a flag. Use them where a bad rollout would be hard to undo, or where you want a staged release.