Practical Guides · knowledge base from X
🤖 Automation with AI agentsFramework (no numbers)

Does your AI agent actually work? Eval-driven development in 5 steps (traces, graders, cases, runs, regressions)

Vibe-coding gets you a capable app, but you can't "vibe-test" it. Eval-driven development is test-driven development for agent behavior. You define what "correct" means, run the agent until it passes, and turn every important failure into a regression test. The guide covers the four building blocks shared by every tool (trace, grader, case, run) and the four grader families (deterministic, reference-answer, rubric, trajectory). It separates online from offline evals, explains "promoting" a production trace into a test case, and gives the 5-step loop with all-of-k thresholds. It ends with a skill that writes cases from plain language and a mapping table across LangSmith, Langfuse, Braintrust and Arize.

✍️ Alex Lieberman (Tenex) · @businessbarista
🔗 Read the original on X · X Article · published 5 Oct 2026
📊 307 likes · 826 bookmarks · 76k views
Summary and adaptation in English; content and results belong to the author.

Part of the manual Automation with AI agents — the complete manual

Claimed result

  • Posted by Alex Lieberman (@businessbarista, ~316k followers; co-founder of Morning Brew and of Tenex, an AI consultancy). The article is by the Tenex team (the post thanks @jake_klaris) and is part 1 of a series; the linked newsletter Ultrathink claims 40,000+ executives and builders as subscribers.
  • The post's thesis: "evals are the #1 thing keeping companies from becoming AI-native".
  • No financial result: it's a working method, with an illustrative numerical example (a refunds dataset of 40 cases: version v3 passes 36, a prompt change gets v4 to 39).

Proof: framework. A clear method consistent with industry practice (test-driven development, CI, regressions), written by a firm that sells these services; no client data.

The key idea

An eval is a grader run on a trace. No tool can tell you what your agent should do: you have to define it yourself. Eval-driven development (EDD) is TDD for agent behavior: 1. write down what "correct" means before you touch a prompt, an instruction or a skill; 2. run the agent and iterate until it passes; 3. every important failure becomes a regression test you rerun after every change, so you know if the failure comes back.

Tweaking prompts and trying a few inputs by hand "only gets you so far": evals get agents ready for deployment and keep them working once they're live.

Step-by-step playbook

1. The four building blocks (the same in every tool)

  • Trace: the full record of one agent run: input, every step, output. Example: a customer asks "Where is my refund?", the agent calls search_orders, then issue_refund, and replies "Refund sent, 3–5 days". Without tracing, evals are nearly impossible: if you don't have observability, start there.
  • Grader (also called evaluator or scorer): anything that scores how well the agent did, from a code check to an LLM acting as a judge.
  • Case (dataset item, example, test case): an input to test + the definition of "good" for that input. Cases live in a dataset; some carry a reference answer, others only say which graders to run. Example: the input "Where is my refund?" from a customer whose order #4821 has a pending refund, with the expected reply "Your refund for order #4821 has been issued and should arrive in 3–5 business days".
  • Run (experiment): every case in a dataset executed against one specific version of the prompt or agent. Each case produces a trace, each trace gets graded. A run is a snapshot: "version X scored Y on dataset Z". Comparing runs tells you whether a change actually helped (36/40 → 39/40, and you can see exactly which case still fails).

2. The four grader families (most setups run several on the same trace)

Grader How it works Refund example Pros / cons
Deterministic plain code, no model was issue_refund called exactly once, with the same order ID that was looked up? A double refund or the wrong order fails instantly cheap, fast, unambiguous: use it wherever you can
Reference-answer compares the output to the answer stored on the case, by exact match or with an LLM checking that the meaning matches does "Refund sent, 3–5 days" mean the same as the expected reply? needs an answer written in advance: live traffic doesn't come with one, so it mostly runs on test cases
Rubric (style, tone, diagnostics) an LLM judge scores the output against criteria, no reference answer needed is it concise? does it confirm what happened? does it say what to do if the refund doesn't show up? (that last criterion flags the example: that's the point) catches problems a reference answer misses; works on any trace, including production
Trajectory grades the steps, not just the final answer did it look up the order before issuing the refund? A run that refunds without checking, or calls search_orders twelve times, fails even if the reply reads perfectly slower and more expensive; the grader also has more ways to go wrong

LLM judges need checking too: a judge is just another prompt and can be wrong. Before trusting it, have a teammate label a few dozen replies as pass/fail and measure how often the judge agrees. If agreement is low, fix the rubric before its scores drive decisions, and recheck every time you change the judge.

3. Online and offline evals: you need both

The difference is where the trace comes from. - Online (watching production): a real user already used the agent, the trace exists and you grade it. Graders run automatically on real traces, often on a sample to keep LLM-judge costs down; the goal is to surface bad behavior. Production has no reference answers, so it relies on deterministic checks, rubrics, trajectory graders and user signals (thumbs-downs, retries). - Offline (in the lab, on demand or in CI, before shipping): nobody has run the scenario yet, so you need a case to trigger the trace. The goal is to test expected behavior and iterate on fixes safely; you can attach reference answers because you wrote the cases. - Online without offline: you see problems but can't fix them safely. Offline without online: you test the scenarios you imagined, not the ones users create. - The bridge between the two is promotion: a bad production trace becomes an offline case.

4. Where cases come from

  • Proactive: you define a behavior before you build it (also how you start with no traffic): write cases for the behavior you want and for the behavior you believe you already have. Example: when a customer asks about a pending refund, the agent should look up the order, issue the refund and say when to expect it.
  • Reactive: an online grader or a user flags a bad trace and you promote it to a case. Example: a real customer asked about their refund and the agent said it couldn't help → same input, correct behavior defined.

5. The 5-step loop

  1. Define the case and its pass criteria: write the input and attach graders (the reference-answer grader needs the expected answer, the rubric grader only its criteria).
  2. Run it and watch it fail. If it passes before any change, either the behavior already works or the case isn't testing what you think. For a promoted trace, this step also confirms you can reproduce the failure offline.
  3. Change the agent: prompt, model, instructions, tool descriptions, skills.
  4. Run it again; repeat 3 and 4 until it passes.
  5. Run the full dataset, not just this case, to catch regressions.

Decide up front what counts as a pass. The same input can pass once and fail the next time (non-deterministic LLMs), so one green check proves little. Run each case k times and set the bar: - all-of-k for high-stakes behavior where a single failure is unacceptable (e.g. refunding someone else's order): passing k of k doesn't prove it can't happen, but failing once proves it can; - n-of-k (e.g. 2 of 3) where some variance is acceptable.

6. Promoting a production failure into a case

  • Open the flagged trace (without tracing and online evals these are hard to find), copy its input into a new case, write down what good looks like: the bad output obviously isn't the reference answer, someone has to supply the right one.
  • Promoted traces are real user data: scrub anything sensitive before it lands in a dataset the whole team can read.

7. Make writing cases almost free

Every platform wants cases in a different format (JSON, CSV, UI). Build a skill that generates cases from natural language in your provider's format, to use with Claude or Codex. Two example requests: - proactive: "Create a case for when a customer asks for a refund on an order older than 90 days. The agent should explain the refund window and should not call issue_refund." - reactive: "Create a case from production trace {flagged_trace_id}. The agent said it couldn't help; it should have looked up the order, issued the refund and told the customer when to expect it."

8. Building the regression suite

A prompt change that fixes one case can quietly break others: if you only rerun the case you're fixing, you won't see it. Run the whole dataset on every meaningful change, ideally in CI, and compare to the last run. Over time every promoted incident becomes a permanent test: the dataset is the record of the ways your agent has failed and the check that those failures don't come back. The full loop: online evals find the problem → promotion turns it into a case → the loop fixes it offline → the growing dataset keeps it fixed.

9. What a team starting out needs to know

  • Deciding what good looks like is the real work. Write down expected behavior before you build, including behavior you think already works: you'll often find it doesn't.
  • Make creating cases almost effortless: if promoting a failure means several screens and hand-written JSON, people skip it and the dataset stops growing. One click to promote a trace, one box to write the expected behavior, the case-writing skill.
  • Grade the path early: an agent that takes 30 turns to do what one well-chosen tool call could do may still give a perfect answer, and an output-only grader will never flag it. Add at least one trajectory check from the start.

10. The platforms are the same model under different names

Platform Case Grader Run Production → dataset
LangSmith example evaluator experiment online evaluators via rules; failing traces added straight to a dataset
Langfuse dataset item score (result) experiment (formerly "dataset run") LLM judges on live traces; traces added straight to a dataset
Braintrust record scorer experiment (production traces are "logs") online scoring rules with sampling and filters; logs promoted to the dataset
Arize (AX and open-source Phoenix) example evaluator experiment production spans added straight to datasets
All of them support promotion in some form, because the production → dataset path is the core of any eval setup. Names change fast: check current docs before choosing.

11. The stated limit (parts 2 and 3 of the series)

The whole model assumes you can recreate a trace offline. For a simple prompt you can; for an agent that reads from or writes to real systems, often you can't: - State of the world: when the refund trace ran, search_orders said order #4821's refund was pending; rerun a week later the refund has already gone through, the agent takes a different path and the trace can't be reproduced. - Real writes: issue_refund moves real money; you need to grade offline how the agent handles refunds without refunding real orders on every CI run (intercepting writes).

Tools and costs

  • Eval tools mentioned: LangSmith, Langfuse, Braintrust, Arize (AX and open-source Phoenix). No prices given.
  • Coding agents (Claude, Codex) for the case-writing skill.
  • CI to run the dataset on every change.
  • Costs to watch: LLM judges on online traces (hence sampling); trajectory graders are slower and more expensive; each case should be run k times.
  • A free introductory guide from the same team: "Due Diligence: Your First Agent Eval" (tenex.co).

Limitations

  • A framework without data: no client metrics; the 36/40 → 39/40 example is illustrative.
  • Written by an AI consultancy that sells these services and promotes its own newsletter.
  • It doesn't solve (it defers to parts 2 and 3) the two hardest problems of real agents: reproducing the state of the world and intercepting writes that move money or data.
  • LLM judges cost money and can be wrong: without checking agreement against human labels, scores can drive bad decisions.
  • Platform names and features change quickly: the mapping table needs rechecking.
← More guides in “Automation with AI agents”