Skip to content
Context docs
Build

Monitors

A monitor grades a sample of your agents’ real requests as they finish.

This page creates and changes a monitor from the CLI. What a monitor is, and how it grades, are on Benchmarks and monitors. The CLI’s messages call a monitor a live evaluation.

Monitoring is off until your administrator turns it on for your organization. Until then, monitor commands exit 2. evals monitors list says Monitoring is off for this organization: no live evaluation is listed. The other evals monitors commands, criteria library, criteria share and results monitor:<id> say Benchmark API error 403: Monitoring is not enabled for this organization. In the app, the Evaluations page says “Monitoring is off for this organization” in place of monitors.

A key that has no person behind it can’t create, change or resume a monitor, because the monitor’s checks are charged to the person who last did.

Create a monitor

Copy your workspace ID as in the quickstart. Then find the agent’s ID, and the ID of a shared judge to grade with:

TerminalCode
context evals targets agent --search refunds --pick 'items[].id' context evals criteria library --search tone | jq '.items[] | {kind, criterionId, name}'

Save the monitor as monitor.json. This one grades a quarter of one agent’s requests with one shared LLM judge:

JSONCode
{ "name": "Refund answers", "passMark": 0.7, "verifiers": [], "source": { "live": { "targets": [{ "kind": "agent", "targetId": "<agent-id>", "samplePct": 25 }], "criteria": [{ "kind": "llm_judge", "criterionId": "<criterion-id>", "weight": 1 }] } } }

Instead of binding a shared judge in criteria, you can define an LLM judge (or a Python check with a passMark) in verifiers. Give it the fields of a dataset criterion plus an id you choose; it is saved to the shared library. An agent judge must be shared first (see Agent judge). context evals describe evaluation-create-input prints the full shape.

TerminalCode
MONITOR_ID=$(context evals monitors create --from monitor.json --workspace "$WORKSPACE_ID" --pick ref.id)

Grading starts with the next request. Running create twice makes two monitors.

Read results and change it

TerminalCode
context evals results "monitor:$MONITOR_ID" --limit 20 context evals monitors update "$MONITOR_ID" --pass-mark 0.8 context evals monitors pause "$MONITOR_ID"

Each result row has the request, the answer, its score, whether it passed and each criterion’s verdict. A change names the revision it read, so two people can’t overwrite each other: a change made after someone else’s is refused with exit 2. To change targets or criteria, save monitors get <id> --as-update to a file, edit it, and pass it back with monitors update <id> --from <file>. In the file, list every criterion as {kind, criterionId, weight}, using agent for an agent judge and code for a Python check. Pass --revision to pause and resume. monitors delete needs --revision and removes the monitor’s results too.

Over HTTP, the Monitors operations create, read, replace, pause and resume a monitor; Create a monitor takes the same body as monitor.json. A monitor’s results have no HTTP endpoint; read them with the CLI or the app. A trace session that a monitor’s agent judge ran in carries origin.monitor with the monitor’s ID and name.