Feature flags are conditional switches in code that enable or disable functionality at runtime without deploying new code, decoupling deployment from feature release.
Feature flags are conditional switches in code that enable or disable functionality at runtime without deploying new code, decoupling deployment from feature release. Also called feature toggles or feature switches, they allow teams to merge incomplete features to main branch behind a flag, gradually roll out changes to user segments, and instantly kill problematic features without rollback. LaunchDarkly, Unleash, and Statsig are popular feature flag management platforms.
Feature flags wrap new functionality in conditional checks that evaluate at runtime. The flag's state — on or off — is determined by a central configuration service that can target specific users, percentages, geographies, or custom attributes.
When code encounters a feature flag check, it queries the flag service (typically with local caching for performance) and executes the appropriate code path. This evaluation happens per-request, enabling real-time changes without redeployment.
Flag management platforms provide dashboards for toggling flags, setting targeting rules, and scheduling activations. They also track flag lifecycle — creation, testing, full rollout, and removal — preventing technical debt from accumulating. SDKs handle evaluation logic client-side with minimal latency overhead, falling back to default values if the flag service is unreachable.
Progressive rollouts use percentage-based flags to gradually increase exposure: 1% for initial validation, 10% for broader testing, then 100% for general availability.
Feature flags reduce deployment risk by separating code shipping from feature activation. Teams can deploy daily while controlling exactly when users see changes. For AI products, flags enable safe model version rollouts — serving a new model to 5% of users, monitoring quality metrics, then expanding if results meet thresholds without any infrastructure changes.
Aaron is an engineering leader, software architect, and founder with 18 years building distributed systems and cloud infrastructure. Now focused on LLM-powered platforms, agent orchestration, and production AI. He shares hands-on technical guides and framework comparisons at fp8.co.