Google AQuA: An Open-Source Agent That Catches Silent AI Failures in Production and Points to the Exact Prompt LineArticle · digest for November 30
Minimalist poster-style illustration showing a diagnostic scanner detecting hidden defects among green status signals.
Article3 sections≈ 8 min

Google AQuA: An Open-Source Agent That Catches Silent AI Failures in Production and Points to the Exact Prompt Line

When a normal backend breaks, monitoring screams right away with red alerts, 500 codes, and stack traces. Production AI agents behave differently. Dashboards stay green, the API returns HTTP 200, latency looks fine, and no tool crashes. Yet the bot politely confirms seat 3A for a customer without checking if it's free, or recommends a Bistecca alla Fiorentina steak to a vegan traveler in Florence.

These misses are called silent failures: technically everything looks clean and the reply sounds smooth, yet the task fails. Customers rarely complain when this happens. They just close the tab and leave.

Agents have two quality loops. The inner loop runs before launch, where scripted tests quickly get your bot to around 80%. Then the outer loop begins: real people asking unexpected questions, changing plans mid-chat, and interacting across model updates. Reading thousands of chats by hand isn't realistic, and standard monitoring is blind to reply meaning.

To solve this, Google released AQuA (Ambient Quality Agent) as open source under Apache-2.0 (v0.4.0) in google/adk-recipes. It runs alongside your main bot without slowing replies or editing anything automatically, scanning logs to deliver a list of verified bugs tied to specific lines in your prompt.

How Google AQuA's Five-Step Pipeline Works

If you just hand a pile of conversations to a language model and ask 'where are the mistakes?', it will invent problems out of thin air. Google split the audit into five steps and separated detection from verification across different models.

Diagram of Google AQuA's five-stage pipeline: sampling and review through independent verification, tracking, and code-snapshot diagnostics (Source: Google Developers Blog)

In the Sample step, the agent pulls a random sample (ORDER BY RAND()) of up to 1,000 recent sessions from Google Cloud telemetry (BigQuery Agent Analytics, Cloud Trace _AllSpans, or Cloud Logging). In the Review step, an auditor model checks each conversation in one pass against the bot's instructions, tool list, goal.md file, and a built-in 9-point checklist. That checklist covers step order, response format, tool selection, arguments, error handling, task completion, grounding without fabrication, response quality, and conflicts between the prompt and tool definitions. Each miss is logged as an actual / expected pair.

Next, Cluster groups similar failures into candidate clusters. Then two-stage verification (Verify) kicks in: a second independent model re-reads up to three full conversations per cluster (up to 50 clusters per run) and drops unconfirmed guesses. Confirmed issues move to Track in BigQuery with NEW and RECURRING statuses. If a bug doesn't show up for 14 days, it auto-closes as RESOLVED, while false alarms can be cleared with Dismiss.

By default, runs happen once a day at 12:00 UTC, about 15 minutes after each redeploy, or on demand. You can test the dashboard locally without Google Cloud or API keys in demo mode. Production setups connect to Google ADK (Agent Development Kit, Google's open multi-agent framework) via agents-cli 1.10+:

# Local demo mode without Google Cloud, API keys, or model calls
git clone https://github.com/google/adk-recipes.git
cd adk-recipes/core/python/ambient-quality-agent
make demo

# Connect to an agents-cli bot and trigger the first run
agents-cli extension add \
  google/adk-recipes#core/python/ambient-quality-agent \
  --ref ambient-quality-agent/v0.4.0
agents-cli install
export TF_VAR_ui_iap_members='["user:you@example.com"]'
agents-cli infra single-project \
  --project="${GOOGLE_CLOUD_PROJECT}" --apply-aqua --apply
agents-cli deploy --project="${GOOGLE_CLOUD_PROJECT}" --deploy-aqua
agents-cli aqua schedule-investigation --wait

There is also a middle ground, make standalone: the dashboard runs locally on localhost:8080 while reading real logs from Google Cloud. At Vertex AI rates, auditing 96 single-agent sessions costs around $0.70, 32 multi-agent sessions cost $3.76, and an on-demand root-cause analysis for one bug runs $0.33–$2.47.

To keep the auditor from nitpicking greeting styles, you give it a short goal.md:

# Example goal.md: agent goal, main risks, and noise list
Goal: Help travelers move from trip inspiration to confirmed bookings,
grounded in tool results and the traveler's profile.

Failure modes to make sure we cover:
- Mid-conversation changes: updated dates or flights must propagate to
  subsequent sub-agent calls.
- Dropped context when handing off across inspiration_agent,
  planning_agent, and booking_agent (such as traveler preferences).

Ignore: tone, greetings, small talk, or sessions where the user browses
options and leaves without booking.

The Ignore section cuts half the noise. Without it, the auditor complains about 'dry goodbyes' or shoppers who just browse prices and leave. Clear boundaries ensure only real logic failures reach your report.

Line-Level Pinpointing, Google's Test, and Where the Setup Falls Short

Every agents-cli deploy saves a snapshot of the agent's code to Cloud Storage. When asked from the dashboard chat or via agents-cli aqua run, AQuA matches traces against that snapshot and outputs <path>:<lines> along with a draft patch. There is no confidence field in the schema; reliability rests on Cloud Trace links and server-side quote verification. If the model invents a file path or line number, the system rejects it. If an external service goes down, AQuA flags the failing step instead of editing your code.

Google AQuA web dashboard on the travel-concierge test: 6 confirmed systemic failures mapped to exact prompt lines and 3 rejected false clusters (Source: Google Developers Blog)

In Google's test, AQuA scanned 32 replay sessions of the multi-agent travel-concierge (1,583 OpenTelemetry spans). The auditor flagged 42 issues across 9 clusters. A second model (Gemini 3.7 Flash) filtered out 3 false clusters (in two, the user asked to skip straight to booking; the third mixed unrelated issues) and left 6 confirmed bugs.

The top three findings look familiar: planning_agent skipped calling the seat-selection sub-agent whenever the user named seats 3A and 3B (travel_concierge/sub_agents/planning/prompt.py:93). inspiration_agent dropped food_preference: vegan when handing off to place_agent (travel_concierge/sub_agents/inspiration/prompt.py:23). Meanwhile, poi_agent required verified Google Maps links yet had tools=[] in code, causing it to invent https://example.com/... placeholders in five sessions.

Developers made two single-line prompt edits in planning_agent and inspiration_agent, left poi_agent untouched, and ran the audit again.

Google travel-concierge test: impact of two one-line prompt edits

Dropping the vegan profile disappeared completely, skipped seat checks fell to two edge cases, and fully clean chats more than doubled. The untouched poi_agent bug stayed honestly in the queue. Any failing session can be exported with agents-cli aqua get-insight and replayed locally via adk run --replay before opening a pull request.

This approach has clear limits, though. The test used recorded replays rather than live traffic where external databases shift constantly. Random sampling of up to 1,000 sessions out of 50,000 daily chats can easily miss a silent bug hitting 1% of users. Checking three sessions per cluster confirms the bug exists without guaranteeing every session in the cluster shares the exact same cause. Also, verification is off by default on main (requiring aqua attach --verification), and attachments like PDFs copy into aqa-trajectory-files/—turn that off for sensitive data with AQA_STORE_TRAJECTORY_FILES=false.

How to Borrow This Approach Without Google Cloud or ADK

Even if your bot runs on a plain server or in Telegram without Google Cloud, you can adopt its two best ideas in one evening.

First, apply a Must Test to your prompts. A common mistake is writing polite instructions with 'try to,' 'ideally,' or 'when possible.' Models read soft wording as optional advice and skip the step the moment a user goes off-script. Replace soft phrases with hard rules (must, always, never) plus an explicit fallback:

# Before: soft wording that models easily skip
Try to check seat availability before booking.
Ideally consider dietary preferences from the user profile.

# After: strict rules with a fallback action
You MUST call flight_seat_selection_agent before confirming any seat,
even if the user named a seat directly. NEVER confirm a seat without
a tool response. If the service is unavailable, tell the user and
offer to pick a seat later.

The fallback at the end matters just as much as the ban. Without it, the model will improvise and guess a status the first time an API times out.

Second, run a manual five-step audit in any strong LLM chat like Claude or Gemini. Export 100 recent bot conversations and give the model 3–5 simple rules: don't confirm unverified data, don't invent dates or prices, and hand off to a human immediately on negative sentiment. Ask it to list failures, group them by type, and count frequencies.

Then comes the step people most often skip. Never ask the same chat to verify its own findings—the model will happily agree with its earlier guesses in context. Open a brand-new clean chat with zero memory of the first pass, paste the grouped failures alongside raw transcripts, and tell it to cross out anything not supported word for word. Save the report, fix the top three issues, and audit 100 fresh chats next week to see which bugs vanished, which came back, and which new ones appeared.

Want a deep diveVotes help us choose what to break down in detail. This material has 0 votes.
Sources · 3