EvalSet schema for either framework. Harnest validates these files during compilation.
Custom questions do not require a custom Python metric. Use this page to author cases with built-in scoring, or follow Create custom evals when you need to implement your own scoring rule.
Add an evaluation
-i and --interactive also work.
evals/<name>.evalset.json and add missing criteria to the shared evals/test_config.json. Existing criteria and settings are preserved; shared criteria apply to sets without a configuration of their own. Edit the sample cases, thresholds, and rubrics before running harnest test . --evals. Scaffolding does not install dependencies or call a model.
Custom scoring creates only lib/<name>.py; implement it and register the metric. Names use underscores in generated files. Use --project PATH when running outside the agent folder.
Save a Playground conversation
After a chat turn in localharnest serve, select Save as eval, choose an existing suite or create one, review the expected replies, then select Save eval. The case is written directly to the agent’s evals/ folder. Restart plain serve to run the updated suite in the Playground, or use harnest serve --reload to pick up changes automatically. Sessions without a writable local workspace offer Download eval instead.
Directory contract
AGENT_DIR/evals/
Nested SubAgent eval assets may be reached while validating composition, but
harnest test --evals runs only the root agent’s eval sets.
Author a static case
A static case replays each authoreduserContent and records the actual agent response. The authored finalResponse and intermediateData are the golden values used by reference metrics.
evals/city-facts.evalset.json
history="session" for this test. See Agents and graphs.
The expected behavior is explicit per turn:
Inspect per-turn content, tool events, and session evidence in Run and inspect evaluation results.
Case fields
Exactly one of
conversation and conversationScenario is required.
Invocation fields
Scoring excludes provider-marked reasoning and retains visible text and tool events.
Score sets independently
To scoretool_calls.evalset.json only on tool use, create a configuration with the same set name:
evals/tool_calls.test_config.json
evals/test_config.json unless they have a configuration of their own. All cases in a set use the same criteria. Split cases into different sets when they need different scoring.
Use response_match_score when the wording of a reference answer matters. A longer, semantically correct answer can score poorly on text overlap. For open-ended answers, use a rubric or a judge metric from the metrics reference.
Configure criteria
Every key undercriteria names a built-in or custom metric. A numeric value is a threshold. Metrics with judge, rubric, hallucination, simulation, or trajectory options use an object containing threshold and their additional fields.
evals/test_config.json
Choose tool trajectory behavior
The trajectory policy affects onlytool_trajectory_avg_score, preserving its threshold.
matchType for this metric. Use separate business and strict CI lanes when you need both behavioral confidence and exact orchestration.
Add rubrics
Rubric metrics require at least one testable property. The simplest reusable location is the metric criterion intest_config.json:
type to FINAL_RESPONSE_QUALITY, TOOL_USE_QUALITY, or TRAJECTORY_QUALITY so ADK routes them to the intended built-in rubric evaluator. Keep rubricId values unique within the effective set. Criterion-level rubrics do not need a type. See Metrics reference for judge configuration and score behavior.