Eval checks
The graders that decide whether a test conversation passed — LLM judgments, tool-trace rules, and conversation facts.
A check is one reusable assertion about a conversation: "the agent read the disclosure", "identity was verified before any account lookup". Build the library once and attach checks to any suite.
Three kinds
kind | Asserts | Config |
|---|---|---|
judge | An LLM judgment over the transcript | instruction, plus optional arguments below |
tool | A fact about the tool-call trace | rule and that rule's arguments |
flow | A deterministic fact about how the conversation ran | rule and that rule's arguments |
Every config key is checked on write. An unknown key, a missing required key,
or a wrong type returns 422 validation_failed naming the field — for example
config.expected — so a typo never silently grades against a default.
Optional arguments are marked ?. The exact schema for each rule is
EvalCheckConfig in the API reference.
Judge arguments
| Argument | Meaning |
|---|---|
instruction | What to grade, in plain language. |
levels? | 2–5 graded outcomes, worst first, each {key, label?, description?}. Omit for pass/fail. |
target_levels? | Level keys that count as passing. Defaults to the last level. |
modality? | text, audio, or any (default). audio abstains on runs with no recording. |
model_ref? | Enabled workspace-visible LLM catalog UUID for this check’s scorer; "" clears the override. |
New checks use config.model_ref for a per-check scorer override. Existing
saved scorer selections remain preserved; editing an unrelated check field
does not replace them. To choose a scorer for a run, use
runtime_profile.scorer_model_ref with
a platform model UUID from the catalog. See
Running evals.
Tool rules
phase? (pre_call or in_call) limits a rule to calls made in that phase.
rule | Arguments | Passes when |
|---|---|---|
called | tool, phase?, min? (default 1), max? | The tool ran between min and max times. |
not_called | tool, phase? | The tool never ran. |
called_with | tool, args, phase?, match? | A call had these arguments — subset (default) or exact. |
called_before | tool, other_tool | The first tool call came before the first other_tool call. |
succeeded | tool, phase? | At least one call succeeded. |
failed | tool, phase?, error_kind? | At least one call failed, optionally with that error kind. |
result_matches | tool, expected, jsonpath?, phase? | A result holds expected at jsonpath (default $). |
no_unexpected_tools | allowlist | Every tool that ran is on the list. |
phase | tool, expected_phase | Every call ran in that phase. |
Conversation rules
rule | Arguments | Passes when |
|---|---|---|
max_turns | max | The conversation ran at most max turns. |
end_reason | value | The conversation ended for that reason — see below. |
transcript_matches | pattern, speaker?, expect? | A case-insensitive regular expression appears (expect: true, default) or doesn't. |
pre_call_status | tool, status? | A pre-call tool finished as success (default), failed, timeout, missing_vars, or config. |
pre_call_var_set | value (tool_slug.name) | That pre-call variable rendered non-empty. |
pre_call_aborted | expect? | The pre-call batch aborted the call (true) or didn't (false, default). |
A few rules also accept an older spelling of one key (var, value) — send
one spelling, not both.
end_reason matches a code: agent_ended (the agent hung up or handed off),
caller_ended, timed_out, disconnected, or
pre_call_abort. Runs record the code with optional detail —
caller_ended: goal achieved — and the check compares the code only. When
grading real calls, it reads the call's outcome.
There is deliberately no metric kind — latency and dead air are dashboard signals, not gates.
Start from a template
GET /eval-checks/templates returns the starter library. To start from one,
send its config with your POST /eval-checks — template_key only records
where the check came from. The check is independent from then on.
| Template | Kind | Asserts |
|---|---|---|
resolution | judge | Caller got their desired outcome. |
required-disclosure | judge | Mandatory disclosure read first. |
no-hallucination | judge | No invented prices, policy numbers, terms. |
pii-handling | judge | Never read back more than the last four digits. |
escalation-correctness | judge | Transferred exactly when it should. |
language-adherence | judge | Stayed in the caller's language. |
graceful-degradation | judge | Coped with a failed lookup without leaking it. |
tone | judge | Manner matched the caller's state. |
never-cold-transfers | tool | Cold-transfer tool never called. |
verifies-before-disclosing | tool | Identity verified before the account lookup. |
no-unexpected-tools | tool | Nothing outside the intended tool set. |
lookup-succeeded | tool | Main lookup returned successfully. |
reaches-terminal-node | flow | Ended at the intended terminal node. |
captures-required-slot | flow | Required slot recorded. |
ends-within-turn-budget | flow | Stayed within the turn budget. |
pre-call-lookup-succeeded | flow | Pre-call enrichment returned before the agent spoke. |
greeting-has-a-name | flow | The greeting's pre-call variable actually rendered. |
pre-call-did-not-abort | flow | Call wasn't killed before it started. |
Author your own
curl --fail-with-body -X POST "$KEJUE_API_BASE/eval-checks" \
-H "Authorization: Bearer $KEJUE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: create-refund-disclosure-20260906-01" \
--data '{
"slug": "refund_policy_disclosed",
"name": "Refund policy disclosed",
"kind": "judge",
"config": {
"instruction": "Did the agent state the 30-day refund window before ending the call?"
}
}'| Operation | Purpose |
|---|---|
POST /eval-checks | Create; config is required. Duplicate slug 409 eval_check_slug_taken. |
GET /eval-checks | List without configs; filters q, kind, archived. |
GET /eval-checks/{id} | One check, active or archived, with its config. |
PATCH /eval-checks/{id} | Edit name, description, or config — a new config replaces the old one and is validated in full. |
DELETE /eval-checks/{id} | Soft-archive, 204. It can no longer be attached; recorded verdicts stay. |
kind, slug, and template_key are fixed at creation: sending one in a
PATCH returns 422 validation_failed with field code immutable. An
archived check is frozen — editing it returns 409 eval_check_archived.
A check is its config — there's no version or publish step. A PATCH with
a new config replaces the old one and takes effect on the next run. When an old gate must keep its meaning, create a new check instead.
Attach to a suite
PUT /eval-suites/{id}/checks replaces the complete attachment set — send
the full list every time; an empty array detaches everything. Read the
current set with GET /eval-suites/{id}/checks. Each entry names a
check_id plus:
weight(default 100) — share of the conversation's weighted score.blocking(default false) — failure fails the conversation regardless of score; for compliance gates, not quality signals.position— echoed in responses; stable display order of suite-level attachments.
These endpoints don't take If-Match — serialize concurrent writers
yourself: read, modify, PUT the whole set.
Per-scenario overrides
PUT /eval-suites/{id}/scenarios/{scenario_id}/checks replaces the
suite-level set for that scenario only — e.g. a transfer assertion only
in the escalation scenario. Read the effective set with
GET /eval-suites/{id}/scenarios/{scenario_id}/checks.
Browsing needs eval-checks:read; managing,
eval-checks:create/update/delete; attaching, eval-suites:update.
Every write also requires the evals entitlement. Verdict semantics —
scores, blocking failures, abstentions — are on the
running page.