---
type: "post"
id: "securing-your-agents-a-hands-on-guide-to-fe8397"
slug: "securing-your-agents-a-hands-on-guide-to-fe8397"
title: "Securing Your Agents: A Hands-On Guide to Agent Anomaly Detection"
description: "Google's hands-on guide demonstrates Agent Anomaly Detection on the Gemini Platform, from telemetry setup through anomaly review and alerting."
retrieval_nugget: "Google's hands-on guide demonstrates Agent Anomaly Detection on the Gemini Platform, from telemetry setup through anomaly review and alerting."
published_at: "2026-11-17"
updated_at: "2026-11-17"
record_date: "2026-11-17"
date_kind: "published_at"
topics: ["google","gemini"]
entities: ["Google","Gemini Platform","Agent Anomaly Detection","Agent Development Kit","Cloud Monitoring","Security Command Center"]
related_patterns: ["agent-security-moves-to-runtime-boundaries"]
novelty_label: "new_fact"
what_changed: "Google adds a hands-on guide for enabling Agent Anomaly Detection, testing normal and out-of-scope agent sessions, reviewing findings, and setting up alerts."
prior_refs: []
source_url: "https://developers.googleblog.com/securing-your-agents-a-hands-on-guide-to-agent-anomaly-detection"
source_urls: ["https://developers.googleblog.com/securing-your-agents-a-hands-on-guide-to-agent-anomaly-detection"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:securing-your-agents-a-hands-on-guide-to-fe8397"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/securing-your-agents-a-hands-on-guide-to-fe8397/","markdown":"https://newruntime.com/posts/securing-your-agents-a-hands-on-guide-to-fe8397.md","json":"https://newruntime.com/posts/securing-your-agents-a-hands-on-guide-to-fe8397.json"}
markdown_url: "https://newruntime.com/posts/securing-your-agents-a-hands-on-guide-to-fe8397.md"
---

# Securing Your Agents: A Hands-On Guide to Agent Anomaly Detection

## Retrieval answer

Google's hands-on guide demonstrates Agent Anomaly Detection on the Gemini Platform, from telemetry setup through anomaly review and alerting.

## Summary
Google's hands-on guide demonstrates Agent Anomaly Detection on the Gemini Platform, from telemetry setup through anomaly review and alerting. For teams building agents, it turns behavioral monitoring into a testable workflow, but requires Google Cloud and Private Preview access.

## What happened
Google's November 16, 2026 guide by Achuth Narayan Rajagopal and Derek Luan walks through setting up Agent Anomaly Detection on a sample customer-support agent. The service analyzes agent traces and logs, then flags sessions in which behavior appears outside the agent's intended job. The guide frames the tool as a way to find risky behavior that may not produce a crash or logging error.

The sample agent, named `anomaly-detection-refund-demo`, can check order history and request refunds. Its `fetch_records` tool is deliberately over-permissive: it accepts any table name, including a simulated payroll table. Google says the dataset is canned and held in memory; no real data is read or refunded. The guide enables telemetry and message-content logging through three deployment environment variables, then sends a test request. Agent Anomaly Detection discovers agents through telemetry, so an agent must have served a request to appear as monitored. The sample deployment takes about five to ten minutes.

The prerequisites include a Google Cloud project approved for the service's Private Preview, billing, specified administrator and logging roles where needed, and a Cloud Logging bucket plus an Observability dataset in the same US or EU multi-region. The notebook can run in Google Colab, Colab Enterprise, or local Jupyter. It installs the latest Python ADK; the service supports ADK 1.2 and later, with ADK 2.0 or later preferred. Google says setup takes around 30 minutes. The guide has users enable automatic monitoring, send one ordinary session and one out-of-scope session, and inspect the resulting findings. Sessions that began before monitoring are not analyzed.

In Google's test, scanning takes up to five minutes. The detailed view shows session severity, conversation transcript, detector, probability, explanation, and recommendations. The example's top finding was “Tool misuse,” rated High with 95% probability; Google notes that detector results and severities can vary because the analysis models are non-deterministic. Its recommended fix is to restrict `fetch_records` to specific tables. Individual invocations were Medium, while their combined session was High.

The final steps configure alerts. Cloud Monitoring exposes metrics for detected events and monitored agents. The guide demonstrates a five-minute rolling window with a delta function and a threshold above zero, then suggests adding a severity filter once the team's normal behavior is understood. A metric-absence policy can alert if monitoring stops. When Security Command Center is enabled, anomalies are also published as `AGENT_SESSION_ANOMALY` findings.

## What the archive adds
New Runtime's October 22, 2026 [earlier coverage on reviewing agent sessions for security issues](https://newruntime.com/posts/how-to-review-your-agents-for-security-issues-63fda7/) described post-run review as a way to turn traces into ranked, evidence-backed human work. Google's guide adds a concrete monitoring setup and proactive alert path: this is a new fact on the broader agent-security story, not a restatement of that review workflow.

## Trend signal
This supports the view that agent security is moving toward runtime boundaries: traces, tool permissions, monitoring coverage, and operational alerts matter alongside instructions. The connection is closest to New Runtime's [agent security runtime-boundary pattern](https://newruntime.com/patterns/agent-security-moves-to-runtime-boundaries/), though Google's anomaly detection is a detection layer, not a substitute for constraining what tools can access.

## Why now
Google says agents' expanding capabilities make the cost of a bad decision higher, and points to examples of agents exposing personal information or bypassing access controls. The guide's timing reflects a practical response: test detection and alerting before connecting production agents to sensitive systems.

## Connections to other events
New Runtime's November 13, 2026 coverage of OpenAI's use of more than 500 persistent OpenClaw agents described separating trusted infrastructure from agent execution and restricting permissions. Google's guide meets that operational concern from another angle: it shows how to detect suspicious sessions and route findings into monitoring and security workflows.

## Why it matters
An agent can violate its intended role without failing technically. A successful response may still disclose data or misuse an overbroad tool, so uptime and ordinary error logs are not enough to establish safety. Google's example makes that gap legible: the agent's risk comes from a tool accepting arbitrary table names, while a sequence of seemingly ordinary requests exposes the flaw.

For teams using Google Cloud, the guide offers an end-to-end starting point for testing whether telemetry is present, whether a suspicious session is detected, and whether someone will be alerted. Its alerting example also distinguishes detection from coverage: teams can track both anomalies and whether agents remain monitored. The core security lesson is not to rely on detection alone. Restrict tools to the data and actions an agent actually needs, then use session analysis to catch cases that preventive controls miss.

## Limits and uncertainty
This is a vendor-authored demonstration, not an independent evaluation of detection quality. Google does not report false-positive or false-negative rates, performance across different agent workloads, or the operational cost of monitoring. The sample uses canned in-memory records and a deliberately flawed tool, so it does not establish how well the detector handles real production data or subtle misuse. Google says the service is in Private Preview and requires approved project access; broader availability, pricing, and retention details are not specified in the guide. The 95% probability and High severity are results from one run, and Google warns they may differ because the analysis is non-deterministic.

## Skill to build now
This week, build a safe test agent with synthetic data and two separate sessions: one ordinary task and one deliberately out-of-scope request. Make sure telemetry includes the prompt, response, and tool activity, then verify that a finding reaches the team through its alerting path. If using Google's service, the guide's sample alert starts with a five-minute rolling window and a threshold above zero; add severity filters only after you understand normal findings. Keep the test tool isolated and never reproduce its unrestricted table access against real data.

## Reader takeaway
Treat agent monitoring as a tested control, not a dashboard checkbox. Instrument the agent, exercise it with a safe out-of-scope scenario, confirm the finding and alert path, and fix excessive tool permissions; anomaly detection can help catch what prevention misses, but it does not replace least privilege.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Google](https://newruntime.com/topics/google.md): Explore the google topic hub.
- topic hub: [Gemini](https://newruntime.com/topics/gemini.md): Explore the gemini topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
