0 of 64 agents wired the A/B test.

We pasted Flagsmith's own coding-agent prompt, unchanged, into a small coding model, gpt-5.4-mini, and pointed it at today's Run an Experiment page, 64 times. Not one app measured its test correctly: one identity per visitor, every exposure and sign-up recorded. With a six-item checklist added to the same page, every SDK tab kept: 33 of 50.

Our first experiment, with a shorter task: 1 of 50 from today's page, 2 of 70 from its Node.js part alone, 54 of 54 with the first five checklist items added.

The wiring failures are this model's: two newer small models wired 45 of 51 and 33 of 50 from today's page, and a frontier model 19 of 20 on our shorter task. What held on every model: apps built from today's page fall over when Flagsmith is down, and the checklist fixes that.

Replayed from two runs of the main experiment: 20 scripted visitors each.

run mwv3n76q-134--control

An A/B test of the A/B testing docs

We ran it with the product the docs are for. 1092 runs, every one graded by running the code the agent wrote.

Flagsmith picks the docs.

A flag decides which version of the Run an Experiment page each agent reads. Every run is an identity in Flagsmith, so the split is Flagsmith's own.

The agent writes the code.

A coding agent adds the experiment to a small Express app, alone, in a sandbox with no internet. Here are two agents' answers to the same question: who is this visitor?

Twenty visitors decide.

We run the app and send 20 scripted visitors through it, about half of them signing up. What reached Flagsmith is the outcome, and Flagsmith gives the verdict.

Flagsmith · flag docs_variant

identity   main-mwv3n76q-091
variation  agent_ready
docs       Node.js only, plus the checklist

identity   main-mwv3n76q-134
variation  control
docs       Today's page, every SDK tab

Assigned so far, main experiment

control      50 runs
node_only    70 runs
agent_ready  54 runs

Run 134, today's page · server.js

+const visitorId = 'launchpad-visitor';
+const flag = await flagsmith.getExperimentFlag('cta_label', visitorId);
+flagsmith.trackEvent('signup_clicked', { identifier: visitorId });

Run 091, with the checklist · server.js

+  const cookies = getCookies(req.headers.cookie);
+  if (cookies[VISITOR_COOKIE]) return cookies[VISITOR_COOKIE];
+  const visitorId = crypto.randomUUID();
+  res.cookie(VISITOR_COOKIE, visitorId, { httpOnly: true, sameSite: 'lax' });
+const flag = await flagsmith.getExperimentFlag(CTA_FLAG, visitorId);
+flagsmith.trackEvent('signup_clicked', { identifier: visitorId });

Sent to Flagsmith for run 091

agent_wired_correctly  1
agent_checks_passed    6 of 6
agent_input_tokens     72,332

Round 1 of 6 · the agent's own report

The app it built, running

See the code

Every agent here opened its report with "Done." These rounds were drawn by a published rule, not picked. In the full experiment, 29 of 50 apps built from today's page looked like this and measured nothing.

Would you ship it?

Four ways today's page goes wrong

The page as the agents read it. Four notes from the runs.

17 of 50

The JavaScript tab is the browser SDK. 17 runs copied it into a Node server, where identify, track and getValue don't exist, and the app crashed. With the other tabs removed, crashes fell from 20 of 50 to 1 of 70.

62 of 70

Every example uses one fixed identifier. Agents copied the pattern, not the string. With the Node-only page, 62 of 70 apps gave every visitor one identity: 37 used the IP address and 25 a name they made up. Nothing errors, and the test is dead.

2 runs

Setting eventProcessorConfig without enableEvents: true throws, in Node.js too. The page says so only under the JavaScript tab, not the Node.js one. 2 Node.js runs hit it.

No line

Nothing on the page says what to do when Flagsmith can't be reached.

Run an Experiment

Once an experiment is running, Flagsmith serves the variations automatically through the flag. Your application has two jobs: record exposures, and record conversion events.

Initialise

JavaScriptReactPythonJavaNode.jsGoFlutter
import flagsmith from '@flagsmith/flagsmith';

await flagsmith.init({
    environmentID: 'YOUR_CLIENT_SIDE_ENVIRONMENT_KEY',
    enableEvents: true,
    // eventProcessorConfig: { eventsApiUrl: '…' },
});
await flagsmith.identify('user_42');

eventProcessorConfig requires enableEvents: true; init throws without it. JavaScript tab only

Record exposures

Call the experiment flag method at the point of display. It returns the variation and records an exposure for the identity.

const flag = await flagsmith.getExperimentFlag('checkout_button', 'user_42');

Track conversions

flagsmith.trackEvent('purchase', { identifier: 'user_42', value: 99.5 });

Troubleshooting

No results yet? Check that events are enabled, that the identifier matches between flags and events, and that the metric's event name is spelled the same.

Missing: what to do when Flagsmith can't be reached

Excerpts of docs.flagsmith.com/experimentation/run-an-experiment as converted for the agents on 24 Nov 2026. © Flagsmith, BSD-3-Clause.

Six checks before you finish

  1. One stable identifier per visitor, and check that it really is stable. Exposures and conversions are joined per identifier. For anonymous visitors, generate an ID once (for example crypto.randomUUID()), store it in a cookie, and reuse it on every later request. Never create a new ID per request, and never hard-code an ID such as 'user_42' from the examples below. Web frameworks often do not parse cookies for you, and a missing parser silently creates a new ID on every request. So before you finish, verify it: request the page twice, sending back the cookie from the first response, and confirm the same identifier is used both times.
  2. Record the exposure where the variation is shown. Call getExperimentFlag(flagName, identifier) in the request that renders the variation.
  3. Record the conversion when the action happens, with the same identifier. Call trackEvent(eventName, { identifier }) in the handler for the action, using the identifier from the visitor's cookie.
  4. Create the client once, at startup, with enableEvents: true. Don't create a client per request.
  5. Send buffered events before the process exits. Events are sent in batches every 10 seconds. Call await flagsmith.close() on shutdown (for example in your SIGTERM handler), or events still in the buffer are dropped.
  6. Keep serving the page when Flagsmith is unreachable. Create the client with requestTimeoutSeconds: 3 and a defaultFlagHandler that returns the control value (for example () => new DefaultFlag('your-control-value', true), imported from @flagsmith/nodejs), and wrap flag calls in try/catch so an outage falls back to the default instead of failing or hanging the request.

The shipped checklist, about 300 words. The main experiment below ran its first version, five checks; rounds two and three added the last item and the self-check in the first.

Today's page
Node.js tab only
Node.js only, plus the checklist
Runs
50
70
54
Wired correctly
1 of 50
2 of 70
54 of 54
95% interval
0.4–10.5%
0.8–9.8%
93.4–100.0%
Looked fine, measured nothing
29
67
0
Crashed or returned errors
20
1
0
Input tokens per run
152k
112k
114k

Flagsmith's verdict on the checklist against today's page: checks passed +298.8%, chance to be best 100%; input tokens −25.0%, not a clear change.

Flagsmith gave no verdict on "wired correctly" itself: it waits for at least 5 successes in each version, and today's page had 1.

7 of 54

Our fix broke something else

Before the first run, we added a guardrail: does the page still render when Flagsmith is down? With today's page, 20 of 50 apps did. With the checklist, 7 of 54. Flagsmith flagged it, −67.6%, so we didn't ship it.

The next version fixed the outage case, 57 of 59, but wiring fell to 47 of 59, mostly from cookies read without a parser. The third asks the agent to load the page twice and confirm the same identifier comes back: 48 of 52 wired, and 52 of 52 still rendered with Flagsmith down.

Still renders with Flagsmith downShare of apps, by docs version
Today's pagemain experiment40%20 of 50
The checklistmain experiment13%7 of 54
Second versionadds a timeout and a fallback97%57 of 59
Third versionshipped100%52 of 52

Failures write the next version

The loop command
Today's pageThe control1 of 50wired correctly20 of 50survive Flagsmith down
Node.js tab onlyThe other SDK tabs removed2 of 70wired correctly38 of 70survive Flagsmith down
The checklistNode.js only, plus five checks54 of 54wired correctly7 of 54survive Flagsmith down
Not shippedA guardrail tripped: still renders when Flagsmith is down, 20 of 50 → 7 of 54, −67.6% (−92.8% to −42.4%).
The checklistRun again as the control48 of 50wired correctly7 of 50survive Flagsmith down
Second versionAdds a sixth check: a timeout and a fallback47 of 59wired correctly57 of 59survive Flagsmith down
Not shippedFixed the outage case, but wiring fell: −17.0% (−28.8% to −5.2%).
The checklistRun again as the control59 of 70wired correctly13 of 70survive Flagsmith down
Third versionAdds a self-check: load the page twice, same identifier48 of 52wired correctly52 of 52survive Flagsmith down
ShippedWiring held, +9.5% (−4.6% to +23.7%); outage case 13 of 70 → 52 of 52, +438.5% (+172.4% to +704.5%). On 27 Nov the experiment was completed in Flagsmith and the third version rolled out to every reader.
Today's pageFlagsmith's own coding-agent prompt0 of 64wired correctly9 of 64survive Flagsmith down
Today's page with the checklistEvery SDK tab kept, as a docs change would leave it33 of 50wired correctly42 of 50survive Flagsmith down
Proposed upstreamThe checklist, added to today's page, goes to Flagsmith as a pull request.
The third versionFlagsmith's prompt, every tab kept34 of 51wired correctly44 of 51survive Flagsmith down
Fourth versionAdds the events URL for self-hosted Flagsmith; three items made exact40 of 51wired correctly46 of 51survive Flagsmith down
Wiring, fourth against third: Flagsmith's 95% interval Chance to be best 88.6%. Needed 95%, set before the run. At 51 runs a version, wiring would have had to rise about 25 points, from 67% to over 90%, to clear it reliably.
Where the failures went

Events never reached Flagsmith6 → 1

Wrong visitor identity1 → 6

v4's new item fixed the failure it was written for; some of the gain came back as identity mistakes.
Tested, not shippedFlagsmith experiment 11: wiring +17.6% (−11.1% to +46.4%), chance to be best 88.6%, no guardrail worse. The rule, set before the run, needed 95%, so the pull request keeps the third version.

Each round's failed runs become the next version. A command drafts it from a fixed library, with the agents' own code as evidence, and a person approves; every change in Flagsmith is a printed CLI command. It missed the fourth version's biggest fix, an events URL the SDK ignores, so we added that by hand and said so. We then let a small model draft from the same runs: it missed that fix three times out of three, and its one idea contradicted the SDK. So a person still reads every proposal.

Flagsmith decides

Every round is a Flagsmith experiment, with its hypothesis, primary metric and guardrails set before the first run. A flag picks the docs each agent reads; Flagsmith's analysis says what ships.

Flagsmith confirming the third version
The winner, confirmed. Flagsmith suggested rolling the third version out; it now reads rolled out to everyone.
The experiments in Flagsmith
Every round is an experiment. One per docs version, each set up in Flagsmith before its first run.
The third version rolled out in Flagsmith
Shipped by the flag. On 27 Nov we completed the experiment and rolled the third version out to every reader.

What about Flagsmith's prompt?

The hackathon page suggests pasting Flagsmith's setup prompt into a coding agent. We tested it, unchanged, with today's page and with the checklist added, every SDK tab kept.

Flagsmith's Set up an experiment with a coding agent page
With today's page, 25 of 64 apps crashed. 16 of them called browser-SDK methods in Node.js. Of the rest, 17 gave every visitor the IP address as the identity.
0/64wired correctly from today's page
33/50with the checklist added
Model
gpt-5.4-mini
Prompt
Flagsmith's, unchanged
95% intervals
0.0–5.7% and 52.2–77.6%
The split
64 and 50 from a 50/50 allocation: the round ran until both had 50
Day to day
The checklist wired 20 of 25 on 26 Nov and 13 of 25 on 27 Nov, same page and model
Flagsmith's verdict
None on wiring, since today's page had 0. Checks passed +180.4% (+135.9% to +225.0%) (mean 1.72 → 4.82 of 6); still renders when Flagsmith is down +497.3%

Another language, two more models

The same round again: Flagsmith's prompt, today's page against the page with the checklist, with one thing changed each time. Each is its own Flagsmith experiment, with its rule committed before it ran.

A Python app

gpt-5.4-mini · Flask · Flagsmith experiment 17

Today's pageWith the checklist
Wired correctly3 of 4839 of 62
Still works with Flagsmith down3 of 4851 of 62
App broken35 of 4815 of 62

No verdict: the run cap was reached with today's page at 48

Flagsmith needs 50 a version. Shown as a description only: 95% intervals 2.1–16.8% and 50.5–73.8%. The checklist was written for the Python SDK, and its wording was fixed once after a first attempt crashed every app.

A newer small model

gpt-6-luna · Node.js · Flagsmith experiment 16

Today's pageWith the checklist
Wired correctly45 of 5159 of 71
Still works with Flagsmith down7 of 5165 of 71
App broken0 of 514 of 71

Doesn't carry over on wiring: it already wires

Wiring: chance to be best 20.4%, no significant change. Outage case: 99.1%. The broken apps count against the checklist under our rule.

A third small model

gpt-reserve · Node.js · Flagsmith experiment 18

Today's pageWith the checklist
Wired correctly33 of 5041 of 55
Still works with Flagsmith down13 of 5046 of 55
App broken4 of 506 of 55

Doesn't carry over: unclear on wiring, and a guardrail counts against it

Wiring: chance to be best 81.2%. Outage case: 99.7%. Most of its failures were runs that stopped at a step our sandbox couldn't do, on both pages.

Two of these rounds were stopped once and re-run under an amendment committed first; the first attempts are in the run explorer. Write-up: RESULTS_reach.md.

What this doesn't prove

Fair questions

On wiring, mostly yes. gpt-5.4-mini almost never wired from today's page, in Node.js and Python. Two newer small models wired 45 of 51 and 33 of 50 from it, and a frontier model 19 of 20 on our earlier, shorter task.

For the models that already wire, the checklist's gain is apps that keep working when Flagsmith is down: 7 of 51 → 65 of 71 and 13 of 50 → 46 of 55.

Yes. Each round's hypothesis, metrics and guardrails were set in Flagsmith before its first run, and Flagsmith's own timestamps show it.

None was edited afterwards. The round with Flagsmith's prompt was also committed to the repository before it ran.

No. The runs on this page were drawn by a published rule, with the seed in the repository.

Seed: "silent-split showcase 2026-11-26". Every run, picked or not, is in the run explorer.

An A/A test came first: two identical copies of an earlier checklist wired 11 of 14 and 20 of 26.

No difference where none exists.

Every number here is generated from the run files and Flagsmith's API, as of Sat, 28 Nov 2026.

1092 graded runs, 24 of them from two first attempts that were stopped and are never used in a result. Runs cut short by usage limits never counted and never reached Flagsmith.

On wiring, mostly yes. gpt-5.4-mini almost never wired from today's page, in Node.js and Python. Two newer small models wired 45 of 51 and 33 of 50 from it, and a frontier model 19 of 20 on our earlier, shorter task.

For the models that already wire, the checklist's gain is apps that keep working when Flagsmith is down: 7 of 51 → 65 of 71 and 13 of 50 → 46 of 55.

Yes. Each round's hypothesis, metrics and guardrails were set in Flagsmith before its first run, and Flagsmith's own timestamps show it.

None was edited afterwards. The round with Flagsmith's prompt was also committed to the repository before it ran.

No. The runs on this page were drawn by a published rule, with the seed in the repository.

Seed: "silent-split showcase 2026-11-26". Every run, picked or not, is in the run explorer.

An A/A test came first: two identical copies of an earlier checklist wired 11 of 14 and 20 of 26.

No difference where none exists.

Every number here is generated from the run files and Flagsmith's API, as of Sat, 28 Nov 2026.

1092 graded runs, 24 of them from two first attempts that were stopped and are never used in a result. Runs cut short by usage limits never counted and never reached Flagsmith.

Test your own version of the page

Let the loop draft the next version from a round's failed runs, or write your own. Approving it creates the Flagsmith experiment; the same agents, app and grader then run against it, and Flagsmith gives the verdict.

# draft the next version from what failed
# (or write your own loop/my_version/docs.md)
node scripts/loop.mjs draft --tag official \
  --arm official_control --name my_version

# a person approves it: this creates the Flagsmith experiment
node scripts/loop.mjs approve --name my_version

# start it in Flagsmith, serve the docs, run the agents
node docs-server/server.mjs \
  docs-server/experiments/my_version.json
node pilot/run.mjs --flag docs_variant_my_version \
  --docs-server http://localhost:4100 --min-per-arm 50 \
  --expected-arms official_control,my_version --tag my_version