Skip to content

google/agents-cli

The CLI and skills that turn any coding assistant into an expert at creating, evaluating, and deploying AI agents on Google Cloud.

https://skillcdn.ai/gh/google/agents-cli

Connect this address to your AI to use this skill. How to connect

  • Unverified
  • Default branchmain
  • Commit75e3caa
  • LicenseApache-2.0
  • Searchwords
View on GitHub

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.

Path
src/google/agents/cli/skills/data/google-agents-cli-eval/SKILL.md
License
Apache-2.0
author
Google
license
Apache-2.0
version
1.17.0

Warnings for the author

  • 1 "metadata" entries are ignored: expected short text keys and values
  • Listed once through the skills extension, as skills/google-agents-cli-eval/SKILL.md: this copy is identical.

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

FileRead when
references/dataset_schema.mdWriting or fixing cases: single-turn, multi-turn, multi-agent, per-case rubrics
references/metrics-guide.mdWriting eval_config.yaml or a custom metric, picking a built-in beyond the table below, or grading outside the global region
references/user-simulation.mdRunning eval dataset synthesize to generate multi-turn cases
references/builtin-tools-eval.mdThe agent uses Google Search, retrieval, URL context or code execution
references/multimodal-eval.mdCases carry images, audio or video, in the input or the output
references/build-eval.mdAsked for an eval suite, or growing past the core cases
references/hillclimb.mdClimbing 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

  1. 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.
  2. Run agents-cli eval run. It runs the agent, grades the traces, prints each metric's mean, any Failures: and a final RESULT: PASS|FAIL (...) line (or RESULT: NOT GATED when no thresholds are set), and writes results_<timestamp>.json and .html to artifacts/grade_results/.
  3. 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.
  4. 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).
  5. Rerun and compare each metric's mean_score and each case's score with the previous results file. Show the target metric rose and no other case regressed. <!-- remove when eval compare reports per-metric deltas with noise -->
  6. 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, follow references/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.

GoalMetric
Did the agent achieve the user's goal (recommended first built-in)multi_turn_task_success
Was the path logical and efficientmulti_turn_trajectory_quality
Were tool calls rightmulti_turn_tool_use_quality
Final response quality, no reference needed (single-turn)final_response_quality
Claims grounded in tool outputhallucination, or grounding when the case has context
Policy compliancesafety
Match a golden answerfinal_response_match (needs reference on the case)
Different criteria per caserubric_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 coversA 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

FailureChange
multi_turn_task_success lowOrchestration: missing tool calls, early stops, wrong tool choice
multi_turn_trajectory_quality lowPlanning prompts, instruction order, redundant tool calls
multi_turn_tool_use_quality lowTool descriptions, parameter docs, tool-selection instructions
final_response_quality lowThe instruction behind the worst-scoring rubric verdict
hallucination lowInstructions to stay grounded in tool output; check the tool returned what the agent claimed
Agent skips toolsFix the tool descriptions and the instruction; to force one call, see the framework's skill (ADK: adk-eval.md)
Judge ignores images or audioA 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 analyze clusters failure modes when many cases fail.
  • agents-cli eval optimize tunes 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 submit and agents-cli eval results run on the managed Eval Service, for CI or large datasets.

Files of this skill

Browse all supporting files