# Google's Agent Anomaly Detection flags agent sessions that go out of scope

published: 2026-11-16T18:05:39.129Z
topic: infrastructure
source: https://developers.googleblog.com/securing-your-agents-a-hands-on-guide-to-agent-anomaly-detection/
url: https://aiagentnews.io/stories/google-s-agent-anomaly-detection-flags-agent-sessions-that-go-out-of-scope

Google has published a hands-on guide to Agent Anomaly Detection on the Gemini Platform, which reads the traces and logs agents already produce to flag sessions where an agent strays from its job. The walkthrough is in Private Preview and uses a sample customer support agent with an over-permissive tool.

Agent Anomaly Detection reads the traces and logs an agent already produces and flags sessions where the agent goes beyond the task it was built for. The guide walks through enabling it in a Google Cloud project approved for the Private Preview, using a companion notebook that runs on Google Colab or GitHub and calls the Agent Anomaly Detection API.

The demo agent has a fetch_records tool that accepts any table name, including a payroll table with employee data. Two test sessions were run: a normal refund conversation, and one where the user pulled payroll records. In that run, the top finding was Tool misuse at High severity with 95% probability, and the recommended fix was to restrict the tool to specific tables.

Setup requires exporting prompt and response content to Cloud Logging, which is supported in US and EU multi-regions, and enabling the feature takes around 30 minutes. Sessions are scanned within about 5 minutes, and findings can trigger alerts through Cloud Monitoring and Security Command Center.

## Why it matters if you build agents

Developers building agents with broad data-access tools can use these findings to see where an agent was steered outside its intended scope. Tools that read whole tables or accept arbitrary identifiers are the pattern the demo flagged, so scoping them to specific resources is the fix to plan for. Because detection depends on prompt and response content being logged, teams should check their telemetry settings before relying on it in production.
