Hacker

Punyansh Singla

@punyanshsingla

Joined Oct 2026Student at SchoolIndia

Elsewhere

Projects

  • FlagGuard — Autonomous Canary Auto-Rollback for Self-Hosted Flagsmith

    Flagsmith Experimentation HackathonNov 2026

    What I Built & The Problem It Solves: FlagGuard is an open-source, drop-in canary protection and auto-rollback sidecar for self-hosted Flagsmith. While self-hosted Flagsmith provides feature flags, remote configuration, and webhooks, it has no automated runtime safety loop. If someone enables a buggy flag or pushes a bad config value in production and 5xx errors or latency spike at 2 AM, Flagsmith stays silent until a human manually investigates and rolls it back. FlagGuard closes that loop automatically by correlating live application telemetry with Flagsmith webhooks, scoring recent flag mutations by blame confidence, reverting the offending flag back to its exact prior state via the Flagsmith Management API, locking a cooldown window to prevent flapping, and generating a formatted Incident Report with one-click postmortem export. Who Would Use It: DevOps and SRE teams, backend engineers, and startups self-hosting open-source Flagsmith who want automated canary rollbacks and instant root-cause flag correlation without enterprise SaaS lock-in. How It Works: 1. One-Command Self-Hosted Stack: Running docker compose up --build boots open-source Flagsmith (API, database migrations, and background task processor) with PostgreSQL, an idempotent auto-bootstrapper that provisions the project, flags, server-side SDK key, and webhooks, FlagGuard itself, and a Demo Storefront powered by @flagsmith/nodejs local evaluation. 2. HMAC-Verified Flagsmith Webhooks & Snapshots: FlagGuard verifies X-Flagsmith-Signature (HMAC-SHA256) on FLAG_UPDATED and AUDIT_LOG_CREATED webhooks while syncing Flagsmith featurestates to maintain exact before/after flag snapshots. 3. Flexible Telemetry Collectors: Scrapes JSON or Prometheus /metrics endpoints (including histogram p95 latency estimation), or accepts live request events via a lightweight Express middleware. 4. Blame Scoring & Autonomous Rollback: When error rate or p95 latency breaches the thresholds configured in flagguard.yaml (with minimum sample and protected-flag safeguards), FlagGuard ranks recent Flagsmith mutations (0-100) by temporal proximity, mutation risk, and recency. In enforce mode (with a dry-run option for shadow testing), it sends a PATCH rollback to Flagsmith's Management API, suppresses its own webhook echo, activates an anti-flap cooldown, and updates the live SSE War-Room UI (featuring Split Storefront view, Light/Dark themes, and formatted Incident Reports).