FLAGAGENT
Toggle Wars · Track 02 — AI agents and feature flags
MOCK — demo project

A FLAG AGENT WITH A HUMAN GATE

FlagAgent — change a production flag in one sentence.
Nothing applies until you say yes.

FlagAgent works a Flagsmith project from plain words. Describe the change — a rollout, a test, a kill switch standing guard — and it plans the flag changes, shows you the exact diffs, and applies only what you approve. Then it reads everything back and shows you the proof.

Work a change

Running on a labelled demo project until a real Flagsmith key is connected. The board on the right is live — try its switches.

SIGNAL BOARDPRODUCTION

Real switches. Flip one and the board below keeps up.

A 3D picture of the idea — drag to spin. The live signal board still runs the demo project. Why flags need a gate ↓

THE PROBLEM

Flag changes are easy to make and hard to review.

The dashboard sprawl

One rollout touches flags, environments, segments and splits across half a dozen screens. Each screen is a chance to change the wrong thing in the wrong place.

Agents with write access

Give an agent an API key and it can move every switch you own, silently, at machine speed. One misread sentence becomes a production incident.

No receipt

After a change lands, proving what actually changed — and that it matches what was asked for — means digging through audit logs by hand.

HOW FLAGAGENT WORKS

Plan first. Approve second. Apply last.

01

It plans, read-only

Your sentence becomes a list of exact changes — flag, environment, before and after — checked against the traps: variant weights that do not add to 100, a flag name already taken, a guard already broken.

02

You approve, change by change

Every change is its own line with its own tick box. Reject one and it never happens. A delete needs the flag's name typed out. The plan carries a short hash, so what you approved is what runs — or nothing runs.

03

It applies, then proves it

Approved changes go to Flagsmith in order. Each one is read back and compared with the plan before it is called done. Guards are checked again at the moment of applying — if a guard broke while you were reading, everything stops.

The gate is the product. Planning never writes. Applying needs your ticks, your typed name for a delete, a matching plan hash and holding guards — all four, every time.

THE CONSOLE

Work a flag change

Project: ChaiKart — storefront (demo project) · Source: local demo board (MOCK)

  1. 1Say it
  2. 2See the diff
  3. 3Approve
  4. 4Receipt
Try:

The board — Production

FlagStateRolloutValue / variantsSegment overrides

Session log

    OUTCOME SO FAR

    Built to be checked, not trusted.

    29

    automated checks pass on the planner, the executor and the board — including guard refusals and tampered-plan refusals.

    0

    changes can be applied without approval. Planning is read-only by construction, not by promise.

    4

    conditions on every apply: your ticks, a typed name for deletes, a matching plan hash, and guards still holding.

    100%

    of applied changes are read back and compared with the plan before the receipt calls them done.

    ONE CHANGE, WALKED

    The gate, doing its job — once through, then once stopped.

    The console with the guarded rollout sentence filled in on the demo project
    1 · The request. One sentence: release the new checkout to 10% of users in production — only if the payments kill switch stays off. No dashboard, no toggles to hunt for.
    The plan: the guard line holding, and the two exact changes with before and after values
    2 · The plan. Planning writes nothing. It reads the project and answers with two exact changes — new_checkout OFF → ON, rollout 0% → 10% — the guard line showing "holding", and a plan hash (#403e8fe0) that locks what was read.
    The approval gate: two changes, the rollout change unticked by the human
    3 · The gate. Every change is its own line with its own tick box. Here the human approves the switch-on and unticks the rollout. What is not ticked does not happen — that is the whole product.
    The receipt: one approved change applied and read back; the unapproved change named as not applied
    4 · The receipt. One of one approved changes applied and read back from the project itself. The unticked rollout is named on the receipt as not applied — the proof covers what did not happen, too.
    The refusal: the guard broke before applying, so the apply is refused and nothing is written
    5 · The refusal. Same sentence, planned again — then the kill switch is flipped on before applying. The guard is checked again at apply time: "Guard broken at apply time… Nothing was applied." Zero writes, and the board still shows new_checkout OFF.

    How this walk was made: driven on this page's own demo project (MOCK) on a local copy of this exact build, 2 Dec 2026. The plan, the ticks, the apply and the refusal are the shipped code running; no Flagsmith account was touched. The scored run against a real Flagsmith project is in Results, counted — next.

    RESULTS, COUNTED

    FlagBench-20: twenty fixed sentences, two honest runs.

    The scored run — live project

    16/20 plans · 11/20 fully passing · 5/5 traps · 0 unapproved writes

    26 Nov 2026, worked case by case through this page against a real Flagsmith project ("My first project", three environments). Every applied change was read back; the project was restored to its starting state afterwards. This is the run the Toggle Wars filing used.

    The rehearsal — demo project

    20/20 plans · 20/20 passing · 5/5 traps · 0 unapproved writes

    Re-run 2 Dec 2026 with the repo's own runner (node bench/run_bench.js) on the demo project. A rehearsal, not the score: the runner drives the demo project by design, because the real key never enters a script. It proves the gate and the planner still hold, end to end.

    The unit checks

    51/51 checks pass

    Re-run 2 Dec 2026: planner 20, adapter 9, adapter write path 9, adapter versions 9, adapter live URLs 4 — including guard refusals, tampered-plan refusals, and "approving nothing applies nothing".

    Where the live run lost its nine cases — named, not rounded away. Six cases turn on partial rollouts (10%, 25%, 40%, 50%): a Flagsmith v1 boolean feature state has no percentage field, so those starting states cannot exist on a real project, and the rollout change is refused at apply time with the reason on the receipt. One case needs a segment override and one a flag deletion — neither is wired for the live API yet; both were refused at apply, nothing written. One case's final check needs Production search_v2 sitting at a 25% rollout, which cannot exist live. In every miss, the failure was a refusal or a wrong plan — never a wrong write.

    HONEST LIMITS

    What this does not claim.

    The demo project is a stand-in

    This page runs a labelled MOCK project until a real Flagsmith key is connected. The walk above is that demo project. Its flags mirror the real project's shape; they are not a real account.

    The scored run was worked by hand

    The 16/20 live score was produced case by case through this page in a browser, not by an automated runner — the runner only ever drives the demo project. The per-case record is in the repo (bench/RESULTS_LIVE.md).

    Approval is a person's step

    Nothing in the code can tick its own boxes, type the delete name, or pass its own plan hash. If nobody approves, nothing applies. The gate is a human decision the software refuses to route around.

    Two change kinds stop at the gate

    Segment overrides and flag deletion are planned but not wired for the live Flagsmith API yet. Live, both are refused at apply time with the reason shown; on the demo project they run, which is one reason the rehearsal scores higher than the live run.

    The key stays in this page

    A connected Organisation API key lives only in this page's memory — never stored, logged or sent anywhere except the Flagsmith API. The trade-off is real: refresh the page and the connection is gone.

    The 3D hero is a picture

    The switches in the 3D scene at the top flip on their own rhythm; they do not read the project's flag state. The signal board beside it is the live surface. The picture is there to explain the gate, not to report it.

    THE JUDGE'S PATH

    Five steps, no account, nothing to install.

    1. Click the "Guarded rollout" chip in the console above. The demo sentence fills in — the same sentence as the walk.
    2. Press "Plan it". Read the guard line ("holding"), the two diffs, and the plan hash. Nothing has been written.
    3. Untick the rollout change, then press "Apply approved changes". The receipt shows one change applied and read back — and names the change that was not approved.
    4. Plan the sentence again — the plan is smaller now, because the first change already landed. Flip the payments kill switch ON on the signal board at the top of the page, then press apply: the apply is refused and nothing is written.
    5. Try "Delete flag legacy_search". The apply stays disabled until the flag's name is typed out. That pause is deliberate.

    The whole path runs on the labelled demo project in this page. Connecting a real Flagsmith project is optional and needs an Organisation API key — see KEY_HOOKUP.md in the repo.