Hacker
Niranjan Kumar
@niranjan5601
Elsewhere
Projects
Flag Guardian: health-gated rollouts and automatic rollback for self-hosted Flagsmith
Flagsmith Experimentation HackathonNov 2026
Feature flags make a release reversible, but only if someone notices it's broken and flips the flag. At a 5% rollout, a checkout failing for 15% of its users moves the overall error rate by less than one percentage point, so the bug hides, and the rollback waits for a human. Flag Guardian is an open-source controller that sits next to a self-hosted Flagsmith and does that job automatically: Health-gated rollouts: it rolls a flag out in steps (5% → 25% → 50% → 100%) using a Flagsmith percentage-split segment, and each step has to stay healthy for its whole interval before the next one. Automatic rollback: every few seconds it runs guard queries (error rate, p95 latency) against Prometheus, looking only at users on the new version. If a guard fails on two checks in a row, it turns the flag off and alerts Discord or Slack. In the demo, the flag was off 16 seconds after a bug went live on a fresh install. Safe by default: no data or too little traffic means it holds instead of guessing. If a person changes the flag in Flagsmith (caught via Flagsmith's signed webhook), Guardian stops automating and watches the guards instead of fighting them. Rollouts as code: the plan lives in flags.yaml in the repo. A GitHub Action reviews every pull request that changes it and posts what the change does to each rollout ("first step 5% → 50%: riskier"). It works offline, so CI never holds Flagsmith keys. Who it's for: teams who self-host Flagsmith and want progressive delivery with an automatic safety net, without buying a separate platform. Platform and SRE teams get a reviewable, auditable rollout plan; developers get to ship behind a flag without watching dashboards all night. It also ships a live UI, a CLI, and a provisioned Grafana dashboard where Guardian's decisions and Flagsmith's own flag changes appear as markers on the same charts.