How an eval works
Levels, steps, routes and endings, the states a result can be in, versions and production, when traffic is scored, and what evals read from your traces.
An eval is a small graph at one level of your traffic. A trace enters at the top, each step answers one typed question, the answer picks a route, and the walk stops at a named pass or fail. This page explains each of those parts once.
Levels
Every eval scores one level, chosen when you create it and fixed after that.
Run
One execution of your agent: the question it got, the answer it gave, and every span inside.
Did it answer the question? Did it invent numbers? Was it too slow?
Span
One step inside a run: a model call, a tool call, a retrieval.
Did this SQL call succeed? Were the tool arguments valid? Was the completion cut off?
Conversation
A whole thread: every run that shares a conversation id, scored again as it grows.
Did the user get what they came for? Did they have to repeat themselves?
An eval reads upward, never sideways. A span eval sees its span, the run it belongs to, and a summary of the run's conversation. A run eval sees the run, all of its spans, and its conversation. A conversation eval sees every run in the thread and their spans. Something a level can't see is not offered in the editor, and reading it from Python raises an error that names it.
Steps and routes
Each step answers in a declared shape. You set the shape on the step's Output tab, under This step returns:
| Shape | Example | Routes |
|---|---|---|
| True / false | ok = true | One for True, one for False |
| Number, from a minimum to a maximum | score = 0.82 on 0 to 1 | Ranges: below 0.5, 0.5 to 0.8, 0.8 and up |
| One of a few options | coverage = partial | One per option |
A Human review step returns one of its options or a rating, a decision model one outcome per question, and a Score spans step one outcome per check. Their shapes follow from their settings.
Each route goes to a step on the canvas, + New pass verdict, + New fail verdict, or + Insert a step here…. Every step has an Otherwise for anything left. A route can never lead back to an earlier step, so every walk ends.
- PythonGather tool results
found = has_evidencehas_evidence → Rests on the tool results - Decision modelRests on the tool results
grounded = no · 91% sureno → Invented claims - Fail · Invented claims
HALLUCINATION
The steps a trace walked is its path, shown on every result as step names joined by arrows: Write tools → What the reply says → Combine.
Ranges
Ranges can't overlap: a value that fits two ranges could go two places, so the eval can't be saved until you fix it. Gaps are allowed: a value no range covers goes to Anything else. Click ≥ or > (and ≤ or <) to include or exclude an end; Add a range splits one.
Several outputs
A Python step or a judge can return more than one field, such as {"score": 0.7, "tone": "ok"}. Its routes are then conditions, and the first one that matches wins: score ≥ 0.8 → …, tone is one of rude, cold → …, otherwise → …. Put the specific conditions first.
Endings
A walk stops at an ending. Its panel has:
| Setting | What it does |
|---|---|
| Name | Shown on every result, trace view and chart. Name it for the outcome and the way there: Grounded (judged), Claimed a change that did not happen. |
| Verdict | Pass or Fail. |
| Reason code | Fail only. A short UPPER_SNAKE tag, such as HALLUCINATION, that results are grouped, searched and alerted on by. |
| Display score | Optional. A number from a step on every path to this ending, usually a judge's, shown beside the verdict: Fail · 0.31 · HALLUCINATION. |
Four paths that all end at one ending called "Pass" tell you nothing afterwards. Give each way through its own ending, and the charts show how much each step is doing.
Result states
Every trace an eval scores gets a result:
| State | Meaning |
|---|---|
| Pass / Fail | The walk reached an ending. Only these count toward a pass rate. |
| Waiting | The walk reached a Human review step and is in the grading queue. Grading it finishes the walk. |
| Errored | A step could not run: Python raised, a judge's provider refused the call, a decision model had nothing to read. An errored result is never a pass or a fail, and it says which step failed and why. See errors. |
| Skipped | The walk started but was not scored, for example a spot check that reached a Human review step. It counts as neither. |
Some traffic gets no result at all: traces the eval's filters don't match, traces outside its sample, a trace it already scored, and anything over your plan's limit. Those cost nothing.
Versions and production
Every change to what an eval does is a new version. Saving asks what changed and writes v2, v3, v4. A version is never edited after it is saved. One label, production, says which version scores new traffic, and moving it is its own step, so you can save, test and ship separately. Name, description, on or off and sampling change in place and are not versions. See Test, version, ship.
v2 is saved. Nothing changes yet: v1 still scores every new run.
When traffic is scored
Only evals that are on score new traffic, each with its production version.
| Level | Scored |
|---|---|
| Run | When the run finishes. A run closed with endRun is scored once its spans have stopped arriving for 10 seconds, and never later than 60 seconds after the end, so spans still on their way from other workers are included. |
| Span | As each span is recorded. |
| Conversation | 15 seconds after the latest run in the thread, and again each time a new run joins. A thread that never goes quiet is still scored within 10 minutes. A conversation's verdict is always about the whole thread so far. |
What evals read from your traces
There is nothing to install for evals: they read the traces your agent already sends. An eval can only check what a trace contains, so these fields matter:
| Field | Used by | Set it with |
|---|---|---|
| Agent name | Scoping an eval to one agent | The name you give wrapAgent |
| Run input and output | Judges, decision models, Python, transcripts | run.setInput(...), run.setOutput(...) |
| Conversation id | Conversation evals, t.conversation | conversationId on wrapAgent (Python: conversation_id) |
| Span kind and name | Span evals, span filters, Spans variables | Set for you on framework calls; kind on manual spans |
| Span input and output | Tool and retrieval evidence | Set for you, or span.setInput(...) / span.setOutput(...) |
| Metadata | Filters (per customer, per plan), Python | run.setMetadata({...}) |
| Status and errors | Tool and model health checks | Set for you; errors you throw are recorded |
| User feedback | Evals over what users disliked | Feedback |
A few habits make evals sharper:
- Set the output to the answer the user saw, not the whole message list.
- Put your evidence in spans. A retrieval whose documents never reach a span can't be checked.
- Use span kinds.
tool,retrievalandllmlet one eval cover every tool without naming each; the templates rely on them. - Report tool failures honestly. A tool that returns
{"error": "..."}inside a successful span looks fine on dashboards. Throw, or set the span's error. - Send a conversation id for anything multi-turn, so an eval can ask whether the user got what they came for.
Your first eval
From a template to verdicts on live traffic: pick a template, adapt it, test it on a real trace, turn it on, and read the results.
Designing triage evals
Decide the easy cases cheaply and send only the hard ones to a judge or a person: which step to use for what, the four shapes good evals take, and how spot checks keep the cheap steps honest.