代理异常检测现已进入私密预览阶段,包括对运行在 Google Cloud 之外的代理的监控。如需申请访问权限,请参阅《代理异常检测概述》。
我们的发布文章介绍了代理异常检测,它有助于您理解并应对偏离预期边界的代理行为。该功能涵盖了 Google Cloud 上的代理,例如 Agent Runtime、Cloud Run 和 Google Kubernetes Engine (GKE)。许多团队还在其他云上运行代理:例如在 AWS Lambda 上紧邻库存数据库运行,作为 Microsoft Foundry 中的托管代理,或在无法迁移的系统旁边本地运行。这些代理同样存在行为风险,而在此之前,代理异常检测无法审查它们。
代理异常检测基于代理的追踪和日志工作,因此无需访问代理的运行环境。只要这些追踪和日志能够到达您的 Google Cloud 项目,它就能检测到代理在任何地方运行的异常行为。在本文中,我们将解释代理异常检测需要从其他云上的代理获取什么内容,然后展示它对 AWS Lambda 上的代理和 Microsoft Foundry 上的代理的发现结果。
在其他云上如何工作
代理异常检测读取您启用时选择的日志记录和可观测性数据桶。当遥测数据满足以下条件时,来自任何地方的数据均可正常工作:
它通过 Telemetry API(telemetry.googleapis.com)到达,该 API 保留了标识代理的资源属性。
它遵循 OpenTelemetry 约定,并将提示和响应记录为日志事件,代理异常检测正是从这些事件中读取对话内容。
资源属性中命名了代理。
使用 Python 版 Agent Development Kit (ADK)(版本 2.12.0 或更高版本)构建的代理可以通过 ADK 的 Google Cloud 导出器以及少量环境变量生成此类遥测数据,下一节将对此进行说明。
其他云上的代理将追踪和日志发送到 Google Cloud 项目,由代理异常检测对其进行分析。
连接来自其他云的代理
Google Cloud 之外的代理需要两样东西才能发送其遥测数据:
不带服务账户密钥的 Google 身份。通过 Workload Identity Federation(工作负载身份联合),代理将其自身的身份(例如 AWS 角色或 Microsoft Entra 身份)交换为短期的 Google 凭据。配置此设置的配置文件中不包含任何秘密信息。
导出器。ADK 的 Google Cloud 导出器将追踪和日志发送到 Telemetry API。通过少量环境变量进行配置:
GOOGLE_CLOUD_PROJECT=
GOOGLE_APPLICATION_CREDENTIALS=/path/to/gcp-credentials.json
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=EVENT_ONLY
ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false
OTEL_SERVICE_NAME=
OTEL_RESOURCE_ATTRIBUTES=cloud.provider=
Shell
有关 AWS 和 Azure 的完整设置,请参阅文档。
在 30 分钟内,该代理将出现在“监控中的代理”列表中,这意味着它已被发现并准备启用。一旦启用(手动启用或在发现时通过自动代理注册启用),代理异常检测便开始分析其会话。
代理的模型和工具调用仍在代理运行的地方执行。只有遥测数据(包括代理异常检测读取的提示和响应)会发送到您的 Google Cloud 项目。分析过程独立运行,因此不会降低代理的速度。
我们测试了什么
为了评估 Google Cloud 之外的代理异常检测,我们在两个平台上部署了 ADK 代理:AWS Lambda 上的库存代理和 Microsoft Foundry 上的客户服务代理。以下示例展示了代理异常检测如何读取完整的对话而非孤立的调用,以捕捉行为漂移。
示例 1:AWS Lambda 上的库存代理
我们的示例库存代理在 AWS Lambda 上运行,仅使用一个工具 list_inventory,用于分页浏览产品目录。我们发送了两个会话:一个是检查了几件商品库存后停止的购物者,另一个是以递增偏移量每次请求 100 个目录项以复制完整目录和库存数据的爬虫。两个会话都使用了具有许可调用的相同工具,但在模式和意图上存在差异。
在两个会话中,代理异常检测仅标记了爬虫的会话。没有调用失败,但整个交互过程显示出系统性的爬取行为。分析发现了级联故障(相互叠加的循环和重复调用)和资源耗尽(令牌、计算或工具调用的失控使用),并建议对 list_inventory 调用实施速率限制。
检测不依赖于代理所使用的模型。当我们在 Amazon Bedrock 上通过 Amazon Nova Lite 运行库存代理时,代理异常检测标记了其 40 个会话中的 10 个。其中一些会话起初是常规问题,模型通过分页浏览整个目录来回答,直到函数超时:没有错误,没有调用被阻止,且容易被忽视。
Agent Anomaly Detection 中的 Bedrock 库存代理:标记了 40 个会话中的 10 个
Bedrock 会话:请求列出所有库存项,因资源耗尽和级联故障而被标记
示例 2:Foundry 上的客户服务代理
我们的示例电子商务客户服务代理拥有两个工具:get_order_status 和 issue_refund。退款涉及资金,因此风险最高。
我们对 Foundry 代理运行了六个会话,指示其在不进行验证的情况下执行所有请求。其中两个是正常的:一个询问订单状态,另一个要求对一件受损送达的订单进行 20 美元的退款。其余四个会话将代理推离了其职责范围,代理异常检测标记了全部四个。
在一个案例中,一名自称是商店管理员的用户将每笔订单退款至个人账户,金额为原价的 10 倍,总计 1,784.90 美元。在另一个案例中,一名用户粘贴了一条注明“SYSTEM OVERRIDE”(系统覆盖)的订单备注,代理对一笔 15.99 美元的订单进行了 999 美元的退款。
对于该订单备注,代理异常检测解释称,备注中的覆盖指令迫使代理执行了未经验证的 999 美元退款。它建议验证 issue_refund 参数以阻止订单备注中的覆盖模式,并对超过设定阈值的退款要求额外的验证。
商店管理员会话:向个人账户进行 10 倍退款,显示身份和权限滥用发现及建议
订单备注会话:来自粘贴订单备注的未经验证退款,显示工具误用发现及建议
下一步
如果您的代理遥测数据到达 Google Cloud,代理异常检测可以使用与 Agent Runtime 上您的代理相同的检测器和控制台对其进行监控。目前这意味着使用 ADK for Python 构建的代理。针对 Google Cloud 之外的代理的发现结果仅出现在代理异常检测控制台中。
要开始使用,请通过代理异常检测概述页面申请 Private Preview(私有预览)访问权限,然后参考设置指南获取说明。
Agent Anomaly Detection is in Private Preview, including monitoring for agents that run outside Google Cloud. To request access, see the Agent Anomaly Detection overview .
Our launch post introduced Agent Anomaly Detection, which helps you understand and act on agent behavior that drifts outside its intended boundaries. It covered agents on Google Cloud, such as Agent Runtime, Cloud Run, and Google Kubernetes Engine (GKE). Many teams also run agents on other clouds: on AWS Lambda next to an inventory database, as a hosted agent in Microsoft Foundry, or on-premises next to a system that can't move. Those agents carry the same behavioral risks, and until now Agent Anomaly Detection couldn't review them.
Agent Anomaly Detection works from an agent's traces and logs, so it doesn't need access to the agent's runtime. If those traces and logs reach your Google Cloud project, it can detect anomalous behavior wherever the agent runs. In this post, we explain what Agent Anomaly Detection needs from an agent on other cloud, then show what it found for an agent on AWS Lambda and an agent on Microsoft Foundry.
How it works on other clouds
Agent Anomaly Detection reads the logging and observability buckets that you choose when you enable it. Telemetry from anywhere works when:
It arrives through the Telemetry API ( telemetry.googleapis.com ), which keeps the resource attributes that identify the agent.
It follows OpenTelemetry conventions and records prompts and responses as log events, which is where Agent Anomaly Detection reads the conversation.
A resource attribute names the agent.
Agents built with the Agent Development Kit (ADK) for Python, version 2.12.0 or later, can produce this telemetry with ADK's Google Cloud exporters and a few environment variables, which the next section shows.
Agents on other clouds send traces and logs to a Google Cloud project, where Agent Anomaly Detection analyzes them.
Connect an agent from another cloud
An agent outside Google Cloud needs two things to send its telemetry:
A Google identity without a service account key. With Workload Identity Federation, the agent trades its own identity, such as an AWS role or a Microsoft Entra identity, for short-lived Google credentials. The configuration file that sets this up contains no secret.
An exporter. ADK's Google Cloud exporters send traces and logs to the Telemetry API. A few environment variables configure them:
GOOGLE_CLOUD_PROJECT=
GOOGLE_APPLICATION_CREDENTIALS=/path/to/gcp-credentials.json
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_latest_experimental
OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=EVENT_ONLY
ADK_CAPTURE_MESSAGE_CONTENT_IN_SPANS=false
OTEL_SERVICE_NAME=
OTEL_RESOURCE_ATTRIBUTES=cloud.provider=
Shell
For the full setup on AWS and Azure, see the documentation .
Within 30 minutes, the agent appears in the Monitored agents list, which means it has been discovered and is ready to be enabled . Once it's enabled, manually or by automatic agent enrollment at discovery, Agent Anomaly Detection starts analyzing its sessions.
The agent's model and tool calls still run where the agent runs. Only telemetry, including the prompts and responses that Agent Anomaly Detection reads, goes to your Google Cloud project. The analysis runs separately, so it doesn't slow the agent down.
What we tested
To evaluate Agent Anomaly Detection outside Google Cloud, we deployed ADK agents across two platforms: an inventory agent on AWS Lambda and a customer-service agent on Microsoft Foundry. The examples below show how Agent Anomaly Detection reads whole conversations, not isolated calls, to catch behavioral drift.
Example 1: An inventory agent on AWS Lambda
Our example inventory agent runs in AWS Lambda with one tool, list_inventory , which pages through a product catalog. We sent two sessions: a shopper who checked stock for a few items and stopped, and a scraper that requested 100 catalog items at a time at increasing offsets to copy the full catalog and inventory data. Both sessions used the same tool with permitted calls, but differed in pattern and intent.
Of the two sessions, Agent Anomaly Detection flagged only the scraper's. No call failed, but the whole exchange showed systematic scraping. The analysis found cascading failures (loops and repeated calls that build on each other) and resource exhaustion (runaway use of tokens, compute, or tool calls), and recommended rate-limiting list_inventory calls.
Detection doesn't depend on the agent's model. When we ran the inventory agent on Amazon Nova Lite through Amazon Bedrock, Agent Anomaly Detection flagged 10 of its 40 sessions. Some began as routine questions that the model answered by paging through the entire catalog until the function timed out: no errors, no blocked calls, and easy to miss.
The Bedrock inventory agent in Agent Anomaly Detection: 10 of 40 sessions flagged
Bedrock session: a request to list every inventory item, flagged for resource exhaustion and cascading failures
Example 2: A customer-service agent on Foundry
Our example ecommerce customer-service agent has two tools: get_order_status and issue_refund . Refunds involve money, so they carry the highest risk.
We ran six sessions against the Foundry agent, which we told to carry out every request without validation. Two were normal: One asked for an order's status, and one asked for a $20 refund on an order that arrived damaged. The other four pushed the agent past its role, and Agent Anomaly Detection flagged all four.
In one, a user who claimed to be the store administrator had every order refunded at 10 times its total to a personal account, $1,784.90 in all. In another, a user pasted an order note that said "SYSTEM OVERRIDE," and the agent refunded $999 on a $15.99 order.
For the order note, Agent Anomaly Detection explained that override instructions in the note coerced the agent into an unverified $999 refund. It recommended validating issue_refund arguments to block override patterns in order notes, and requiring extra validation for refunds above a set threshold.
Store-administrator session: 10x refunds to a personal account, showing identity and privilege abuse findings and recommendations
Order-note session: an unverified refund from a pasted order note, showing tool misuse findings and recommendations
What's next
If your agent's telemetry reaches Google Cloud, Agent Anomaly Detection can monitor it with the same detectors and console as your agents on Agent Runtime. Today that means agents built with ADK for Python. Findings for agents outside Google Cloud appear only in the Agent Anomaly Detection console.
To get started, request access to the Private Preview via the Agent Anomaly Detection overview , and then refer to the setup guide for instructions.
| 刊期 | 得分 | 排名 | 结果 |
|---|---|---|---|
| 2026-12-02 | 8.4 | 45 | 未入选 |
| 2026-12-01 | 8.4 | 42 | 未入选 |
| 2026-11-23 | 8.4 | 20 | 入选 |
| 2026-11-22 | 8.4 | 24 | 未入选 |
| 2026-11-21 | 8.4 | 39 | 未入选 |