Evaluators
Last updated: 2026-11-26T07:53:40-03:00 (UTC-3)
An evaluator is a judge the gateway runs for you: a model call (an LLM judge or a decision model), your own JavaScript function (a code evaluator), or a ready deterministic rule. It reads a span, a trace or a session and writes an evaluation result on it. An evaluator owns everything about where it runs:
- its scope: one span, a whole trace, or a whole session;
- its filter, written in the gateway’s query language, and its sampling;
- its status: draft, active, paused or disabled;
- its versions: every save is a version with a readable spec, two versions compare side by side, live traffic runs the published version, and an old version can be restored;
- a test pane that runs the judge on real traffic before anything is published, and a preview of how much traffic the filter selects and what judging it costs per week;
- a daily cost ceiling;
- with
code_evaluators: code evaluators, a template library, and runs on chosen traffic (Evaluate selection, a query over past traffic, a run on one trace).
Turn it on
Section titled “Turn it on”features: evaluators: true # off by default code_evaluators: true # off by default; code, the library, runs on chosen trafficBoth flags are tenant actions. evaluators requires evaluation_tracing, trace_query, span_store and eval_capture (and what those require: evaluation_results, evals, request_logs); code_evaluators requires evaluators. The gateway refuses to start with a flag on and one of its requirements off. With plan entitlements, a team gets each when its plan includes it.
With evaluators off, the Evaluators tab says so; evaluators defined through the API still judge experiment runs, and nothing runs on live traffic.
Before you turn it on, check that content capture keeps what a judge reads. A judge reads the captured request and answer. Set the team’s content capture policy with the purpose evaluation for the traffic you want judged. A target whose content was not captured is not judged: it gets a skipped result with the reason content_not_captured, no judge call and no cost. A code evaluator that reads only span facts (its source names no input, input_text, output, tools, expected, traces or transcript) needs no capture.
Scopes and when a run happens
Section titled “Scopes and when a run happens”| Scope | One run judges | The filter is a query of | The run starts |
|---|---|---|---|
span (default) |
one span: usually a request (span.kind:request), or any other span kind |
spans | evaluation.span_delay after the span is stored (5 s by default) |
trace |
the whole trace: {{input}} is its first request, {{output}} the answer of its last one |
traces | once the trace stayed without a new span for evaluation.trace_idle (3 min by default) |
session |
the whole session: its captured turns in order | traces (a session is in scope when one of its traces matches) | once the session stayed without a new span for evaluation.session_idle (30 min by default) |
A span the store does not keep is not judged: when a trace already holds spans.max_spans_per_trace spans, the spans of its later requests are left out of the store (and counted as dropped_trace_limit), and no evaluator run is queued for them.
A trace or session run waits: every new span of the trace or the session pushes the pending run forward by the idle window, counted from when the span is stored. While it waits, the trace detail shows the run as Pending · up to N min. A span that arrives after the run is not judged again: one run per evaluator version and target. Publishing a new version while runs are waiting hands them to the new version; pausing the evaluator drops them, and the next span of the trace or session after a resume queues the run again.
Each evaluator can override its idle window (trace_idle_seconds, session_idle_seconds, 5 to 86400). With session_explorer on, an application that knows a conversation ended calls POST /v1/sessions/{id}/close (key with scores:write) and the session’s waiting runs become due at once; see sessions and end users.
Only client traffic is judged by default (runs_on: live, origin app). runs_on: experiments judges the traffic of experiment runs, both either. A judge run, an evaluator test, a replay, a helper call and a shadow copy are never judged, whatever the filter says.
The filter and sampling
Section titled “The filter and sampling”Request tags, the key, the session and the end user are facts of the request span: a filter on another span kind (span.kind:provider_attempt span.final:true) selects by that span’s own facts.
The filter is one query: span.kind:request tag.env:prod model:chat-default -cache:hit for a span evaluator, tag.env:prod trace.errors>=1 or child.span.kind:tool for a trace or session evaluator. Every field of the query language is available except evaluation results and text search. A span evaluator’s filter reads the span itself: child. and parent. terms belong to trace and session evaluators, which see the whole trace. The same query on Observability → Traces lists what the evaluator would judge: the editor’s View matching traffic opens it.
Evaluators targeted at a topic
Section titled “Evaluators targeted at a topic”With Topics on, a filter may hold a topic term: span.kind:request topic.intent:"Request a Refund" for a span evaluator, topic.intent:"Request a Refund" trace.errors>=1 for a trace evaluator. A topic is known only once Topics has read the unit (a trace or a session) and assigned it, minutes after the traffic: such an evaluator queues nothing when a span is stored, and its runs are queued when a live map assigns the unit, due at once.
| Scope | Runs queued on an assignment |
|---|---|
span |
each span of the unit’s traces its filter matches, with the unit’s topics |
trace |
each trace of the unit; the whole filter, topic term included, is checked when the run starts, and a trace outside it ends not_in_scope |
session |
the unit’s session, checked the same way |
The topic term reads the live maps of the evaluator’s team and of its organization. The preview, the test pane and a backfill read the same assignments, so a backfill reaches the units already assigned. A topic term needs topics: an evaluator saved with one while Topics is off is refused. Create evaluator on a topic opens the editor with the draft prompt and the topic term added to the default filter; nothing is saved until you save.
A judge that calls a model is never published without a filter; a code or rule evaluator, which calls none, may run on every span. A new span judge starts with span.kind:request origin:app capture:evaluation.
sample_rate (greater than 0, at most 1) is the share of the matching targets judged. The choice is a keyed hash of the target per evaluator version: every replica decides the same for a target, so a target is never judged twice.
Variables
Section titled “Variables”The prompt reads the target through variables:
| Variable | Scope | Value |
|---|---|---|
{{input}}, {{output}} |
all | the captured input and answer (span: the request’s own; trace: first request’s input, last request’s answer; session: first turn’s input, last turn’s answer) |
{{tools}} |
span, trace | the tools the judged request offered the model: its tools field as sent, in the API the client called (a trace: its first request’s); empty when it offered none |
{{expected}} |
experiments | the dataset item’s expected output |
mapped names (variables) |
all | `{from: input |
{{span.<field>}} |
span, trace (the root span) | name, kind, subkind, status, origin, model, provider, provider_model, request_id, trace_id, span_id, parent_span_id, session_id, error_code, duration_ms, started_at, http_status, input_tokens, output_tokens, cost_usd, attributes.<name>, tags.<name> |
{{metadata.<tag>}} |
span, trace | one request tag of the judged span (the root span of a trace) |
{{trace.id}}, {{trace.spans}}, {{trace.errors}}, {{trace.duration_ms}} |
span, trace | facts of the trace |
{{spans[*].<field>}}, {{spans[kind:tool].<field>}}, {{spans[0].<field>}} |
trace | a field of every span, of the spans of one kind (a JSON list), or of one span by position (negative from the end) |
{{session.id}}, {{session.turns}}, {{session.transcript}} |
session | the session’s ID, its number of captured turns, and the turns as User: … / Assistant: … in order |
{{session.traces[*].input}}, {{session.traces[*].output}}, {{session.traces[0].request_id}} |
session | one field of every turn, or of one turn |
{{prompt.id}}, {{prompt.revision}}, {{prompt.source}} |
span, trace (its first request) | with prompt_tracking (refused when saved or published without it; an evaluator saved with it keeps running when it is turned off, and a run that reads the variables is skipped with prompt_variables_unavailable): the prompt revision the judged request recorded and how it is known (rendered, declared, system) |
{{prompt.variables.<name>}} |
span, trace | one variable of that revision, read back from the request’s captured content through the revision’s template |
{{prompt.query}}, {{prompt.context}} |
span, trace | the variable the prompt marks as the question or the retrieved text (variable_roles), else the first conventional name it declares (query, question, input, … and context, documents, passages, sources, …) |
A trace or session prompt must read the answer ({{output}}) or the target by path ({{spans[...]}}, {{session.transcript}}). A path that does not exist for the scope is refused when you save.
One variable’s value is at most evaluation.max_variable_bytes (64 KiB by default). A longer value (a long session, a trace with thousands of spans) skips the run with content_truncated instead of judging part of the content. A session of more than 50 requests is skipped the same way: a judge never reads the start of a conversation as if it were all of it.
A prompt variable is read from what the request actually sent: the template is aligned with the end of the conversation (its last message with the latest message of the same role whose whole text the template matches, each earlier one with an earlier message), and the text where a placeholder stands is the variable’s value, kept only when it is the only reading of the text. Nothing new is stored, and the capture policy decides as it does for {{input}}. When the request named no revision, its content was not captured for evaluation, its messages do not follow the revision’s template (the client edited the text), the prompt is not the evaluator’s team’s, or the role or variable has no single value (two placeholders with nothing between them, a context that itself contains the text after its placeholder, or a variable used twice with two values), the run is skipped with prompt_variables_unavailable and the reason, never judged with an empty question or context. This is how a hallucination check reads the question and the context of a RAG prompt whatever its variables are called: mark them once in the prompt.
Path variables exist on live traffic, in tests and in backfills. An experiment judges dataset items, which have no span behind them: an evaluator whose prompt reads a path is refused in an experiment run.
Versions
Section titled “Versions”Every save is a new version. A save is a draft: it never changes the status or what is published.
- Publish makes a version the one live traffic runs and activates the evaluator. Results carry the version that produced them.
- The readable spec of a version lists name, type, judge route, temperature, max tokens, scope, runs on, sampling, filter, tracing, output, pass criteria, the daily cost ceiling, the variables and the prompts.
- Compare two versions: the line difference of their specs and, per version, results, pass rate, errors, skipped, the judge cost from the ledger, the cost per result and the judge tokens (average and total).
- Restore writes an older version’s spec as a new version. Publish it to put it on live traffic.
Name: goalType: llm_judgeJudge route: chat-judge (gateway alias)Temperature: 0Max tokens: 600Scope: traceRuns on: liveSampling: 25%Filter: tag.env:prodTracing: enabledOutput: categorical [answered, partially_answered, refused]Pass criteria: answered, partially_answeredModel reasoning: not readImages: not sentDaily cost ceiling: US$2.00## User promptDid the assistant complete what the user asked? ...An evaluator’s name is the name of its results and of the evaluation.<name> field of the query language, and is unique in its team. It can be changed: results keep the name they were written with and stay joined to the evaluator by its ID.
Status and health
Section titled “Status and health”| Status | Meaning |
|---|---|
draft |
saved, never published: it does not run on live traffic. It can be used in experiments and tested |
active |
the published version runs on matching traffic |
paused |
no new run; pending runs end without a result; results stay. Resume returns it to active |
disabled |
as paused, for an evaluator you are retiring |
The gateway pauses an evaluator by itself, with the reason, when its judge is refused in a way that will not change by itself, when its definition stops being valid, or when its daily cost ceiling is reached. What the judge route answers decides it:
| Judge route answers | What the gateway does |
|---|---|
401, 403 (credentials or access), 404 (the model or route is gone), 400, 405, 413, 415, 422 (a request the judge cannot take) |
the run ends skipped with judge_refused and the evaluator pauses, with the status and code in its reason: fix the route or the prompt, then resume it |
the team’s budget or quota refuses the call (quota_exceeded) |
the run ends skipped with judge_budget_refused and the evaluator pauses |
408, 429, 5xx |
retried at once within the run (three calls, a short backoff between them), then the run is retried later like the next row |
any other 4xx (409, 425, a provider’s 402) |
the run is retried later with its own backoff (three attempts in all), then ends error with judge_failed; the evaluator keeps running |
The same rules apply to decision-model judges. A decision route takes no budget quota: a quota with a budget on a decision model refuses its calls with 422 quota_profile_unsupported, which pauses the evaluator; limit decision judges with the evaluator’s daily ceiling instead. Health (ok, degraded, blocked) is a second fact, computed from the results: degraded when judge errors reach 5% of the judged runs of the last 24 hours, blocked when the gateway paused it.
The evaluators an alias judges for
Section titled “The evaluators an alias judges for”Before you change or delete a model alias, see which evaluators use it as their judge route. Turn on alias_evaluator_usage (an operator flag, off by default; requires evaluators):
- Model catalog → Edit routing shows Used by evaluators: each evaluator whose
judge_modelis the alias, with its team, scope and status, linked to its page. Deleting the alias in use warns with the count on the confirm button (Confirm delete (2 evaluators judge through it)); deleting it anyway pauses those evaluators at their next run, as the table above says. GET /api/v1/admin/models/{id}/evaluators(evals:read) answers{model, evaluators: [{id, name, team_id, type, status, paused_reason, scope, published_version}], count, truncated}, by name, at most 200 (truncatedsays there are more).
The list is the reader’s: only the evaluators of teams you read evaluations of (all of them for a global administrator or viewer), never a count of other teams’ or organizations’. A deleted evaluator is not listed. Evaluators declared in the configuration file are listed like the others.
With judge_guardrails on, the same panel and answer also list the guardrails: judge_guardrails are the judge guardrails backed by one of the listed evaluators (so their judge runs on this alias), and, for a reader with guardrails:read, guardrails are every enabled guardrail that checks the alias, each with its type, stages, mode and place in the run order. Deleting the alias warns with the judge guardrails too. An evaluator can also guard traffic as a judge guardrail, and be scored by its pass rate on the two sides of a canary in a route experiment.
Cost: the preview and the daily ceiling
Section titled “Cost: the preview and the daily ceiling”A judge is a request of the team through the gateway: it goes through routing, quota and the ledger like any other, under the principal eval:evaluator:<id> with origin evaluation.
The preview (the editor shows it under the filter and again before Publish) answers, for the last 24 hours and 7 days, how many targets the filter selects, the weekly volume after sampling, how many of the matching spans have captured content, and the weekly judge cost. The cost is measured from the evaluator’s own judge calls of the last 7 days when there are at least 5, otherwise estimated from the judge route’s price, the size of the prompt and the mean tokens of the matching targets; it is unknown when the route has no price.
max_daily_cost_usd is the evaluator’s own ceiling per UTC day, read from the ledger before each run. Once the day’s judge spend reaches it, runs are skipped with judge_budget_refused and the evaluator pauses with cost_ceiling_reached. Runs already in flight finish, so the day can end a few runs above the ceiling (at most evaluation.worker_concurrency per replica). The ceiling needs a priced judge route: publishing an evaluator with a ceiling on a route that has no price is refused (422 ceiling_needs_price), since every call would be unvalued. The team’s own budgets and quotas apply as well: a judge call they refuse skips the run with judge_budget_refused and pauses the evaluator.
tracing: false stores no judge span for the evaluator’s runs; the result, its judge request and the ledger line stay.
Test before you publish
Section titled “Test before you publish”The editor’s test pane runs the judge on real traffic. Nothing is stored as a result; each judge call is a request of the team with origin playground and its cost in the ledger.
- Auto test takes the N newest targets the filter selects (1 to
evaluation.test_max_targets) and shows the batch pass rate, the categories, and per target the verdict, the explanation, the cost and a link to the trace. - Test manually takes one target you pick, shows the resolved value of every variable, lets you edit them, and runs once (Ctrl/⌘+Enter): the verdict, the raw answer of the judge and the cost.
The explanation, the raw answer, the previews and the resolved variables are content: they are shown to a reader of the team’s captured content (content_sent:read), and each read is audited. Without it the test still runs and shows verdicts and costs. Testing an evaluator that reads the model’s reasoning or the images of the input also takes content_reasoning:read or content_media:read.
The preview’s list of matching targets is shown to a reader of the request log (logs:read); a filter on a cost field is previewed by a reader of costs (analytics:read).
Backfill
Section titled “Backfill”Publishing never runs on past traffic. Backfill runs the published version over a window of the past (at most 31 days, at most 1,000 targets per call, newest first), without sampling. Live runs go before backfill runs in the worker. A dry run answers how many targets match and what judging them costs, and queues nothing. A target the version already judged is skipped.
Code evaluators
Section titled “Code evaluators”With code_evaluators, an evaluator can be your own JavaScript: a source that defines function evaluate(data) and returns the verdict. It calls no model and costs nothing; it runs everywhere an evaluator runs (live traffic, the test pane, backfills, runs on chosen traffic and experiment runs).
function evaluate(data) { // a trace evaluator: data.spans are the trace's spans const errors = data.spans.filter((s) => s.status === "error").length; return { value: errors, assessment: errors ? "fail" : "pass", reasoning: errors + " error spans" };}data is the target as plain JSON:
| Scope | data holds |
|---|---|
span |
scope, trace_id, span_id, request_id, session_id, span (its fields), input (the captured request), input_text (the last user message), output (the captured answer), tools (the request’s tools field, or null), expected (null), metadata (the request tags) |
trace |
scope, trace_id, session_id, root (the root span), spans (every span, in order), input, input_text, output, tools (the first request’s) |
session |
scope, session_id, traces (each turn’s request_id, input, input_text, output), input, input_text, output |
| experiment item | scope: item, input, input_text, output, expected (the item’s expected output), metadata |
A span holds the fields of the path variables (name, kind, status, model, duration_ms, cost_usd as a number, …) plus attributes and tags; never the end user or the customer identity. input and output are null when the content was not captured, or when the source never names them (the run then opens no capture).
What evaluate returns decides the result:
| Return | Result |
|---|---|
true / false |
a boolean output’s value; a numeric output scores its max or min |
| a number | a numeric output’s value, within min and max; a boolean output takes 0 or 1 |
| a non-empty string | a categorical output’s label: one of its categories |
null, undefined or "" |
no result: skipped with code_no_result |
{value, assessment, reasoning, metadata} |
assessment (pass, fail, none) overrides the pass criteria; a boolean output may answer assessment alone; reasoning is stored as judge reasoning (encrypted, shown to content readers); metadata (an object) is shown by the test pane only |
| anything else (an array, an object with other keys, a value outside the range) | error with code_invalid_result |
The source has, beside the language, console.log (up to 20 lines of 200 characters, 4 KiB, shown in the test pane, never stored) and three pure built-ins: similarity(a, b) (1 minus the token edit distance over the longer length, or Jaccard over token sets above 500 tokens; 0 to 1; at most 50 calls per run and 32,768 characters per string), jsonPath(value, path) (a.b[0].c or $.a.b, from an object or a JSON string) and countTokensApprox(text) (about one token per 4 characters). GET /api/v1/admin/evals/code-builtins answers them with the fields of data and the effective limits; the editor shows them under the code.
The sandbox. The source runs in the gateway’s extension runtime: QuickJS-ng compiled to WebAssembly, pinned by digest, on wazero, a fresh instance per run. There is no host operation at all: no network, file system, environment, process, real clock or randomness, and nothing survives a run. The source is compiled when it is saved (a syntax error is refused) and limited by evaluation.code:
| Setting | Default | Bounds | Past it |
|---|---|---|---|
evaluation.code.timeout_ms |
500 |
50 to 10000 | error code_timeout |
evaluation.code.memory_pages |
256 (16 MiB) |
64 to 4096 | the run’s WebAssembly memory ceiling |
evaluation.code.heap_bytes |
8388608 (8 MiB) |
1 MiB to 128 MiB, plus 1 MiB within memory_pages |
error code_memory_limit (a deep recursion too) |
evaluation.code.max_program_bytes |
16384 |
1 KiB to 256 KiB | the save is refused |
evaluation.code.max_input_bytes |
262144 |
4 KiB to 4 MiB | skipped content_truncated |
evaluation.code.max_result_bytes |
16384 |
1 KiB to 256 KiB | error code_output_limit |
evaluation.code.team_concurrency |
2 |
1 to 64 | a further run waits for a free slot, up to four times timeout_ms plus a second; past that it ends code_busy, and a live job is tried again |
A throw is error code_error. What the program threw (and a key or a label it returned that the output does not take) can hold captured content, so it is never stored on the result, the job or the span: the test pane shows it, after the reason, to a reader of the sent view only. A code run’s error or skip is final: the same source on the same data answers the same, so it is not retried. A code run is traced like a judge: a judge span of type code, linked to what it judged, under the principal eval:evaluator:<id>; the source is in the version, never on the span. A code evaluator takes no judge route, prompt, rule, variables, messages, images, reasoning, temperature, max tokens or cost ceiling.
The template library
Section titled “The template library”With code_evaluators, New evaluator opens the library: start from scratch as an LLM judge, a decision model, code or a rule, or pick one of more than 60 templates by category (Quality, Safety and security, Agents and tools, Retrieval, Conversations, Classification, Gateway signals, Images, Rules and checks), with a search and the example output of each. Your evaluators lists the team’s own evaluators: starting from one makes a copy (a new evaluator at version 1 with the same definition and filter). An empty Evaluators page recommends three starting points.
A template only fills the editor: every field stays editable, and nothing runs until you publish. A template with a placeholder (<<FILL: the allowed topics>>) is saved as a draft and cannot be published until the placeholder is replaced (422 placeholder_unfilled). Each template carries its fixtures: the documented cases it is tested against (fixtures in GET /api/v1/admin/evals/evaluator-templates): code and rule templates are run on them, judge and decision templates have their prompt rendered with them and the documented verdict mapped by their pass criteria. A fixture documents the behaviour; it is not a claim of accuracy.
| Category | Templates |
|---|---|
| Quality | correctness, faithfulness, hallucination, helpfulness, relevance, conciseness, completeness, equivalence, fluency, summarization, rule_adherence, language_match, failure_to_answer, sentiment, tone |
| Safety and security | safety, toxicity, prompt_injection, pii_leakage, out_of_scope, topic_relevancy, decision_out_of_scope, pii_patterns (code) |
| Agents and tools | goal_completeness and agent_task_completion (trace), tool_selection, tool_argument_correctness, tool_call_efficiency (trace), engineering_task_type, empty_tool_result and repeated_tool_calls (code) |
| Retrieval | answer_groundedness, context_precision, context_recall, retrieval_sufficiency |
| Conversations | user_frustration, conversation_completeness, conversational_coherence (session), decision_customer_frustration, session_turn_summary and all_caps_frustration (code) |
| Classification | chat_intent, input_topic, decision_input_topic |
| Gateway signals (code) | trace_error_spans, latency_budget, fell_back, attempt_count, served_from_cache, guardrail_flagged, cost_over_budget |
| Images (multimodal judges) | explicit_content_image, sensitive_imagery |
| Rules and checks | exact_match, mentions_expected, similarity_to_expected, keyword_overlap, valid_json, json_required_fields, regex_match, response_length, user_input_contains (code); the seven rules (rule_exact_match, rule_contains, rule_not_contains, rule_regex, rule_json_valid, rule_json_field_equals, rule_length_between) |
With code_evaluators off the gallery is the eight judges it always had.
The decision model’s question
Section titled “The decision model’s question”A decision-model evaluator sends the model a state and one question. The editor builds the state from the fields you tick (the request, the answer, the model, the status, the duration, the tags) as one JSON object of variables, and says how many fields and characters it sends. output.question is the question (up to 1,000 characters; name the state’s fields in backticks); for a categorical output, output.options says what each category covers (up to 300 characters each). Without them the gateway asks its own question. The result keeps the probabilities in value_json: {"probability": 0.91} for a yes/no question, {"probabilities": {...}, "confidence": 0.86} for a choice; the test pane shows them as bars. One evaluator asks one question and writes one result.
Run on chosen traffic
Section titled “Run on chosen traffic”With code_evaluators, an evaluator’s published version can be run on traffic you choose, as on-demand runs:
- Evaluate selection: on Observability → Traces, select traces (or spans) of one team and choose Evaluate, then one or more of the team’s published evaluators;
- Evaluate on a trace: the same for the open trace (or the selected span);
- Runs → Run over a query, on the evaluator’s page: a query of the Traces screen over the last 24 hours, 7 or 30 days, up to a limit, with Count and cost first.
A run judges what was chosen, whatever the evaluator’s filter and sampling say: a span evaluator judges the root span of a chosen trace (or the chosen span), a trace evaluator the trace, a session evaluator the trace’s session. A target already judged is judged again, and its result replaced. A run takes at most evaluation.max_run_targets targets (1,000 by default, at most 1,000) and only targets in the evaluator’s team’s span store: another team’s trace, or one gone, is left out. An active or a paused evaluator runs; a draft or a disabled one does not (409 not_published).
Each target is a job of kind on_demand with the run’s ID, in the execution log beside the live ones. The evaluator’s Runs tab lists the runs with their progress (waiting, running, judged, failed, cancelled and the outcome of each target); it reads again every 3 seconds while a run is open, and the run goes on on the server when you leave the page. Cancel ends the targets not started yet (cancelled); a running one finishes. Running and cancelling take evaluators:publish, and a run also logs:read; each is an audit action (eval.evaluator.run, eval.evaluator.run_cancel) and an event of the evaluator.
Create evaluator from this span, on a trace, opens the editor with the span as the test pane’s first manual target.
Evaluators declared in the configuration file
Section titled “Evaluators declared in the configuration file”evaluation.evaluators declares evaluators as code, beside the ones made in the console. The list is applied when the gateway starts (and its evaluation worker with it): each entry is checked by the same rules as a save, stored as a new version when its definition changed (version source yaml), published at once and set to its status. An evaluator the file declares is managed by the configuration file: the console shows it with a Declared in the configuration file mark and offers no edit, publish, status change or delete, and the API refuses those writes with 409 managed_by_configuration. Tests, runs on chosen traffic and results work as for any other evaluator. An entry removed from the list leaves its evaluator disabled, with its versions and results kept. Evaluations → Evaluators → Settings and GET /api/v1/admin/evaluation/settings (evaluation.evaluators) list the declared evaluators the reader may see, with their kind, scope, sampling and status.
evaluation: evaluators: - id: ev_trace_errors team_id: team-a name: trace_error_spans code: | function evaluate(data) { return { value: data.spans.filter((s) => s.status === "error").length }; } output: {data_type: numeric, min: 0, max: 10000, pass: {op: eq, value: 0}} scope: trace filter: "origin:app" - id: ev_helpful team_id: team-a name: helpfulness judge_model: judge-default prompt: "Request: {{input}}\nAnswer: {{output}}\nWas the answer helpful?" output: {data_type: boolean} filter: "span.kind:request capture:evaluation" sample_rate: 0.1| Field | Default | Meaning |
|---|---|---|
id |
required | 1 to 64 letters, digits, _ or -, unique in the list; the evaluator’s ID |
team_id |
required | the team that owns the evaluator |
name |
required | the evaluator’s name (results and metrics are named after it), unique in the team |
description |
empty | shown on the evaluator’s page |
judge_model, prompt |
an LLM judge or decision model: the judge route and the prompt; exactly one of judge_model and code |
|
code |
a code evaluator’s JavaScript (needs code_evaluators in the team’s plan) |
|
output |
required | the output, as in the API: data_type (boolean, numeric, categorical), min/max, categories, pass, question/options |
scope |
span |
span, trace or session |
filter |
empty | the query-language filter; a judge evaluator needs one |
sample_rate |
1 |
(0, 1] of the matching targets |
runs_on |
live |
as in the API |
status |
active |
active, paused or disabled |
At most 200 evaluators are declared. A malformed list (an ID twice, a missing team or name, both or neither of judge_model and code, no output) stops the gateway at startup with the field named. An entry that is well formed but does not pass the checks of a save (an unknown judge route, an invalid filter, a template placeholder not filled, code_evaluators off) is left out and logged (declared_evaluator_invalid), and the others are applied; if an earlier start had applied it, its evaluator is disabled until the entry passes again, so a broken edit never leaves the old version judging; an entry whose ID or name is taken by an evaluator the console made is logged as declared_evaluator_conflict and left alone. Declared evaluators need the evaluators feature.
Settings
Section titled “Settings”The evaluation block of the configuration file is read at startup: change it and restart the gateway. Evaluations → Evaluators → Settings and GET /api/v1/admin/evaluation/settings show the effective values and where each comes from (default or configuration). The same block also holds evaluation.metrics and evaluation.monitors, described in evaluation metrics and evaluation monitors; one endpoint answers the whole block.
evaluation: trace_idle: 3m session_idle: 30m span_delay: 5s worker_concurrency: 4 test_max_targets: 10 max_variable_bytes: 65536 job_retention_days: 30 max_run_targets: 1000 # code_evaluators code: {timeout_ms: 500, memory_pages: 256, heap_bytes: 8388608} # code_evaluators metrics: {max_evaluations: 200} # evaluation_metrics monitors: {tick: 30s, items: []} # evaluation_monitors| Setting | Default | Bounds | Meaning |
|---|---|---|---|
evaluation.trace_idle |
3m |
5 s to 24 h | a trace stays this long without a new span before a trace evaluator judges it |
evaluation.session_idle |
30m |
5 s to 24 h | the same wait for a session evaluator |
evaluation.span_delay |
5s |
0 to 5 min | wait before a span evaluator judges a span, so the captured content is stored first |
evaluation.worker_concurrency |
4 |
1 to 64 | judge runs one replica makes at a time |
evaluation.test_max_targets |
10 |
1 to 50 | targets of one automatic test |
evaluation.max_variable_bytes |
65536 |
1024 to 1048576 | bytes of one variable of a prompt |
evaluation.job_retention_days |
30 |
1 to 365 | days finished runs stay in the execution log |
evaluation.max_run_targets |
1000 |
1 to 1000 | targets of one on-demand run (code_evaluators) |
evaluation.code.* |
see code evaluators | the limits of one code run (code_evaluators) |
|
evaluation.evaluators |
[] |
at most 200 | evaluators declared in the file, see above |
Permissions
Section titled “Permissions”| Permission | Who has it | What it allows |
|---|---|---|
evals:read |
every member, for its teams | read evaluators, versions, results, health, the execution log and the preview |
evals:manage |
team administrators, for the teams they administer | save a draft, restore a version, delete |
evaluators:publish |
team administrators, for the teams they administer; admin | publish, pause, resume, disable, backfill, and run on chosen traffic and cancel a run: what reaches traffic |
evaluators:test |
the same | run the test pane: judge calls on real traffic |
A custom role ceiling of a team administrator can withhold evaluators:publish and evaluators:test. Every publish, restore, status change, automatic pause, backfill and delete is an audit action (eval.evaluator.*) and an event of the evaluator with the status and version before and after (the Health tab).
The console
Section titled “The console”Evaluations → Evaluators lists each evaluator with its type, scope, status, filter and sampling, results of the last 7 days, pass rate, judge route, 7-day cost and health. An evaluator’s page has four tabs (five with code_evaluators, which adds Runs): Results (pass rate, the series with a marker at each version, categories, the results with their traces, filtered by All, Pass, Fail, Errors or Skipped and by version), Configuration (the readable spec), Versions (compare, restore, publish) and Health (errors and skips by reason, the history of changes and the execution log with pending runs).
With evaluation monitors or review automations on, the page has a fifth tab, Automations & monitors:
- Monitors (
evaluation_monitorsandmonitors:read): the monitors that watch the evaluator, and, withmonitors:managefor its team, a Pass-rate monitor, a Failure count monitor or a Judge spend monitor (not for a rule evaluator, which makes no judge call) to start from it, with the evaluator and its team filled in. The list also has a Monitors column: how many monitors watch each evaluator and the worst of their states. When the monitors cannot be read, the column says Unavailable and the tab says so; it never shows “none”. - Automations (
review_automationsandevals:read): the automations of the evaluator’s team whose query reads its results (evaluation.<name>…), and, withreview_queues:manage, Review failing results, which opens the automation form of Review withevaluation.<name>.assessment:failover traces filled in: choose the queue or dataset, the share and the caps there. An evaluator whose name holds characters the query language cannot write (anything but letters, digits,_and-) cannot be named by an automation; rename it first.
The editor has the form on the left and the test pane on the right, with Save draft, Publish and Cancel. On a screen narrower than 768 px the configuration is read-only; pause, resume, results, versions and health work at any width.
Every request takes a console session; writes take the CSRF token.
| Request | Purpose |
|---|---|
GET /api/v1/admin/evals/evaluators |
Evaluators with their live configuration, status, list figures (figures) and what each published version runs (live) |
GET /api/v1/admin/evals/evaluators/{id} |
One evaluator: definition, status, published_version, draft_ahead |
POST /api/v1/admin/evals/evaluators |
Create: a draft at version 1 |
PUT /api/v1/admin/evals/evaluators/{id} |
Save a draft: a new version; live traffic keeps the published one |
DELETE /api/v1/admin/evals/evaluators/{id} |
Delete; results and versions stay |
GET /api/v1/admin/evals/evaluators/{id}/versions |
The versions, newest first |
GET /api/v1/admin/evals/evaluators/{id}/versions/{version} |
One version with spec and spec_text |
GET /api/v1/admin/evals/evaluators/{id}/compare |
Two versions (?a=&b=): the line diff and the figures of each |
POST /api/v1/admin/evals/evaluators/{id}/publish |
Publish {"version": n} (the latest when omitted) and activate |
POST /api/v1/admin/evals/evaluators/{id}/restore/{version} |
Write an older version’s spec as a new version |
POST /api/v1/admin/evals/evaluators/{id}/status |
Pause, resume or disable: {"status": "paused", "reason": "..."}, "active" or "disabled" |
GET /api/v1/admin/evals/evaluators/{id}/preview |
Matches, weekly volume and cost of the saved definition (?version= for an older one) |
POST /api/v1/admin/evals/evaluators/preview |
The same for a definition that is not saved yet: {"evaluator": {...}} |
POST /api/v1/admin/evals/evaluators/{id}/test |
{"mode": "auto", "n": 5} or {"mode": "manual", "target": {...}, "variables": {...}, "dry_run": false}, with evaluator for unsaved edits; {id} is draft for a definition not saved yet |
GET /api/v1/admin/evals/evaluators/{id}/results |
The Results tab: summary, series, categories, version markers and the results (from, to, assessment, status, version, limit, cursor) |
GET /api/v1/admin/evals/evaluators/{id}/health |
The Health tab: health, errors and skips by reason, run counts, events, judge latency, today’s spend |
GET /api/v1/admin/evals/evaluators/{id}/jobs |
The execution log (status, limit) |
POST /api/v1/admin/evals/evaluators/{id}/backfill |
Run the published version over past traffic: {"since": "...", "until": "...", "limit": 500, "dry_run": true}; a dry run answers the count and the cost and queues nothing |
GET /api/v1/admin/evaluation/settings |
The effective evaluation block (these settings, metrics and monitors) and the source of each value; features says which of evaluators, evaluation_metrics and evaluation_monitors are on. Needs config:read and one of the three flags |
POST /api/v1/admin/evals/evaluators/{id}/run |
code_evaluators: run the published version on {"targets": [{"trace_id": "…", "span_id": "…"}]} or {"query": {"scope": "traces", "q": "…", "from": "…", "to": "…", "limit": 100}}; dry_run counts and costs; 202 with the run |
GET /api/v1/admin/evals/evaluators/{id}/runs |
code_evaluators: the on-demand runs with their progress |
GET /api/v1/admin/evals/evaluators/{id}/runs/{run} |
code_evaluators: one run, for polling |
POST /api/v1/admin/evals/evaluators/{id}/runs/{run}/cancel |
code_evaluators: end the targets not started |
GET /api/v1/admin/evals/evaluator-templates |
The template library and its categories (code_evaluators), else the eight judges |
GET /api/v1/admin/evals/code-builtins |
code_evaluators: the signature, returns, built-ins, fields of data and limits of code evaluators |
Example: a trace evaluator, saved, previewed and published.
curl -s -X POST "$GW/api/v1/admin/evals/evaluators" -b cookies -H "X-CSRF-Token: $CSRF" -H 'Content-Type: application/json' -d '{ "team_id": "platform", "name": "goal", "judge_model": "chat-judge", "scope": "trace", "filter": "tag.env:prod", "sample_rate": 0.25, "max_daily_cost_usd": "2.00", "prompt": "Did the assistant complete what the user asked?\nFirst request: {{input}}\nLast answer: {{output}}\nTools used: {{spans[kind:tool].attributes.tool}}", "output": {"data_type": "boolean", "pass": {"op": "eq", "value": 1}}}'# {"id":"ev_…","version":1,"status":"draft","draft_ahead":true,"effective_idle_seconds":180,…}
curl -s "$GW/api/v1/admin/evals/evaluators/ev_…/preview" -b cookies# {"unit":"traces","matches":{"24h":412,"7d":2950},"sampled_weekly":738,# "cost":{"basis":"estimated","per_run_usd":"0.000142","weekly_usd":"0.104796",…},# "matching_query":"origin:app tag.env:prod","query_scope":"traces","warnings":[]}
curl -s -X POST "$GW/api/v1/admin/evals/evaluators/ev_…/publish" -b cookies -H "X-CSRF-Token: $CSRF" -d '{}'# {"status":"active","published_version":1,"draft_ahead":false,…}A result of this evaluator has scope: trace, the trace’s ID, evaluator_version: 1, the judge request evaluator.ev_….v1.<target>.<attempt>, the judge trace and the judge cost. evaluation.goal.assessment:fail on the Traces screen lists the traces it failed, and evaluation.goal.version:1 those one version judged.
Result reasons
Section titled “Result reasons”| Status | Reason | Meaning |
|---|---|---|
skipped |
content_not_captured |
the target has no content captured for evaluation (or its capture expired) |
skipped |
content_truncated |
the capture was cut at the policy’s max_bytes, or a variable passed evaluation.max_variable_bytes |
skipped |
prompt_variables_unavailable |
the prompt reads {{prompt.query}}, {{prompt.context}} or {{prompt.variables.<name>}} and the judged request’s value could not be read (the reason says why) |
skipped |
judge_budget_refused |
the evaluator’s daily ceiling was reached, or the team’s budget or quota refused the judge call |
skipped |
judge_refused |
the judge route answered 400, 401, 403, 404, 405, 413, 415 or 422, or the gateway refused the call (the route is not allowed or is gone); the evaluator pauses |
error |
output_unparseable |
the judge’s answer was not the requested JSON (a max_tokens too low cuts it) |
error |
judge_failed |
the judge route failed after the retries (408, 429, 5xx, or another 4xx such as 409) |
error |
content_unreadable |
the capture could not be decrypted |
skipped |
code_no_result |
a code evaluator returned null, undefined or "" |
error |
code_timeout, code_memory_limit, code_output_limit |
a code run passed evaluation.code |
error |
code_error |
the code threw (the message is the cause) |
error |
code_invalid_result |
the code returned what its output cannot take |
error |
code_busy |
the team’s code runs stayed full through every attempt |
A target outside the filter gets no result: the run ends as not_in_scope in the execution log.
Limits and upgrade notes
Section titled “Limits and upgrade notes”- A decision-model judge is an alias whose model has the
systemonecapability and notchat(withsystemone_decisionson). The rendered prompt is the decision’s state and the result one question: a yes/no probability for a boolean output (pass at 0.5 or more), the most probable category for a categorical one. Numeric and JSON outputs need an LLM judge. - Upgrading from live rules. The live rules of earlier releases (
/api/v1/admin/evals/rules) are converted into evaluators once, at the first start, whatever the flags say: each rule becomes an evaluator with the rule’s filter and sampling, and the rule row keepsmigrated_to. There is no separate rule worker any more, so a converted rule judges live traffic again only onceevaluatorsis on, with what it requires (span_store,trace_query,evaluation_tracing,eval_capture) and in the team’s plan. A start that converts rules whileevaluatorsis off logsevaluator_rules_folded_while_offwith the count. A deployment that stored overrides or plan grants under the earlier idevaluators_v2has them renamed toevaluatorsat boot. - A rule evaluator’s scope is
span; a code evaluator takes any scope. - One run of a code evaluator writes one result: a source cannot write several named results (write one evaluator per result).
- Code runs share the gateway’s process and CPU: timing side channels between runs are not prevented, and a run may spend its whole limit. A team that needs physical isolation needs its own replicas.
- The judges use the gateway alias you choose: they inherit that provider’s terms and data handling, and no provider key is ever stored for an evaluator.
- Migration 240 adds the columns and tables; every existing definition becomes version N of its evaluator, and definitions that experiment runs had snapshotted are recovered as older versions. Migration 260 adds the code column, the run of an on-demand job and the runs table.