google-agents-cli-eval
Evaluates agents with agents-cli: eval cases, LLM-judge metrics, scores and the fix loop. Use when the user wants to evaluate or test the agent's answers, write eval cases, measure hallucination or tool use, compare runs after a change, make it cheaper or faster at the same quality, group failures, or auto-tune its instructions.
작성자를 위한 경고
- 1 "metadata" entries are ignored: expected short text keys and values
Agent evaluation
An eval runs the agent over a dataset of cases, grades each trace with metrics, and writes scores. The commands work for every agents-cli framework. agents-cli eval <cmd> --help gives flags and defaults.
Before the first eval run, read the framework's skill for this stage: the skill the project's guidance file (CLAUDE.md, GEMINI.md or AGENTS.md) names. On ADK, call the Skill tool with google-agents-cli-adk-code and read its references/adk-eval.md. No Skill tool: read its SKILL.md directly (../<skill-name>/ for a bundled skill, .agents/skills/<skill-name>/ for an extension's).
References
| File | Read when |
|---|---|
references/dataset_schema.md | Writing or fixing cases: single-turn, multi-turn, multi-agent, per-case rubrics |
references/metrics-guide.md | Writing eval_config.yaml or a custom metric, picking a built-in beyond the table below, or grading outside the global region |
references/user-simulation.md | Running eval dataset synthesize to generate multi-turn cases |
references/builtin-tools-eval.md | The agent uses Google Search, retrieval, URL context or code execution |
references/multimodal-eval.md | Cases carry images, audio or video, in the input or the output |
references/build-eval.md | Asked for an eval suite, or growing past the core cases |
references/hillclimb.md | Climbing toward a quality, cost or latency goal over rounds |
Find the eval files
A scaffolded project already has a dataset (datasets/basic-dataset.json), an eval_config.yaml and a local judge metric under tests/eval/ (Python) or eval/ (Go, Java, Kotlin and TypeScript; agents-cli info prints the language). Its default cases test the sample agent; replace them when you replace it.
No eval files? Write a dataset (references/dataset_schema.md) and a config (references/metrics-guide.md), then pass them with --dataset and --config.
agents-cli eval doesn't read a framework's own eval file, such as an ADK *.evalset.json (often with a test_config.json). Port its cases into a new dataset as the framework's skill describes (ADK: adk-eval.md) and leave the original untouched.
The loop
- Write 1 to 2 cases for the agent's core task. Take the pass bar from the spec's success criteria, or agree one with the user.
- Run
agents-cli eval run. It runs the agent, grades the traces, prints each metric's mean, anyFailures:and a finalRESULT: PASS|FAIL (...)line (orRESULT: NOT GATEDwhen no thresholds are set), and writesresults_<timestamp>.jsonand.htmltoartifacts/grade_results/. - After every run, paste each case's score per metric from the results JSON, and the
RESULT:line: a passing mean can hide a failing case. - Start from the
Failures:list (metrics below threshold, their cases, errored cases), then read those cases' judge rationales in the results file and fix the agent (What to fix). - Rerun and compare each metric's
mean_scoreand each case'sscorewith the previous results file. Show the target metric rose and no other case regressed. <!-- remove when eval compare reports per-metric deltas with noise --> - Repeat; 5 to 10 or more iterations per case is normal. Add cases only after the core cases pass (
references/build-eval.md). To climb toward a goal, followreferences/hillclimb.md.
eval run exits 1 when a metric's mean score is below its threshold (thresholds in the config, or --fail-under METRIC=SCORE, repeatable) or a case errored, so CI can gate on the exit code. No thresholds means only errored cases fail: agree them with the user and record them in the config (references/metrics-guide.md). Results JSON: summary_metrics[] holds each metric's mean_score and num_cases_error. Per case, eval_case_results[k].response_candidate_results[0].metric_results.<metric> holds score, explanation and error_message. Pair results with cases by eval_case_results[k].eval_case_index, not by position: evaluation_dataset[0].eval_cases[eval_case_index].eval_case_id names the case.
Check every dataset case is in the results: a case whose inference fails is dropped with a stderr warning. <!-- remove when failed cases count as errors -->
Scores average only the cases that graded: when grading warns that cases errored, find the cause in the results file before trusting the mean. When a score surprises you, run the sanity checks in references/hillclimb.md.
Past about 10 cases, hold back a few in a separate dataset file to catch fixes fitted to the iterated cases, and grade them only when you think you're done (a climb grades them each round).
Keep the bar: when a case fails, change the agent, not the bar or the expected output. For a flaky case, lower the agent's temperature, raise judge_model_sampling_count on a prompt_template judge, or switch to a rubric metric, and keep the case.
The loop is done when every case, held-back ones included, meets the bar on a run after your last edit.
Split eval run into eval generate and eval grade to regrade without rerunning the agent, or to grade traces from eval dataset synthesize. eval generate --url drives a running or deployed agent.
Local eval run and eval generate set USE_IN_MEMORY_SESSION=false, overriding your env, so the agent uses its configured session store. A 403 or a session-store error during a local eval comes from that store; the framework's skill shows how to evaluate on in-memory sessions (ADK: adk-eval.md). <!-- remove when eval generate honors USE_IN_MEMORY_SESSION -->
Before each deploy
Redeploys included, rerun agents-cli eval run after your last code change and paste every case's score, not only the fixed ones, plus the final RESULT: line. Done when every case meets the bar on that run. Then call the Skill tool with google-agents-cli-deploy for the deploy approval gate.
Choose metrics
Only the three multi_turn_* metrics below accept multi-turn traces; every other built-in returns a 400 on one. agents-cli eval metric list prints the built-ins.
| Goal | Metric |
|---|---|
| Did the agent achieve the user's goal (recommended first built-in) | multi_turn_task_success |
| Was the path logical and efficient | multi_turn_trajectory_quality |
| Were tool calls right | multi_turn_tool_use_quality |
| Final response quality, no reference needed (single-turn) | final_response_quality |
| Claims grounded in tool output | hallucination, or grounding when the case has context |
| Policy compliance | safety |
| Match a golden answer | final_response_match (needs reference on the case) |
| Different criteria per case | rubric_groups on the case, graded by a managed rubric metric (single-turn) or a local judge (multi-turn; references/metrics-guide.md) |
| A check no built-in covers | A custom LLM-judge or code metric (references/metrics-guide.md) |
Grade tool use with these rubric metrics, not a fixed call sequence, which fails when agents reorder calls or add steps.
What to fix
| Failure | Change |
|---|---|
multi_turn_task_success low | Orchestration: missing tool calls, early stops, wrong tool choice |
multi_turn_trajectory_quality low | Planning prompts, instruction order, redundant tool calls |
multi_turn_tool_use_quality low | Tool descriptions, parameter docs, tool-selection instructions |
final_response_quality low | The instruction behind the worst-scoring rubric verdict |
hallucination low | Instructions to stay grounded in tool output; check the tool returned what the agent claimed |
| Agent skips tools | Fix the tool descriptions and the instruction; to force one call, see the framework's skill (ADK: adk-eval.md) |
| Judge ignores images or audio | A custom metric with a vision-capable judge (references/multimodal-eval.md) |
User simulation
agents-cli eval dataset synthesize plays generated scenarios against a simulated user and writes multi-turn traces for eval grade (references/user-simulation.md). It and eval optimize run only on ADK Python projects and fail with an unsupported-language error on other languages; there, write multi-turn cases and tune prompts by hand.
Opt-in commands
agents-cli eval analyzeclusters failure modes when many cases fail.agents-cli eval optimizetunes the agent's prompt against a metric. It is long-running and expensive: run it only when the user asks, once, after fixing by hand, and apply the prompt it prints.agents-cli eval submitandagents-cli eval resultsrun on the managed Eval Service, for CI or large datasets.
이 스킬의 파일
skills/google-agents-cli-eval/references/build-eval.mdskills/google-agents-cli-eval/references/builtin-tools-eval.mdskills/google-agents-cli-eval/references/dataset_schema.mdskills/google-agents-cli-eval/references/hillclimb.mdskills/google-agents-cli-eval/references/metrics-guide.mdskills/google-agents-cli-eval/references/multimodal-eval.mdskills/google-agents-cli-eval/references/user-simulation.md