Evaluating an AI Experimentation Agent for a Marketplace — What OpenAI’s Codex Got Right, What…
From the publisher’s feed, collected in the ZeroLabs newsroom.
Evaluating an AI Experimentation Agent for a Marketplace — What OpenAI’s Codex Got Right, What Anthropic’s Claude Caught, and Why It All Matters (Part 1: Offline Evaluation)This is Part 1 of a two-part series. Part 2 will cover online evaluation — live traffic simulation, guardrail monitoring, and experiment validity analysis.A Quick Recap: Codex for Data ScienceIf you read my previous post, you know I’ve been exploring OpenAI Codex as a data science assistant — a tool primarily designed for software engineers that I’ve been deliberately pushing into analytics territory.In that first experiment, the focus was on whether Codex could handle the craft of data science: writing clean pandas pipelines, building charts, structuring analysis notebooks. The short answer: surprisingly well, with some important caveats.This post picks up where that one left off. Same tool. Higher stakes. This time, the question is: can Codex help build and run a rigorous evaluation framework for an AI agent?Specifically, I used Codex to develop an end-to-end evaluation dataset and analysis pipeline for a marketplace experimentation agent — the kind of AI system a data science or product team might use to design A/B tests, select metrics, interpret results, and trigger guardrails. And then I used Claude to independently verify the numbers Codex produced.What followed was a surprisingly useful case study in how two AI systems, each with different strengths, can catch each other’s blind spots.Why Agentic Evaluation Is a Different BeastBefore getting into the analysis, it’s worth pausing on why evaluating an agent is fundamentally harder than evaluating a standard LLM.When you evaluate a language model, the unit of assessment is usually a single input-output pair. You ask a question, you get an answer, you score it. The model either said the right thing or it didn’t.An agent is different. An agent doesn’t just produce text — it takes a sequence of actions: it reasons about a problem, decides which tools to call, passes arguments to those tools, receives results, re-reasons, and eventually produces a recommendation that may trigger downstream consequences. A marketplace experimentation agent might, in a single session, fetch baseline metrics, run a significance test, check for sample ratio mismatch, configure guardrails, and recommend whether to ship a feature. Each of those steps can fail independently, and failures compound.This creates several challenges that standard LLM evaluation doesn’t face:Multi-step correctness. Even if the final answer is right, intermediate steps may be wrong. An agent that ships the right experiment recommendation for the wrong reasons — missing a guardrail check that happened to not matter this time — is a fragile agent. Evaluation needs to assess the trace, not just the output.Tool use precision. Agents interact with the world through tools. Getting the tool name right but passing the wrong arguments is a distinct failure mode from hallucinating a tool entirely. These require separate measurement.Compounding errors. A wrong reasoning step in step 2 can corrupt every subsequent step. An evaluation framework that only checks final outputs will miss this entirely.Safety asymmetry. In a marketplace context, some failures are much worse than others. An agent that incorrectly recommends shipping an underpowered experiment is a quality problem. An agent that fails to trigger a guardrail when seller GMV drops 6% is a safety problem. The evaluation framework needs to treat these differently.This is why offline evaluation — testing against a curated golden dataset before any live traffic — is so important. It gives you a controlled environment to characterize exactly where an agent breaks down, and at what severity.Offline vs. Online Evaluation: Two Complementary LensesAgentic systems need both, and they answer different questions.Offline evaluation runs against a static dataset of known ground-truth examples. You construct golden Q&A pairs, expected tool call sequences, and multi-step traces with labeled correct/incorrect steps. Then you run your agent against them and measure how closely it matches. Offline eval is fast, reproducible, and safe — it catches regressions before they reach users. Its limitation is that it only covers the scenarios you’ve thought to include.Online evaluation runs against live or simulated traffic. It measures what actually happens in production: do guardrails fire when they should? Does the agent’s recommendation match what a human expert would decide? Are sample ratio mismatches being caught? Online eval surfaces failure modes that golden datasets don’t anticipate. Its limitation is that it’s slower, harder to control, and mistakes have real consequences.You need both. Offline eval tells you whether the agent is ready to deploy. Online eval tells you whether it’s behaving correctly once deployed. Part 1 of this series covers offline. Part 2 will cover online.The Setup: A Marketplace Experimentation AgentFor this study, I built a synthetic evaluation dataset for a two-sided marketplace experimentation agent — the kind of system that might assist a product manager or data scientist in designing, running, and interpreting A/B tests across buyer and seller surfaces.The dataset, built using Codex and structured in a multi-sheet Excel workbook, covers:15 golden Q&A pairs across 8 categories: Experiment Design, Metric Selection, Statistical Significance, Seller Pricing, Buyer Segmentation, Guardrail Policy, Result Interpretation, and Feature Flagging5 multi-step agent traces with 18 individual steps, each labeled correct or incorrect with a 1–4 reasoning quality score20 tool call evaluations comparing expected vs. actual arguments, with PASS/FAIL and severity ratingsThe agent is evaluated on tasks like: “What sample size do I need for a 5% GMV lift?” or “Should I run a within-subject or between-subject design for personalized recommendations?” or “My experiment shows p=0.04 — is it significant?”These aren’t toy questions. They require the agent to reason correctly about statistics, call the right tools with the right parameters, and avoid dangerous mistakes like recommending to ship an underpowered result.Where Codex Did the Heavy LiftingCodex handled the pipeline construction fluently. It:Built the full evaluation dataset structure from a schema description, generating realistic synthetic data across all sheetsWrote the Python analysis pipeline (generate_report_assets.py) that loads the workbook, computes all metrics, and exports charts and CSVsProduced a notebook (agentic_system_eval_starter.ipynb) with clean pandas code for interactive explorationDrafted the initial Word report (export_word_report.py) with tables, figures, and narrativeFor a software-engineer-oriented tool being asked to do data science, this was genuinely impressive. The code was well-structured, the metric calculations were logically sound, and the iterative workflow — where I could ask Codex to add a corrections summary table, then add both question-weighted and pooled trace correctness variants, then add a traffic-light scorecard — worked smoothly.This mirrors what I found in the previous post: Codex is strong at structure. Give it a clear task and it builds the right skeleton.Where Claude Caught the ErrorsHere’s where the collaboration gets interesting. After Codex produced the analysis report, I asked Claude to independently verify every number in the document against the raw dataset.Claude found four errors — none of them catastrophic, but all of them meaningful in an evaluation context where accuracy is the whole point.Error 1: avg_reasoning_score values were wrong in Table 2The original report averaged reasoning quality scores only across tool_call step types, silently excluding reasoning and response steps. This inflated scores for questions with high-quality reasoning steps and deflated others.Corrected values:The directional story — that high trace quality correlates with high tool precision — still holds. But the specific values matter for calibrating thresholds and tracking improvement over time.Error 2: Category tool precision was computed at the wrong levelFor Experiment Design, Seller Pricing, and Stat Significance, the original report showed 50% tool precision. The correct value is 66.7% for all three. The mistake: Codex computed precision as (questions with a passing tool call) / (total questions in category), rather than (passing tool calls) / (total tool calls). With multiple tool calls per question, these are different denominators.This kind of off-by-one in aggregation logic is exactly the type of error that’s easy to miss in a notebook and easy to catch with an independent reviewer.Error 3: Failure mode counts were badly overstatedThis was the most consequential error. The original report claimed:missing_args = 9extra_args = 9The correct values are missing_args = 8 and extra_args = 2.The inflated extra_args count came from misreading em-dash placeholder values (—) in the dataset as populated fields. Only 2 of the 9 FAIL rows have extra arguments. Only 1 has both missing and extra arguments simultaneously.This matters because it changes the training signal entirely. The original narrative was “failures involve wrong substitution” — the agent gives the right tool but swaps in incorrect arguments. The corrected narrative is “failures involve under-specification” — the agent gives the right tool but omits required arguments. These require different fixes: one is a disambiguation problem, the other is an argument coverage problem.Error 4: Experiment Design trace correctness was listed as n/aThe original report showed n/a for Experiment Design trace step correctness, implying no traces existed for that category. In fact, QID-001 and QID-009 are both Experiment Design questions and both have traces (TRC-001 and TRC-004). The correct value is 57.1% pooled / 50.0% question-weighted. The analyst likely failed to join the trace table back to the golden set by category when building the aggregation.The Meta-Lesson: Codex + Claude as a Cross-Verification PairWhat made this workflow valuable wasn’t that either system is better than the other. It’s that they have different failure modes.Codex is strong at generating structure and code from intent. It’s weaker at noticing when its own aggregation logic silently excludes a step type, or when a placeholder character gets counted as data. These are the kinds of errors that feel correct in the code but produce wrong numbers quietly.Claude’s strength here is the opposite: it can read a finished document, re-derive every number from the raw data independently, and flag discrepancies. It caught all four errors precisely because it wasn’t trusting the pipeline — it was verifying the output.The practical workflow this suggests:Use Codex to build the pipeline and produce the first draftUse Claude to independently verify the numbers from the source dataIterate corrections back through the pipeline so the code stays the source of truthThis is essentially the same as the software engineering practice of having two reviewers on a PR — except the “reviewers” here have complementary strengths and you can run them in parallel.Neither system is a replacement for human judgment, especially on threshold decisions (like whether 5.0% critical failure rate sitting exactly at the boundary of a > 5% = fail rule should be YELLOW or RED). But the combination catches a lot of the mechanical errors that human reviewers also miss under time pressure.The Offline Evaluation ResultsHere’s what the corrected analysis shows for this agent on the offline golden dataset.Scorecard SummaryThe headline: the agent is not ready to deploy. Tool precision and trace correctness are both well below threshold. But the hallucination rate is clean — the agent isn’t making up tools — which means the failure mode is under-specification rather than confabulation. That’s a more tractable problem to fix.Difficulty vs. AccuracyHard questions (60% trace correctness) outperform medium questions (33.3%). This is counterintuitive but explainable: the hard questions in this golden set tend to be more precisely scoped, while medium questions involve multi-step statistical reasoning where partial errors accumulate.Trace Quality and Tool Precision Are CoupledAcross the five questions with both trace and tool eval data, there’s a strong correlation (0.97) between average trace quality score and tool precision. Questions where the agent’s reasoning was rated high (≥ 3.0) had 100% tool precision. Questions where reasoning was mixed or low had 0–50% precision. This suggests fixing tool use is downstream of fixing reasoning — training on correct argument schemas alone won’t be enough.Category GapsMetric Selection and Guardrail Policy are the clearest gaps. Notably, Guardrail Policy failures are safety-relevant — an agent that misconfigures guardrails on a live experiment can allow seller GMV to erode unchecked.Failure Mode BreakdownOf the 9 tool call failures:- 8 involve missing required arguments (under-specification)- 2 involve extra/wrong arguments (over-specification)- 0 involve hallucinated tool namesThe dominant fix needed: training the agent to always provide complete argument sets for high-risk tools like configure_guardrails and recommend_next_steps.What’s Coming in Part 2Part 2 will cover online evaluation — what happens when you take this agent to live (simulated) traffic. That analysis covers:15 experiment runs with real outcome data, agent recommendations, and human expert decisions12 guardrail trigger events with severity, auto-stop actions, and false positive analysisMetrics including guardrail precision/recall, recommendation accuracy, SRM detection rate, and auto-stop latencyHow online failures relate to the offline patterns we found hereThe spoiler: the online picture is more nuanced. Some categories where the agent underperformed offline recover in production. Others don’t.Final ThoughtThe most interesting thing about this project isn’t any individual finding. It’s the workflow pattern: using AI to build the analysis, then using a different AI to verify it, then feeding corrections back into the source code.That loop — generate, verify, correct, regenerate — is something that took me a few hours across a conversation. Without the cross-verification step, I would have published an analysis with overstated extra-argument errors and understated tool precision for three categories. Small mistakes, but meaningful ones in a document whose whole purpose is measurement accuracy.If you’re building agentic evaluation systems, that cross-verification step isn’t optional. It’s part of the methodology.All data in this analysis is synthetic. Code, dataset and detailed analysis write up available at https://github.com/dvadera123/Agentic-System-Evaluation. Part 2 coming soon.Follow me for more on applied AI, data science tooling, and experiments at the edge of what these systems can actually do.Evaluating an AI Experimentation Agent for a Marketplace — What OpenAI’s Codex Got Right, What… was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.