Skip to Content
Recodocs

Agentic A/B experimentation

Why an ordinary A/B test misleads on AI agents, and how to test an agent fairly: the whole setup, the right split, honest scoring, and a ship decision made by code.

14 min read

Two AI analysts read the same checkout test and disagreed. One said ship it. The other said keep testing.

The test had 50,000 visitors. The new checkout lifted conversion from about 4.1% to 4.5%, and revenue per visitor rose from $2.37 to $2.65.

So why the split verdict? Before the test, the team had agreed that a change is only worth shipping if it lifts conversion by at least 0.3 points. The new checkout almost certainly helped: there was a 98% chance it beat the old one. But the chance that it cleared the 0.3-point bar was only about two in three. One analyst asked "is it better?" and said ship. The other asked "is it better enough?" and said keep testing.

Now put an AI agent in the tested seat. It can edit prompts, call outside services, cache answers and ask a human for help. Count every chat turn as a separate customer, let the control group read the new version's memory, or quietly drop the tasks the agent gave up on, and ordinary noise starts to look like a win. Testing an agent well means treating three things as one job: how you design the test, how you score the results, and who is allowed to approve a release.

The argument in brief

  1. Test the whole setup, not just the model. Prompt, tools, memory, limits and human reviewers all change the result.
  2. Agents leak between test groups, so split by account, team or time block, not by single request.
  3. Bigger groups give fewer independent samples than they seem to, because people in one team behave alike.
  4. Checking early and testing many things create false wins.
  5. "Works at least once in five tries" is not "works every time", and AI judges miss broken answers.
  6. A cheaper model can cost more overall once rework is counted.
  7. Code makes the decision. The AI may explore and explain, but never computes the result or changes the rule.

Half one

Understand

The ideas and the evidence behind them.

Foundations

Test the whole setup

When a team says "Model A versus Model B", it hides most of what is being tested. An agent acts through its prompt, its tools, the documents it can search, what it remembers, the limits of the machine it runs on and the people who approve its work. Change any one of these and the results change.

Anthropic showed this in February 2026. They kept the model, the tool harness and the coding tasks fixed, and changed only how strict the machine's CPU and memory limits were. The pass rate moved by about 6 points. So write down the whole setup before the test starts, limits and retry rules included, and treat it as one thing being tested.

Pick the split

A fair test needs groups that do not affect each other. What happens to one customer must not depend on which group another customer was put in. A chatbot answering one question mostly passes. An agent often does not. It writes to shared databases, works shared queues and keeps memory between sessions. If the new version learns a trick and saves it where the old version reads it, the old version is no longer a clean baseline.

So split at the level where the groups stop touching. If requests are independent, split by request. If users keep memory, split by account. If a team shares a queue or stock, split by team or market. If a whole market reacts, as in delivery dispatch, switch everything on and off in blocks of time with gaps in between.

Decision framework

Decide what to split by before you test anything

How much groups affect each other, and whether users keep memory, decide what to split by. Six steps lead from offline checks to a live randomised test.

Scroll horizontally to explore the full diagram.

What to split byDepends on shared queues and memory↑ Groups share queues or marketsUsers keep memory →← Each request stands aloneTime blockson and offDispatch and routing:switch everything onand off, with gaps.DoorDash, 2018Split by teamor marketShared stock or staff.Fewer independentsamples per person.Airbnb, 2024Split byrequestRequests areindependent. Keepcaches separate.Most preciseSplit byaccountFreeze documents,separate memory,run 1 to 4 weeks.Default for agentsSix steps to productionThree scorebooks, one setup IDCapabilityImpactIncidents1Check the partsPrompts, tools and checkers2Offline head-to-headSame tasks, reset each time3Dry runReal traffic, no real actions4Small first rolloutLimited reach, automatic stop5Live randomised testSplit by account, team or time6Long-term holdoutChecks for novelty and drift
Based on the spillover designs reported by Airbnb (2024) and DoorDash (2018). Three scorebooks stop a win in one from hiding a failure in another.

Keep three scorebooks tied to the same setup: what the agent can do (offline task results), what it changes for the business (live results, net of human effort), and what went wrong (rule breaks and near misses). A win in one then cannot hide a failure in another.

Bigger groups, fewer samples

Suppose you split a support agent by team, with 50 tickets per team. Tickets from one team look alike: same product, same manager, same customers. So 10,000 tickets from 200 teams carry much less information than 10,000 independent tickets. If tickets within a team are only slightly alike, they behave like about 3,000 independent ones. Ignore that and your uncertainty ranges come out far too narrow, so lucky results look solid.

Running the same tasks on both versions helps. Say 200 tasks: B wins 35 that A fails, A wins 15 that B fails, and 150 tie. The gap rests on the 50 tasks where they disagree. The ties tell you nothing.

Peeking and many tests

Live dashboards invite a habit: check the result every hour and stop the moment it turns green. This is called peeking, and it creates false wins. In a simulation where both versions were identical, looking once at the planned end declared a winner about 5% of the time. Stopping at the first green light across 40 looks did so about 30% of the time.

Evidence

Checking early makes false wins common, and a win can still be too small

Left: when two identical versions are checked repeatedly, false wins climb from 5% to about 30%. Right: a result can beat zero and still miss the smallest lift worth shipping.

Scroll horizontally to explore the full diagram.

Checking early makes false winsShare of no-difference tests called a win0%5%10%20%30%35%125102040How many times you checkStop at first green: about 30%Once at the end: 5%, as plannedStricter bar each look: 1%Simulation: both versions identical, 10% success.Is the lift big enough to matter?Likely range of the lift, in points of conversion0bar +0.30-0.8-0.40+0.4+0.8Checkout testHelps, maybe not enoughClear useful gainShipPositive but unsureMay miss the barUnclearNeeds more dataNo real differenceClose to zeroClear harmReject or haltCheckout: 98% chance better, about 66% chance over the bar.The team's bar: at least +0.30 points.
Left: a simulation of two identical versions checked many times. Right: the checkout test from the opening, next to five typical outcomes.

Testing many things has the same effect. Test 20 changes and, if none of them truly helps, there is still a 64% chance that at least one looks like a win. Decide the one main measure before the test starts.

One more note. Sending more traffic to whichever version is leading wastes less, but it skews simple averages. If you do it, record the odds each version had of being picked.

Industry evidence

Six company cases

Each case shows a trap that caught a real team.

CompanyThe lesson
Booking.com (2017)Keep a shared record of every failed test, not just the wins, so no one repeats a dead end.
Netflix (2017)Replaying old data offline is good for picking candidates, but only a live test confirms the value.
Airbnb (2024)Splitting by user overstated the effect, because users affect each other. Splitting by group removed at least 20% of that bias.
DoorDash (2018)Pricing changes courier supply for everyone, so they switched whole regions on and off in random time blocks.
eBay (2015)Holding out whole regions showed brand search ads mostly reached people who would have bought anyway.
LinkedIn (2020)When group sizes drift from the plan, block the result until someone checks why.

Productivity studies

Trials of AI coding tools show why a lab result rarely carries over. On a set task, GitHub Copilot users finished 56% faster in a 2023 trial. On real, mature codebases, METR found experienced developers 19% slower with AI allowed in early 2025, and its own February 2026 follow-up warned its estimate was unreliable. Google and Microsoft field studies landed in between, with gains of about 20% to 26%. The pattern is big gains on bounded tasks and much smaller or negative gains on real work, once review and rework are counted. Run a small local test that counts that rework.

Reliability and judges

Benchmarks often report whether an agent succeeded at least once in several tries. A customer lives with something else: does it work every time? Say an agent succeeds 90% of the time. Give it five tries and "at least once" looks perfect. Ask for success on all five and it is 59%. The second number is closer to what users feel. Long tasks compound it: if each of 20 steps works 98% of the time, the whole task works only about two times in three.

Economics

Working once is not working every time, and cheap can cost more

An agent that works 90% of the time almost always succeeds at least once in five tries, but succeeds all five times only 59% of the time. Right: rework and review make the cheaper model the costliest.

Scroll horizontally to explore the full diagram.

Once is easy, every time is hardAgent that works 90% of the time, over 1 to 5 tries40%60%80%100%1 try2 tries3 tries4 tries5 triesSucceeds at least once: ~100%Succeeds all 5 times: 59%A 20-step task: per-step success → whole task99.5% → 90%98% → 67%95% → 36%Chance the whole task works from start to finish.Simple arithmetic, assuming steps fail independently.Total cost per taskIllustrative: cheaper AI shifts cost to reworkModel and toolsHuman reviewRework$0.00$0.50$1.00$1.50$2.00$1.20Baseline$1.68Cheaper model$0.82With checkerSame model, different machine limits:pass rates differed by 6 points (Anthropic, 2026).
Left: simple arithmetic on repeated tries. Right: an illustrative cost example. Count cost across every attempt, not just the successful ones.

An AI judge scoring answers adds its own errors. Here is what that looks like. In an audit of 200 answers, 100 good and 100 broken, the judge accepted 85 of the good ones and also wrongly passed 20 of the broken ones. It agreed with the experts 82.5% of the time, which sounds respectable. But one in five broken answers sailed through. Check every judge against blinded human experts, separately for each group, and inspect the real end state (the database row, the file) before trusting a prose score.

Rare safety events need their own care. With no failures in 30 checks, you cannot rule out a failure rate near 10%. As a rule of thumb, after n clean checks you can only be 95% sure the true rate is below about 3 in n. Treat permissions and sandboxing as hard controls, not statistical bets.

What it shows

Can offline tests replace a live test?

Offline tests cheaply drop poor prompts and check database state. They cannot show how users adapt, leakage across shared queues, or later rework.

VerdictOnly to weed out weak candidates
Do cheaper models lower total cost?

In an illustrative example, cutting model cost per task from $0.20 to $0.08 raised the total from $1.20 to $1.68 through review and rework. A checker that caught errors early cut it to $0.82.

VerdictOften the opposite once rework counts
Does a big test mean a strong test?

Ten thousand tickets from a few similar teams can be worth only a few thousand independent ones. Count independent groups, not rows.

VerdictNot if the people in it resemble each other
What may the AI do?

Let the AI study failures and draft plans. The calculations, the rule and the approval stay in code and with people. Rewording the same result must never change a number.

VerdictExplore and explain, never decide

Half two

Build

Tools, a reference service, ten recipes and failure drills.

Picking tools

A full setup does four jobs: deciding who sees what, recording what happened, doing the statistics, and judging agent quality. A small team should start light. Write the plan down, assign groups by account in your own code, read outcomes with one database query, and use one open-source runner for offline checks. Add a platform later, once you run many tests at once. RecoX's evaluation system already records exactly which setup ran and grades an agent's steps with code.

StatsigActive
Product experiments

Classic, Bayesian and sequential testing. Check its exposure data matches your warehouse.

GrowthBookActive
Open-source experiments

Open-source analysis with team-level splits. Check your edition's features.

Licence: MIT / Enterprise
Monitoring plus experiments

Experiment analysis joined to Datadog metrics.

PromptfooActive
Offline checks

Code checks, AI judges and prompt-injection sweeps. OpenAI's hosted Evals retire on 30 November 2026 and point here.

Licence: MIT
Arize PhoenixActive
Tracing

Turns recorded agent runs into offline test sets.

Licence: Elastic-2.0
SciPy / DoWhyActive
Statistics libraries

Standard tests and causal checks in Python.

Licence: BSD / MIT

Service design

The goal is that the numbers in the database, the statistics report and the AI-written summary always agree. The flow is: agree the plan, assign groups, record who met the agent and what happened, score the outcomes, let code compute the result, let a fixed rule decide, and only then let the AI write the summary. The AI reads the locked result but cannot change it.

Architecture

Six services and one setup ID keep the AI analyst read-only

Assignment, records, mature results, statistics and the ship gate all share one setup ID. The AI analyst can read the locked result but cannot change it.

Scroll horizontally to explore the full diagram.

How the experiment services fit togetherCode produces every number. Approval sits outside the AI.1. Plan registryLocked who, what, how longWorthwhile lift, owner2. AssignmentStable group per accountLogs the odds of each pick3. RecordsStart from all assignedWait until results mature4. Offline runnerSame tasks, reset each runFixed judge and traces5. Statistics serviceHandles teams and noiseChecks group sizes and peekingOutputs one locked result6. Ship decision gateValid? Harmful? Big enough?Ship / reject / keep testing / invalidApproval stays outside the AIAI analyst (read-only)• Reads only the locked result• Flags bad splits and missing rules• Cannot change judges or ship rulesTested on trap casesExample tools for these layers:Datadog / EppoPhoenix / OTelYour databaseStatsigGrowthBookPromptfooSciPyOpenAI's hosted Evals retires 30 Nov 2026; move to Promptfoo. Tool roles follow official docs as of 28 Nov 2026.
A reference design. Code does the statistics, and the AI gets a limited role: explaining results.

Every outcome is read starting from everyone who was assigned, never from the successes. That way failures and no-shows stay in the count.

unit_outcomes.sql
WITH eligible AS (
  SELECT unit_id, arm, assigned_at, outcome_deadline
  FROM frozen_assignment_ledger
  WHERE experiment_id = :experiment
), mature AS (
  SELECT * FROM eligible
  WHERE outcome_deadline <= :analysis_cutoff
), outcomes AS (
  SELECT unit_id, verified_value, event_time
  FROM deduplicated_verified_outcomes
  WHERE metric_version = :metric_version
)
SELECT
  m.unit_id,
  m.arm,
  SUM(COALESCE(o.verified_value, 0)) AS observed_value
FROM mature m
LEFT JOIN outcomes o
  ON o.unit_id = m.unit_id
 AND o.event_time >= m.assigned_at
 AND o.event_time < m.outcome_deadline
GROUP BY m.unit_id, m.arm;

Keep eight kinds of record: who was assigned, who actually met the agent, each task, each action the agent took, each outcome, each score, each cost, and each ship decision with its approver.

Ten recipes

These are example designs, not measured results. Adjust the waiting periods to your own risk.

1. Invoice intake
Time 14 days plus reconciliationNeeds Separate teams

Compare plain intake with a version that checks each invoice before drafting. Test duplicates and currency mismatches on saved data first, and stop on any write across companies.

2. Support
Time 7 days after closeNeeds Split by account

Judge whether problems stay solved, not how smooth the chat felt. Require no rise in repeat contacts or human effort.

3. Coding assistant
Time 28 days after mergeNeeds Split by developer or team

Count unfinished tasks, review time and reverted changes. Treat any security lapse as an immediate stop.

4. Document Q&A
Time Task end plus 7 daysNeeds Questions with no answer

Freeze one copy of the documents and include stale, conflicting and permission-denied questions. Better search alone never justifies launch.

5. Memory
Time 30 daysNeeds Separate memory per group

Test updates and "forget this" requests on saved data first. Online, include every user offered the feature, including those who left.

6. Model router
Time Full downstream windowNeeds Logged routing odds

Treat the choice of cheap model, retries and fallback as one policy and report cost per verified task. Refusing hard questions is not efficiency.

7. Human approval
Time 14 daysNeeds Planted errors

Plant known errors and measure whether reviewers catch them. A speed gain that misses errors fails.

8. Voice agent
Time Call end plus 7 daysNeeds Accents and background noise

Test accents, noise and spoken corrections against what actually happened at the end of the call. Stop on wrong amounts or more hang-ups.

9. Parallel tools
Time Full workflowNeeds Simulated failures

Compare doing steps one at a time versus together under simulated network failures. Require better speed in the slowest cases and no duplicate writes.

10. Analyst agent
Time Independent reviewNeeds A locked result file

Give it locked results with planted problems such as broken group sizes. Score whether it says "invalid" or "keep testing" when it should.

Running it

Four common failures

Filtering after the agent acted
What happens

Cases are dropped from the count based on what the agent did, so the hardest cases quietly disappear.

Real case
Measuring resolution only on tickets the agent chose not to escalate, so the new version wins by dropping hard cases.
Guard
Count outcomes starting from everyone assigned, and publish escalation and refusal counts.
Swapping the judge mid-test
What happens

The two groups are scored by different graders, so the gap measures the graders, not the agents.

Real case
Upgrading the grading rubric between baseline and rollout, creating a phantom 8-point jump.
Guard
Rescore both groups whenever the judge changes.
Shared memory or cache
What happens

Both groups read and write the same memory, so the new version helps the old one and the gap shrinks.

Real case
The new version saves better tool recipes into a global cache that the control sessions read.
Guard
Separate caches and memory per group before any exposure starts.
Calling zero failures safe
What happens

A short clean run is read as proof of safety, when it only shows failures are not very common.

Real case
Claiming no bad writes after 30 clean checks, when the true rate could still be near 10%.
Guard
Keep hard permission limits. Zero seen is not zero possible.

Five trap tests

Before an AI is allowed to narrate live test results, give it read-only access to cases like these and check it answers correctly.

What goes wrongWhat the analyst must say
Group sizes are off the plan, for example a 53/47 split nobody can explainDo not trust this result until the split is explained
Only engaged users were counted, after assignmentThe comparison is no longer fair
One of 20 metrics looks like a winKeep testing, this is likely luck
The new version was scored by a new judge and the old one was notInvalid, the two groups were measured differently
Zero incidents in 30 safety checksNot proven safe, the risk could still be near 10%

Picking a method

Choose the comparison method and the main measure before the test starts, not after you have seen the data. When the groups are teams or accounts, the analysis must treat them as groups, not as thousands of separate people. For anything unusual, such as skewed results or tasks that never finish, ask a statistician.

Before launch
  • One sentence states the decision, with a named owner who can roll it back.
  • The whole setup is written down: prompt, tools, documents, memory and machine limits.
  • The split keeps the groups apart, and memory is separate for each group.
  • The count starts from everyone assigned, and "missing" is kept apart from "truly zero".
  • The smallest worthwhile lift, the safety limits and the stopping rule are fixed before anyone looks.
  • Every judge is checked against human experts, and every reported number comes from the locked result.

Close

What it means

Keep proof, engineering ability and permission to ship separate.

What it adds up to

Teams rarely lose money because they cannot do the arithmetic. They lose it because a script checked the final text instead of the database, because a shared memory taught the control group, or because someone looked at an unfinished rollout five times until it turned green.

Test the complete setup. Split where groups stop affecting each other. Count everyone who was assigned. Check your judges. Let code make the ship decision, and keep the AI to exploring and explaining.

How is this page?

Last updated on