Agentic AI
Google Agents CLI Adds Automated Testing Loop to Catch Agent Quality Regressions
A practical evaluation framework helps teams systematically improve AI agents through iterative testing, model swaps, and automated alerts.
Google Developers Blog (AI)
Building a working prototype of an AI agent takes days; keeping it reliable across model upgrades and tool changes takes discipline. Google's Agents CLI now includes an evaluation system designed to surface quality problems early through repeated testing, comparison, and automated detection—a technique known as hill-climbing.
How the Evaluation Loop Works#
The Agents CLI eval namespace consists of small, composable commands. eval generate runs an agent against a dataset of test cases, eval grade scores the resulting traces using custom metrics (like LLM-as-judge rubrics), eval compare shows side-by-side diffs between two test runs, eval analyze groups failures into patterns, and eval optimize automatically suggests prompt improvements.
The workflow mirrors standard software testing: write test cases, run the agent, grade the results, review failures, modify the agent, run again. If the score improves, keep the change. If it drops, revert. Over weeks of iteration, the agent's quality improves incrementally.
Starting Small: A Practical Example#
The walkthrough uses a four-case weather agent dataset:
- A simple greeting
- A weather query for San Francisco (which the tool handles correctly)
- A weather query for Rome (where the tool defaults)
- An off-topic question (about the 2024 World Series)
A baseline run produces a mean score of 4.0 out of 5 with a standard deviation of 1.41—spread indicates the dataset challenges different behaviors. A flat 5.0 would suggest the test is too easy.
Catching Regressions in Action#
The article demonstrates a realistic bug: a developer accidentally pastes a chef-persona system prompt into the weather agent. The code compiles, passes lint and unit tests, but the eval immediately detects trouble:
- Baseline mean: 4.0
- After wrong prompt: 2.75 (a 1.25-point drop)
The per-case breakdown reveals how the prompt broke each scenario:
- Greeting: 5.0 → 4.0 (agent pitched recipes unprompted)
- SF weather: 4.0 → 2.0 (agent ignored the weather tool and hallucinated conditions)
- Rome weather: 2.0 → 2.0 (no change, already poor)

