Skip to Content

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

kindAssertsConfig
judgeAn LLM judgment over the transcriptinstruction, plus optional arguments below
toolA fact about the tool-call tracerule and that rule's arguments
flowA deterministic fact about how the conversation ranrule 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

ArgumentMeaning
instructionWhat 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.

ruleArgumentsPasses when
calledtool, phase?, min? (default 1), max?The tool ran between min and max times.
not_calledtool, phase?The tool never ran.
called_withtool, args, phase?, match?A call had these arguments — subset (default) or exact.
called_beforetool, other_toolThe first tool call came before the first other_tool call.
succeededtool, phase?At least one call succeeded.
failedtool, phase?, error_kind?At least one call failed, optionally with that error kind.
result_matchestool, expected, jsonpath?, phase?A result holds expected at jsonpath (default $).
no_unexpected_toolsallowlistEvery tool that ran is on the list.
phasetool, expected_phaseEvery call ran in that phase.

Conversation rules

ruleArgumentsPasses when
max_turnsmaxThe conversation ran at most max turns.
end_reasonvalueThe conversation ended for that reason — see below.
transcript_matchespattern, speaker?, expect?A case-insensitive regular expression appears (expect: true, default) or doesn't.
pre_call_statustool, status?A pre-call tool finished as success (default), failed, timeout, missing_vars, or config.
pre_call_var_setvalue (tool_slug.name)That pre-call variable rendered non-empty.
pre_call_abortedexpect?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.

TemplateKindAsserts
resolutionjudgeCaller got their desired outcome.
required-disclosurejudgeMandatory disclosure read first.
no-hallucinationjudgeNo invented prices, policy numbers, terms.
pii-handlingjudgeNever read back more than the last four digits.
escalation-correctnessjudgeTransferred exactly when it should.
language-adherencejudgeStayed in the caller's language.
graceful-degradationjudgeCoped with a failed lookup without leaking it.
tonejudgeManner matched the caller's state.
never-cold-transferstoolCold-transfer tool never called.
verifies-before-disclosingtoolIdentity verified before the account lookup.
no-unexpected-toolstoolNothing outside the intended tool set.
lookup-succeededtoolMain lookup returned successfully.
reaches-terminal-nodeflowEnded at the intended terminal node.
captures-required-slotflowRequired slot recorded.
ends-within-turn-budgetflowStayed within the turn budget.
pre-call-lookup-succeededflowPre-call enrichment returned before the agent spoke.
greeting-has-a-nameflowThe greeting's pre-call variable actually rendered.
pre-call-did-not-abortflowCall 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?"
    }
  }'
OperationPurpose
POST /eval-checksCreate; config is required. Duplicate slug 409 eval_check_slug_taken.
GET /eval-checksList 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.

On this page