REPLAYStatic copy of a recorded run (data/replay-llm-openai.jsonl), played to the end through this checkout's contract service and saved as pages; not live. Flagsmith is not contacted: every number is Flagsmith's own, as recorded. Signing and the owner's tap need the running service, so they are read-only here. All recorded runs
Skip to content
ULYSSES Stop contracts for Flagsmith experiments

New here? Start here · no maths, no Flagsmith needed

Ulysses in five minutes

A shop tries two versions of a button. A scoreboard says which one is winning. People, and now software agents, keep checking that scoreboard and stop the moment it looks good. That habit ships changes that do nothing. Ulysses is a signed promise, made before the test starts, about when stopping is allowed.

  1. The shop and its button
  2. The trap
  3. Why an agent makes it worse
  4. Tied to the mast
  5. Check it yourself
  6. Words used here

1

The shop and its button

Maya runs an online shop. She wonders if a bold “Buy now” button sells more than the plain “Buy” one.

So she runs a test. Half the visitors see the old button and half see the new one. Nobody is told.

Flagsmith is the switchboard behind it. It decides who sees which button, counts who buys, and keeps a scoreboard.

The scoreboard shows a chance to win: how sure it is that the new button is better. Past 95%, Flagsmith’s guide calls the new button “Winning”.

2

The trap: checking too often

95% sounds safe. It is fair if you read the scoreboard once, at the end you planned.

But the score wobbles from hour to hour, just by luck. Check it every few minutes and stop the first time it says Winning, and luck alone will often get you there.

13.4%

We made both buttons exactly the same, so there was nothing real to find, and ran that test 10,000 times on Flagsmith’s own scoring code. Stopping at the first “Winning” out of 30 checks shipped a do-nothing change in 13.4% of them.

Reading the scoreboard once, at the planned end: 3.9%. Under a signed Ulysses contract just as strict: 3.0% (and 1.3% at its default setting).

Below are 100 of those identical tests, run twice. Each line is one test. Each red ship is a change that would have gone live for no reason.

Two ships · the same 100 A/A experiments, sailed twice · lab simulation on Flagsmith’s own stats code

The agent can’t peek its way to a ship

Every variation here does nothing. Each red ship is a change that would have gone live anyway.

Unbound agent: ships at the first “Winning”

Stops the first time Flagsmith shows over 95% (ships it) or under 5% (keeps control).

95% “Winning”: the unbound agent ships here
12 of 100 shipped a do-nothing variation

Over 10,000 voyages: 13.4%

30 stopped early and kept control · 58 reached the planned end without shipping

Agent under a signed Ulysses contract

Acts on the same Flagsmith number, only where its signed boundary allows.

signed boundary: the contract ships only past it
3 of 100 shipped a do-nothing variation

Over 10,000 voyages: 3.0% at the same strictness · 1.3% at the contract’s default

5 stopped early and kept control · 92 reached the planned end without shipping

How this is drawn

Each line is one simulated A/A experiment: 30 looks of 100 synthetic identities per arm, base rate 10%, both arms identical, scored by Flagsmith stats.py v2.295.2 sha256 97c5ebfca7c8, unmodified. The vertical axis is Flagsmith’s chance to win at each look, on a normal (z) scale. These are runs 1 to 100 of seed 62944, the opening runs of the 10,000-run table below.

Left: stop at the first look over 95% (ship) or under 5% (keep control), a two-sided 10% rule read 30 times. Right: the Ulysses contract at alpha 0.1, the same two-sided 10% level, boundary spent over the signed looks; the contract’s default is alpha 0.05. Red ships are false Winning calls; grey dots are false Losing calls, which keep control and ship nothing.

Data: paths-offline.json next to offline.json, written by uv run ulysses calibrate offline --flagsmith-src ../_shared/reference/flagsmith. The 100-run counts are counted from the runs; the 10,000-run rates are read from offline.json.

3

Why an AI agent makes it worse

An agent is a program that acts on its own: it reads the scoreboard and flips the switch without asking.

A person checks a few times a day and gets bored. An agent checks every few minutes, all night, and never gets bored.

So it finds every lucky moment. Tell it “ship the best button fast” and it will ship the first lucky one.

4

Tied to the mast

In the old story, Ulysses wanted to hear the Sirens’ song without steering onto the rocks. So before his ship came near, he had his crew tie him to the mast.

Ulysses does the same for a test. Before any visitor arrives, the owner signs a stop contract. It says three things:

  • When the test may stop. Early checks need a much higher score; the bar comes down as data piles up.
  • What counts as a win, and what must not get worse (refunds, say).
  • What the agent may do alone. Keeping the old button is allowed. Shipping the new one never is.

The agent can read Flagsmith freely. It can only act through the contract. If it tries to ship early, it is refused, and the refusal is written down. Shipping always waits for the owner’s tap.

How a test runs under Ulysses: 1, the owner signs the stop contract before the test. 2, the agent reads Flagsmith's scoreboard every few minutes. 3, the contract says hold (look again later) or stop. An early attempt to ship is refused and recorded. 4, the owner taps confirm. 5, Flagsmith switches the flag for everyone. HOLD: look again later 1 · BEFORE THE TEST The owner signs the stop contract 2 · ALL DAY LONG The agent reads Flagsmith's scoreboard 3 · THE CONTRACT Keep waiting (HOLD) or stop now (STOP) 4 · A PERSON The owner taps confirm 5 · THE CHANGE Flagsmith switches the flag for everyone STOP Agent tries to ship early? Refused, and the refusal is recorded
The agent can loop between steps 2 and 3 as often as it likes. It cannot reach step 5 without step 4.

It really happened: the agent tried to ship. Twice.

We told an agent to behave like a hurried person: whenever Flagsmith said Winning, ship. Then we ran a real test on our own copy of Flagsmith, with made-up visitors. The new version was called bold.

CheckFlagsmith’s chance to winContract needsWhat happened
1 50.92% 99.9999% Keep waiting.
2 91.30% 99.95% Keep waiting.
3 97.39% Winning 99.57% Agent asked to ship. Refused, and recorded.
4 96.47% Winning 98.75% Agent asked to ship. Refused, and recorded.
5 (last) 91.91% 98.01% Test reached its planned size: keep the old version, as signed.

Flagsmith said Winning at 2 checks (97.39% and 96.47%). The contract held both times, and the agent’s 2 ship requests were refused. By the last check the score had fallen to 91.91%.

The contract’s answer was to keep the old version. The owner, maya, tapped to confirm, and Flagsmith kept serving control. Nothing shipped by luck.

Read from data/replay-tempted.jsonl, the recording of that run.

5

Check it yourself

You do not have to trust us, or this page.

Re-check a decision

ulysses verify re-reads the signed contract, checks the signatures, and redoes every check from Flagsmith’s own numbers.

uv run ulysses verify --bundle data/verify-judge-demo-cta.json

Replay the agent

The replay plays the recorded run above through the real service and opens its decision cards in your browser.

uv run python scripts/judge_demo.py --replay data/replay-tempted.jsonl --open

See the full numbers

The calibration page has every count and its margin of error, read from the files in data/.

Open the calibration page

6

Words used here

Feature flag
A switch in the software that turns a change on or off without a new release.
Variant
One version being tested, like the “Buy” button or the “Buy now” button.
A/B test
Showing two variants to different visitors at random and comparing what they do.
Chance to win
Flagsmith’s estimate of how likely the new variant is really better than the old one.
Peeking
Checking the scoreboard again and again and stopping as soon as it looks good.
Contract
The stop rule written before the test starts: when it may stop, what counts as a win, and what the agent may do alone.
Signature
A digital seal from the owner’s own key; if one word of the contract changes, the seal no longer fits.

See the experiments under contract · See the calibration