# Experiments as traces and regression suites

**Last updated:** 2026-11-26T03:19:02-03:00 (UTC-3)

An experiment item is one trace: the item's model call and every judge that scored it, nested, with the cost of each from the request log. Datasets keep a version history you can read, compare and restore; a past run can be judged again; a regression suite turns a dataset into a gate a CI job passes or fails.

| Flag | What it turns on | Requires |
| --- | --- | --- |
| `experiment_traces` | Traced experiment runs, dataset version history with diff, notes and restore, item provenance and **Add to dataset** from a span, a run on an older version, judging a past run again with an estimate, the `experiment_finished` alert event and the alert rules of the `experiments` signal, the experiments an alias serves | `evaluation_tracing` (and `span_store` to store the spans) |
| `regression_suites` | Suites of assertions over a dataset with trials, a pass threshold and a minimum pass rate, and their CI verdict through the public API | `experiment_traces` (and `evals_public_api` for the CI routes) |
| `remote_experiments` | Runs whose items the team's own endpoint executes, signed and behind the outbound URL guard | `experiment_traces` |
| `experiment_summaries` | A generated summary of compared runs through the chat alias each team chose | `experiment_traces` |

With `experiment_traces` on, runs also take trials, sessions and per-session judges, split their cost into task and judges, and two item traces compare side by side.

Both flags are off by default and are tenant flags: with [plan entitlements](/docs/features/feature-access/) a team gets them only when its plan includes them. With a flag off nothing of what it adds is computed or stored, and its routes answer `404 feature_disabled`.

## An item is one trace

A run created while `experiment_traces` is on for the dataset's team is **traced** (`traced: true` on the run):

- each item's model call (request ID `eval.<run>.<item>`, origin `experiment`) is the root of its own trace;
- each evaluator that judges the item is a `judge` span, a **child** of the item's request span, and the judge's own requests are children of that judge span: a 4-item run with two evaluators is 4 traces, not 12;
- the run item records `trace_id`, `span_id` (its request span) and `item_version` (the version of the dataset item it ran);
- the item's request span carries `experiment_run_id`, `experiment_dataset_id`, `experiment_item_id`, `experiment_dataset_version` and `experiment_item_version` (and `experiment_suite_id` for a suite run, `experiment_ci_traceparent` for one a CI started) as attributes, so the trace joins its dataset item;
- the trace page shows an **Experiment item** box with the run, the dataset item, the dataset and item versions and the expected output, and links to the run and the item;
- each result keeps the item's trace and span as its target and the same trace as its judge trace; its judge cost is read from the ledger rows of its own judge requests.

Runs created before the flag, or with it off, keep one trace per call, as they were; they are never rewritten. Sampling never drops part of an item: the span store keeps or drops the whole trace.

The experiments list shows, per run, its items and errors, its average latency, its cost and one column per evaluator (pass rate with pass criteria, else mean, else its labels), and a **chart across runs** of an evaluator, the cost or the latency (line or bars; a categorical evaluator as stacked bars with a legend). A comparison adds the **configuration** of each run (model, prompt revision with a link, dataset version, evaluator versions; **Differences only**), and a **Score matrix** layout. In a run's detail, select items and **Run evaluator** judges only those.

From a run, **Traces of this run** opens Traces with `origin:experiment request_id:"eval.<run>."*`, and `GET /api/v1/admin/evals/runs/{id}/traces` lists the item traces and that query. Each item of the run detail and of a comparison links to its trace.

**Cost.** The run's and each item's cost are read from the request log, as before: an item's cost is its model call plus its judge calls, and the run's is the sum. A traced item's trace totals include its judges (they are its spans).

## Dataset versions

With the flag, every write of a dataset is **one version**: an item saved in the console, a CSV import, items added from captures, by a review automation or from spans, an archive, a restore. A write of many items is one version, at one instant; writes made before this release opened one version per item they wrote. (Since this release a batch write takes one instant whatever the flag, so a read as of any instant sees all of a batch or none of it.)

The dataset page shows the version chip (`v7 latest`, or `as of …` while you view an older one) and:

- **Version history**: each version, newest first, numbered from the oldest, with `+added ~changed −removed`, the number of items after it, who made it, through what (`manual`, `csv`, `capture`, `span`, `restore`) and its note. **Diff with v6** lists each item added, changed or removed, with the fields that changed and both values. **View items** shows the dataset as of that version; **Run experiment** opens a new experiment on it; **Add note** names a version (a tag such as `golden-2026-11`, or what changed; at most 500 characters).
- **History** of an item: its versions with source, author and the source span, **Restore this version** (writes it as a new current version: history is never rewritten), and the runs that ran it, each with its trace.
- Items show their source and, for an item added from a span, a **Source span** link. A search finds items by content, or by a metadata value (`metadata.region:eu`); one line per metadata key shows up to six keys.
- The datasets list adds **Versions**, **Experiments** and **Last run**; **Experiments** on the dataset page lists the experiments of that dataset.

A note travels with the write: `note` in the body of `PUT /api/v1/admin/evals/datasets/{id}/items/{item}`, `?note=` on the CSV import, `note` on Add from spans.

**Run an older version.** `dataset_as_of` in `POST /api/v1/admin/evals/runs` (an instant of the history, as `versions[].at` gives it) runs the items valid then; the run's `dataset_as_of` is that instant and each item records the version it ran. The **Dataset version** picker of **New experiment** sets it. Without the flag the field is refused (`400`).

**Default names.** With the flag a run may be created without a name: it is named after its dataset and the UTC time (`capitals · 2026-11-26 03:10:00`). **New experiment** shows a review of what will run (prompt revision or item input, alias, dataset version and its item count, evaluators with their version and health, name) before **Start**, and **Check items** (`dry_run: true` on `POST /api/v1/admin/evals/runs`) counts the items whose input renders with the prompt's variables, lists the others (they would fail without calling the model) and estimates the judges' spend.

**Export and import.** The dataset page exports the items shown (the latest, or a version you are viewing) as CSV or JSON; the import takes a CSV or a JSON array of `{id, input, expected_output, metadata}` (the export's format: a round trip writes the same items), up to 1,000 items, one bad item rejecting the whole file.

## Add to dataset from a span

**Add to dataset** on a trace (and on the selected traces of the Traces list) adds the captured request of the selected span to a dataset of the span's team. With the flag, the dialog maps the fields and previews the first item:

| Field | Options |
| --- | --- |
| Input | The conversation (`messages`, the default) or the text of its last user message (`last_user`) |
| Expected output | The captured answer (default), or nothing |

The capture is read exactly as **Add from captures** reads it: the sent view, audited, only for readers with `content_sent:read` of the team, and only a capture meant for evaluation. The item is `span-<span_id>`, with `source: span`, `source_trace_id` and `source_span_id`, and its metadata names the request, trace, span and model. `POST /api/v1/admin/evals/datasets/{id}/items/from-spans` takes up to 100 spans; `dry_run: true` answers the items without writing them.

## Judge a past run again

Select finished runs and choose **Run evaluator** (or **Run evaluator** in a run's detail) to judge their completed items with evaluators of the run's team:

1. Pick the evaluators. **Estimate** shows, for every run, the items and judge calls and the expected spend, from each evaluator's average judge cost of the last 7 days in the request log; an evaluator with no priced history makes the estimate partial or unavailable. Code evaluators cost nothing.
2. **Run evaluation** starts a background job per run, leased like a run, so a restart or another replica resumes it.

Each result keeps the deterministic ID of its run, item and evaluator: judging again **replaces** the earlier result of that evaluator, so each item ends with one valid result per evaluator. The judge calls are the run's own (principal `eval:<run>`), with request IDs `<item request>.judge.<evaluator>.r<evaluation>.<attempt>` apart from the first judge's, and count in its cost and in the evaluator's 7-day cost. A run evaluation resumed after a restart judges only the pairs it had not judged yet: no judge call is paid twice. In a traced run the new judges nest in the item's trace. The evaluators join the run's evaluator list.

Experiments are judged in full: an evaluator's live sampling rate never applies to an experiment or a run evaluation, and the run shows how many results each evaluator produced.

## Experiment finished alert

With the flag, a run that reaches `completed`, `failed` or `canceled` records **`experiment_finished`** once (the run is the deduplication key) when an enabled alert channel subscribes to it. Its detail carries `run_id`, `name`, `team`, `organization`, `status`, `dataset_id`, `dataset_as_of`, `dataset_version`, `model`, `prompt_id` and `prompt_revision`, `items`, `done`, `failed`, `duration_ms`, `scores` (each evaluator's mean, pass count and results) and, for a suite run, `suite_id` and `verdict`.

Alert rules of the **`experiments`** signal (realtime only, no backtest) match each finished run of their own team or organization, filtering on `team`, `status`, `dataset_id`, `model`, `suite_id`, `verdict`, `items`, `failed` and `duration_ms`. See [alert rules](/docs/features/alert-rules/).

## Experiments of an alias

With `alias_evaluator_usage` and `experiment_traces`, the model editor's **Used by experiments** lists the runs whose target or one of whose judges is the alias, in the teams you read evaluations of, beside the evaluators that judge through it.

## Trials

`trials` on `POST /api/v1/admin/evals/runs` (1–10, the **Trials per item** field of New experiment) runs each item that many times; an item's `metadata.trials` overrides it (only when the run sets `trials`, so a dataset that happens to carry the key runs as before). Each trial is a run item `<item>:t<n>`, its own trace. The run detail shows, per item, each evaluator's mean and spread (standard deviation) over the trials, its passing trials, **pass@k** (at least one trial passed) and **pass^k** (every trial passed), and per evaluator the share of items passing at least once and every time (`GET /api/v1/admin/evals/runs/{id}/trials`). A trial that errored has no score: it counts as failing for pass^k and is left out of the mean and the spread, which is the population standard deviation of the scored trials. A comparison pairs the same trial of each run.

## Sessions

When the run asks for sessions (**Run sessions as conversations**, `sessions: true`, implied by `session_evaluator_ids`), items that carry `metadata.session_id` (1–64 letters, digits, `.`, `-` or `_`) form a session: they run in turn order (`metadata.turn`, then the item ID) as one conversation, through the run's prompt when it has one, each call carrying the turns before it (the earlier items' messages and answers), with `X-Gateway-Session-Id: exp-<run>-<session>`, so Traces → Sessions shows each conversation. With trials, each trial is its own session (`<session>:t<n>`). **Judge each session** (`session_evaluator_ids`) runs evaluators on each session as a whole: `{{input}}` is the conversation, `{{output}}` its last answer, `{{expected}}` the last item's expected output; the result targets the session (`exp:<run>:<session>`) and its judge calls count in the run's cost. A session is judged once all its items ran; a run resumed after its items finished still judges the sessions not judged yet. A remote run takes no sessions: its endpoint receives each item's `session_id` and keeps the conversation itself. The run detail and `GET /api/v1/admin/evals/runs/{id}/sessions` list the sessions, their items in order and their results.

## Task cost and judge cost

The run and each item show their cost in two parts beside the total: **Task** (the item calls) and **Judges** (every judge call, per-session judges included), in the experiments list (Task cost, Judge cost), the run detail, the comparison (Task · judges) and the API (`task_cost` and `judge_cost`, with the same `state`, `known_usd`, `requests` and `unvalued_requests` as `cost`), under the same visibility as the cost.

## Two traces side by side

In a comparison, **Compare traces** on an item opens the traces of two runs side by side: their spans aligned by kind and name in order (the longest common sequence, so an extra span on one side leaves the rest paired), each with its duration and tokens (a span only one trace has stays on its side), and each side's results.

## Comparison summaries

With `experiment_summaries`, **Summarize the comparison** generates a few sentences on 2–5 compared runs through the chat alias the team chose (`PUT /api/v1/admin/evals/summary-settings/{team}`; there is no default, and a team without one is asked to choose). The estimate (input tokens, and the maximum cost when the alias is priced) comes first; then **Generate summary** makes one `experiment_summary` helper call of the team, recorded and priced like every call (`POST /api/v1/admin/evals/compare-summary`, `dry_run` for the estimate). The call carries only the runs' figures (items, failures, latency, each evaluator's mean, pass rate, the labels of categorical and boolean scores and its improved and regressed items against the baseline), never an item's input, output or captured content, and the summary is not stored.

## Remote experiments

With `remote_experiments`, a run can be **Executed by** one of the team's remote endpoints instead of a model alias: the gateway sends each item (or a batch) to the team's own service, which runs its application and returns the output; each output becomes the item's trace (a root span `remote <endpoint>` with the judges nested) and is judged like a model's answer.

An endpoint (**Remote endpoints** on the Experiments tab, `POST /api/v1/admin/evals/remote-endpoints`) has a URL (absolute, with no credentials, query or fragment: the signature authenticates the gateway), a mode, how many items one call carries, its timeout, retries and concurrency. The calls are `POST` with `{run_id, run_name, dataset_id, mode, items: [{item_id, input, expected_output, metadata, session_id, trial}]}` and the headers `X-Gateway-Signature: t=<unix>,v1=<hex HMAC-SHA256 of "<t>.<body>">` (the endpoint's signing secret, shown once when it is created or rotated, stored encrypted), `X-Gateway-Run-Id` and `Idempotency-Key`. A call answered 408, 429 or 5xx, or not answered, is retried with backoff up to the endpoint's retries; the `Idempotency-Key` is the same for the same items of the run. A run executes the endpoint as it was when the run started (URL, mode and bounds), signed with its current secret; removing the endpoint, or the team losing `remote_experiments` or `experiment_traces`, stops the run. An empty output with no error counts as an error.

- **sync**: the endpoint answers `{"outputs": [{"item_id", "output", "error", "latency_ms"}]}`.
- **callback**: it answers 2xx at once and later posts the outputs to `POST /v1/eval-remote/runs/{run}/items` with `Authorization: Bearer <run token>` (answered once when the run is created); items with no output within `callback_wait` fail. Only items already sent are accepted, each once; a run resumed after a restart does not send again the items sent within `callback_wait`.

Every call goes through the outbound URL guard: https only (plain http only to loopback with `allow_loopback_http`), each DNS answer checked and the checked address dialed, no private address outside `allowed_private_cidrs`, no redirect followed. The bounds live in the configuration file:

| Key | Default | What it is |
| --- | --- | --- |
| `evaluation.remote_experiments.timeout_ms` | 30000 | The deadline of one call when the endpoint sets none (1000–600000) |
| `evaluation.remote_experiments.max_timeout_ms` | 120000 | The longest deadline an endpoint may set |
| `evaluation.remote_experiments.max_retries` | 2 | The most retries an endpoint may set (0–10) |
| `evaluation.remote_experiments.max_concurrency` | 8 | The most calls one run makes to its endpoint at a time (1–64) |
| `evaluation.remote_experiments.max_batch_items` | 20 | The most items one call carries (1–100) |
| `evaluation.remote_experiments.callback_wait` | 10m | How long a callback run waits for posted-back outputs (1m–24h) |
| `evaluation.remote_experiments.allowed_private_cidrs` | none | Private prefixes an endpoint may resolve to; every other private address is refused |
| `evaluation.remote_experiments.allow_loopback_http` | false | Lets an endpoint on localhost use plain http, for local tests |

## Regression suites

A suite runs a dataset of its team against an enabled chat alias (optionally a prompt revision) and asserts what every item must keep passing.

| Field | What it is | Default |
| --- | --- | --- |
| `assertions` | 1–20 assertions: an evaluator of the team with pass criteria (`evaluator_id`; it passes when its result is assessed pass), or a sentence (`text`) judged true or false by `judge_model` | — |
| `judge_model` | The chat alias that judges sentence assertions | — |
| `runs_per_item` | Trials per item, 1–5 | 1 |
| `pass_threshold` | Trials that must pass every assertion for the item to pass | `runs_per_item` |
| `min_pass_rate` | The share of passing items the suite needs, 0–1 | 1 |

An item adds up to five assertions of its own, and may override the trials, in its metadata:

```json
{"assertions": [{"name": "names a city", "text": "The answer names a city"},
                {"name": "exact", "evaluator": "exact-match"}],
 "execution_policy": {"runs_per_item": 3, "pass_threshold": 2}}
```

A suite run is a traced experiment run that names the suite (`suite_id`) and keeps a snapshot of it; with more than one trial each trial is a run item `<item>:t<n>`. Its verdict:

| Verdict | Exit code | When |
| --- | --- | --- |
| `passed` | 0 | The run completed and its pass rate reached `min_pass_rate` |
| `failed` | 1 | The run completed below `min_pass_rate` |
| `error` | 2 | The run failed or was canceled |
| `running` | none | Still running: poll again |

The verdict lists each assertion's passes over its judged results and each failing item with its passing trials and the assertions it failed.

The **Suites** tab of Evals creates and edits suites, runs one and shows each run's verdict. Edits bump the suite's version; earlier runs keep the snapshot they ran.

### In CI

With `evals_public_api`, a key of the suite's team runs it:

```sh
run=$(curl -fsS -X POST "$GATEWAY/v1/eval-suites/$SUITE/runs" \
  -H "Authorization: Bearer $KEY" -H "traceparent: $TRACEPARENT" | jq -r .run_id)
while :; do
  v=$(curl -fsS "$GATEWAY/v1/eval-suites/runs/$run" -H "Authorization: Bearer $KEY")
  code=$(echo "$v" | jq -r '.exit_code // empty')
  [ -n "$code" ] && { echo "$v" | jq .; exit "$code"; }
  sleep 5
done
```

`POST /v1/eval-suites/{id}/runs` needs `evals:write`; `GET /v1/eval-suites/runs/{run}` needs `evals:read`. A suite or run of another team answers `404`. A valid `traceparent` on the start is recorded on every item's request span as `experiment_ci_traceparent`: each item keeps its own trace, and the CI job's trace finds them by that attribute, with no agent.

A suite run's results are its verdict: it is not judged again (run the suite again), and only each judge's own result decides an assertion, never another result of the same name (a reviewer's, an API score).

## Permissions and tenancy

Reads need `evals:read`; dataset writes, restores, version notes, judging a past run again and managing or running suites need `evals:manage` over the team. Datasets and suites belong to their team; runs, their items, run evaluations and `experiment_finished` belong to the organization the run was recorded in: another organization reads none of them, and an alias lists only the runs of your teams.

## Admin API routes

| Route | What it does |
| --- | --- |
| `GET /api/v1/admin/evals/datasets/{id}/versions` | The dataset's versions, newest first, with what each changed, who made it and its note; `limit` (1–500, default 500) bounds how many are listed |
| `POST /api/v1/admin/evals/datasets/{id}/version-notes` | Names a version with a note; an empty note removes it |
| `GET /api/v1/admin/evals/datasets/{id}/diff` | The items added, changed or removed between two versions (`from`, optional `to`) |
| `GET /api/v1/admin/evals/datasets/{id}/items/{item}/history` | An item's versions and the runs that ran it, with their traces |
| `POST /api/v1/admin/evals/datasets/{id}/items/{item}/restore` | Writes an earlier version of an item as its new version |
| `POST /api/v1/admin/evals/datasets/{id}/items/from-spans` | Adds the captured requests of spans to the dataset, with the field mapping and a dry run |
| `GET /api/v1/admin/evals/runs/{id}/traces` | The traces of a traced run's items and the query that lists them |
| `GET /api/v1/admin/evals/runs/{id}/evaluations` | The run's evaluations again, newest first |
| `POST /api/v1/admin/evals/runs/{id}/evaluations` | Judges the run's completed items again with evaluators, or answers the estimate with `dry_run` |
| `POST /api/v1/admin/evals/runs/{id}/evaluations/{evaluation}/cancel` | Stops a run evaluation; results already written stay |
| `GET /api/v1/admin/models/{id}/experiments` | The runs whose target or judge is the alias |
| `GET /api/v1/admin/evals/suites` | Lists the regression suites of your teams |
| `POST /api/v1/admin/evals/suites` | Creates a regression suite with its assertions, trials and thresholds |
| `GET /api/v1/admin/evals/suites/{id}` | A suite and its last runs with their verdicts |
| `PUT /api/v1/admin/evals/suites/{id}` | Changes what a suite runs and asserts; its version goes up |
| `DELETE /api/v1/admin/evals/suites/{id}` | Removes a suite; its runs stay |
| `POST /api/v1/admin/evals/suites/{id}/runs` | Starts a run of a suite |
| `GET /api/v1/admin/evals/suite-runs/{run}` | The verdict of a suite run |
| `GET /api/v1/admin/evals/runs/{id}/trials` | Per item, its trials' mean, spread, pass@k and pass^k per evaluator |
| `GET /api/v1/admin/evals/runs/{id}/sessions` | The run's sessions, their items in order and their session results |
| `GET /api/v1/admin/evals/remote-endpoints` | Lists the remote endpoints of your teams and the configured bounds |
| `POST /api/v1/admin/evals/remote-endpoints` | Creates a remote endpoint and answers its signing secret once |
| `PUT /api/v1/admin/evals/remote-endpoints/{id}` | Changes a remote endpoint's URL, mode and bounds |
| `DELETE /api/v1/admin/evals/remote-endpoints/{id}` | Removes a remote endpoint; its runs keep a snapshot |
| `POST /api/v1/admin/evals/remote-endpoints/{id}/rotate-secret` | Answers a new signing secret once; the old one stops at once |
| `GET /api/v1/admin/evals/summary-settings` | The summary alias each of your teams chose |
| `PUT /api/v1/admin/evals/summary-settings/{team}` | Chooses the team's summary alias, an enabled chat alias |
| `DELETE /api/v1/admin/evals/summary-settings/{team}` | Removes the team's summary alias, and summaries with it |
| `POST /api/v1/admin/evals/compare-summary` | Estimates or generates the summary of compared runs |

The full contract is in the [API reference](/docs/api/).

## Known limits

- A judge nested in an item's trace is costed from its own judge requests; a call a judge request makes itself under another request ID (a guardrail, a summary) is in the trace and in the run's cost, but not in that result's judge cost.
- Versions written before this release are one version per item they wrote, and have no author or note; an edit made then shows as two versions, the old row's removal and the new row's addition.
- The console reads at most 500 versions of a dataset and 200 runs of an item.

## See also

- [Evals](/docs/features/evals/): datasets, evaluators, experiments and comparison.
- [Sessions and users](/docs/features/sessions-and-users/): the sessions page the experiment sessions appear on.
- [Judge calls as linked, labelled traffic](/docs/features/evaluation-tracing/): judge spans, origins and judge cost.
- [Evaluation results](/docs/features/evaluation-results/) and [alert rules](/docs/features/alert-rules/).
