Skip to content
Context docs
Evals API

Criteria

Serverhttps://context.example.com/api/v1/evals

A criterion grades an answer. A dataset criterion is an LLM judge (llm_judge), an agent judge (agent_judge, an agent that can open the task's files), a Python check (code_verifier, your code returns a pass or fail or a score from 0 to 1) or an exact match (exact_match). A dataset's own criteria grade every dataset task in it; shared criteria live in the organization's library, where a monitor binds them by ID. A Python check on a dataset needs an administrator to turn Python checks on, and a monitor can't use exact match.


Replace a dataset's criteria

PUT
https://context.example.com/api/v1/evals
/datasets/{datasetId}/criteria
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

The dataset's own criteria, replaced whole: each grades every task in the dataset. They land in the working copy, like a task edit.

Replace a dataset's criteria › path Parameters

datasetId
​string · minLength: 1 · required

Dataset identifier

Dataset (from the path)

Replace a dataset's criteria › Request Body

​array · required
removeFromTasks
​string[] · required

Criterion names to strip from every task's own set in the same write (case and surrounding spaces ignored). Empty for a plain save. Naming a criterion the saved set holds makes it the dataset's (apply to all); naming one it does not hold removes it from every task (remove from all). A set naming a criterion twice, or one its tasks would still carry after the strip, is refused (criterion_name_taken)

Replace a dataset's criteria › Responses

Success

saved
​boolean · enum · required
Enum values:

Save a Python check

PUT
https://context.example.com/api/v1/evals
/criteria/code/{criterionId}
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Creates or replaces a shared Python check under an id you choose (a UUID). The code must compile and define verify; monitors using it grade with the new code from their next request.

Save a Python check › path Parameters

criterionId
​string · uuid · required

Criterion identifier, a UUID the caller chooses; saving the same id again replaces it

Criterion (from the path)

Save a Python check › Request Body

Create or replace a shared Python criterion. The code must compile and define verify; monitors using it grade with the new code and pass mark from their next admission
name
​string · minLength: 1 · maxLength: 200 · required

The criterion's label wherever criteria are listed

code
​string · required

Python 3.13 source defining verify(evidence) that returns Verdict.boolean(passed=…, reasoning=…) or Verdict.float(score=0..1, reasoning=…) from context_verifiers; standard library only besides that

passMark
​number · min: 0 · max: 1 · required

The 0..1 score at or above which a Verdict.float passes; a Verdict.boolean ignores it. Shown as a percentage

description
​string | null · maxLength: 1000

The line a monitor's verifier list shows under the name; null clears it, absent keeps the saved one

Save a Python check › Responses

Success

A saved shared Python criterion as the picker and editor show it
kind
​string · enum · required
Enum values:
code
criterionId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required

Current shared criterion display text

description
​string | null · required

The line a monitor's verifier list shows under the name; null when its author wrote none

updatedAt
​string · date-time · required

When the shared criterion last changed

monitorCount
​integer · min: 0 · required

Monitors in this organization using this shared criterion

code
​string · minLength: 1 · required

Python source as it was saved; checked against the save-time bounds when saved, not when read

passMark
​number · min: 0 · max: 1 · required

The 0..1 score at or above which a Verdict.float passes; a Verdict.boolean ignores it. Shown as a percentage


Save an agent criterion

PUT
https://context.example.com/api/v1/evals
/criteria/agent/{criterionId}
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

Creates or replaces a shared agent criterion (an agent judge) under an id you choose (a UUID). Its model must be one this deployment serves.

Save an agent criterion › path Parameters

criterionId
​string · uuid · required

Criterion identifier, a UUID the caller chooses; saving the same id again replaces it

Criterion (from the path)

Save an agent criterion › Request Body

Create or replace a shared agent criterion. The model must be one this deployment serves; monitors using it judge with the new settings from the next dispatched run
name
​string · minLength: 1 · maxLength: 200 · required

The criterion's label wherever criteria are listed

instructions
​string · minLength: 1 · maxLength: 20000 · required

Plain-language instructions the judge sub-agent follows: what to look at in the turn's files and answer, and what makes it pass

model
​string · minLength: 1 · maxLength: 200 · required

The model the judge sub-agent runs on, as the judge catalog names it

outputType
​string · enum · required

BOOLEAN: the judge answers Pass or Fail; FLOAT: a 0..1 score that passes at the criterion's pass mark

Enum values:
BOOLEAN
FLOAT
python
​boolean · required

Whether the judge may run Python on a scratch copy of the turn's files (never the originals, no network)

passMark
​number · min: 0 · max: 1 · required

The 0..1 score at or above which a FLOAT verdict passes; a BOOLEAN verdict ignores it. Shown as a percentage

description
​string | null · maxLength: 1000

The line a monitor's verifier list shows under the name; null clears it, absent keeps the saved one

Save an agent criterion › Responses

Success

A saved shared agent criterion as the picker and editor show it
kind
​string · enum · required
Enum values:
agent
criterionId
​string · minLength: 1 · maxLength: 200 · required
name
​string · required

Current shared criterion display text

description
​string | null · required

The line a monitor's verifier list shows under the name; null when its author wrote none

updatedAt
​string · date-time · required

When the shared criterion last changed

monitorCount
​integer · min: 0 · required

Monitors in this organization using this shared criterion

instructions
​string · minLength: 1 · required

Instructions as they were saved; checked against the save-time bounds when saved, not when read

model
​string · minLength: 1 · maxLength: 200 · required

The model the judge sub-agent runs on, as the judge catalog names it

outputType
​string · enum · required

BOOLEAN: the judge answers Pass or Fail; FLOAT: a 0..1 score that passes at the criterion's pass mark

Enum values:
BOOLEAN
FLOAT
python
​boolean · required

Whether the judge may run Python on a scratch copy of the turn's files (never the originals, no network)

passMark
​number · min: 0 · max: 1 · required

The 0..1 score at or above which a FLOAT verdict passes; a BOOLEAN verdict ignores it. Shown as a percentage


List shared criteria

GET
https://context.example.com/api/v1/evals
/criteria
Bearer (tsk_<prefix>_<secret>)
or
X-API-Key (header)

The organization's library criteria a monitor can bind (LLM judges, Python and agent criteria), by id order, one page at a time.

List shared criteria › query Parameters

search
​string · maxLength: 200
Default:
after
​string | null · minLength: 1 · maxLength: 200
Default: null
limit
​integer · min: 1 · max: 100
Default: 25

List shared criteria › Responses

Success

​array · required
nextCursor
​string | null · minLength: 1 · maxLength: 200 · required