{"head":{"title":"What Is a Feature Flag? Definition and Example | OceanLab","description":"A feature flag turns a feature on or off for chosen users without a new deploy. How flags separate deploy from release, an example and common mistakes.","canonical":"https://oceanlab.in/glossary/feature-flag"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"feature flag","path":"/glossary/feature-flag"}],"slug":"feature-flag","term":"Feature flag","aka":["feature toggle","feature switch"],"category":"Hosting and delivery","short":"A switch in the code that turns a feature on or off for chosen users at runtime, without deploying new code.","body":[["The code for a new feature ships to production hidden behind a flag. A flag service or config then decides who sees it: nobody, staff only, one customer, ten percent of users or everyone. Turning it off is instant."],["Flags separate deploying code from releasing a feature. They power ",{"href":"/glossary/canary-release","text":"canary releases"},", ",{"href":"/glossary/ab-test","text":"A/B tests"},", beta programmes and kill switches for risky parts of a system."]],"why":["Flags let teams merge and ship small changes every day, even when a feature is not finished, and let product teams choose release timing. A kill switch turns an incident into a click rather than an emergency deploy."],"example":["A B2B tool builds a new reporting page over three sprints behind a flag. Two pilot customers get it first, give feedback and the team fixes issues before turning it on for everyone. When an export bug appears, the export part is switched off within a minute."],"inBuild":["We evaluate flags on the server for anything that affects security or data, give each flag an owner and a removal date, and log flag changes in the ",{"href":"/glossary/audit-log","text":"audit log"},". Old flags are deleted once a feature is fully released."],"mistakes":[["Never removing flags, until the code is full of dead branches."],["Hiding a feature only in the front end while the API still serves it."],["Testing only the flag-on path, so turning it off breaks something."]],"related":[{"href":"/glossary/canary-release","label":"Canary release","detail":"A release method that sends a small share of users to a new version first, watches for problems, and widens the rollout step by step."},{"href":"/glossary/ab-test","label":"A/B test","detail":"An experiment that shows two versions of something to random groups of users and measures which one does better on a chosen metric."},{"href":"/glossary/blue-green-deployment","label":"Blue-green deployment","detail":"A release method that runs two identical production environments and switches all traffic from the old one to the new one in one step."},{"href":"/glossary/ci-cd","label":"CI/CD (continuous integration and delivery)","detail":"An automated pipeline that builds and tests every code change (CI) and then releases it to users in a repeatable way (CD)."},{"href":"/glossary/technical-debt","label":"Technical debt","detail":"The future cost of shortcuts taken in code today."}],"tools":[],"links":[{"href":"/software","label":"Software by industry","detail":"Systems we build per industry, with guides and tools."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}