Hacker
Stuart Yu
@stuartyo
Elsewhere
Projects
Experiment Gatekeeper
Flagsmith Experimentation HackathonNov 2026
A CLI, MCP server and console that stop a coding agent from starting a broken Flagsmith experiment, starting one nobody approved, or shipping a winner the data doesn't support. Agents can now set up a Flagsmith A/B test from one prompt. Gatekeeper sits between the agent and Flagsmith Experimentation. Preflight reads the app's code and the live Flagsmith setup for nine mistakes that make Flagsmith record wrong or zero data (events off, a new visitor ID per request, mixed identifiers, events sent to Cloud from a self-hosted setup, and more). The sample size and decision rule are fixed before any data exists. Starting and rolling out need a person: the MCP server has no approve tool, `gk approve` needs an interactive terminal, and approvals are signed and tied to a fingerprint of the live Flagsmith setup. The verdict reads Flagsmith's results under the pre-registered rule and answers ship, drop, keep running or invalid. Tested end to end on self-hosted Flagsmith 2.295.2 with simulated visitors. In one run, a slow control page skewed the split to 42/58. Flagsmith's results page showed a 100% chance to win and no SRM result, because its built-in check is skipped when variations are added with weight 0, as the official setup prompt does. Gatekeeper marked the data invalid (p = 3.4e-19). On 22 test apps with 23 planted bugs, a fresh Claude agent with Flagsmith's official prompt found 19; Gatekeeper's preflight found 23, with no false alarms on 5 clean apps. We wrote that test set ourselves. Built with: Python, Typer, httpx, MCP Python SDK, Flagsmith (self-hosted), PostgreSQL, vanilla HTML/CSS/JS.