Skip to main content
Create a small evaluation for a project agent, execute it, and inspect the measured result before expanding the dataset.

Before you start

You need curl, jq, uuidgen, an API credential with permission to manage evaluation definitions and create and read runs, and a project agent you can run. The example uses triage-agent in support-assistant. The example checks whether an answer contains billing. That demonstrates one metric; choose cases and metrics that reflect your application’s requirements.

1. Create the evaluation

Call POST /projects/{project_reference}/evals to create a source definition:
create-evaluation.sh
Keep the returned id as EVAL_ID. Pass this source definition ID unchanged in the run configuration.

2. Make the definition available to the runtime

Deploy a release containing the new evaluation and its target agent. Set ENVIRONMENT_ID to the available environment where that release is deployed. Set PROJECT_ID to the project’s UUID. The selected environment must belong to that project and contain the evaluation and target agent. An environment runtime selects that environment’s deployed evaluation source. Managed preview environments resolve to the main-branch source and runtime. See the run creation reference for other runtime selections.

3. Start the evaluation task

Call POST /runs with the task:eval target:
run-evaluation.sh
Expect HTTP 202 and a run object with a top-level id. A credential without read access receives only run_id and status; this walkthrough requires read access. Reuse the same idempotency key and request body when retrying creation. Use a new key for a separate evaluation run. The task reads the selected evaluation source and runs it against the selected runtime.

4. Inspect status and retrieve the report

Read GET /runs/{run_id}:
read-evaluation-run.sh
For a failed execution, inspect the error and run events before treating the result as an agent-quality failure. A waiting execution needs its recorded input or resume condition. Retrieve the report only after execution completes. When the response lists a report artifact, retrieve it with GET /runs/{run_id}/artifacts/{artifact_id}:
read-evaluation-report.sh
Check the case results and metric outcomes. A completed execution does not imply every quality check passed. Keep the same cases and relevant settings when assessing a changed agent definition.

API references