AI代理如今能够替使用者阅读邮件、预订行程并转移资金。每一次工具调用都会拉取他人撰写的文本,而控制这些文本的人便可能试图操纵代理。OWASP将此类行为称为“代理目标劫持”(agent goal hijack),并将其列为《Agentic Applications Top 10(2026)》中的首要风险。
图1:间接提示注入。有害指令隐藏在工具返回的数据中,而非来自用户。
今年9月,我们在Gemini Enterprise Agent Platform上以私密预览形式发布了代理异常检测(Agent Anomaly Detection)功能。该功能异步读取代理的轨迹和日志,不增加延迟,并标记出代理行为超出预期范围会话。我们针对这一代理目标劫持的主要风险基准测试了此功能。
安全工具在其团队自行编写的测试中往往表现良好,因此我们在未对Agent Anomaly Detection进行任何更改的情况下,运行了五个由非Google编写且公开的代理安全基准测试。其中四个基准测试的有害指令隐藏在工具返回的数据中;在第五个基准测试中,用户直接请求实施有害行为。
模型本身并未执行约一半的有害指令。它拒绝了三四分之一的直接有害请求,并对隐藏在工具输出中的指令忽略或失败的比例约为30%。在被执行的指令中,Agent Anomaly Detection标记了87%以供事后审查。它在2%至16%的正常会话中产生了误报,具体取决于代理所使用的工具。中毒记忆(Poisoned memory)是明显的短板:当植入代理长期记忆中的指令使其采取行动时,Agent Anomaly Detection仅捕获了18例中的4例。
测试方法
图2:测试设置。Agent Anomaly Detection和基准测试的检查模块观察到相同的代理运行过程,但只有检查模块读取应用程序的最终状态。
我们使用基于Agent Development Kit(ADK)构建的代理,在基准测试模拟的应用程序上运行了每个基准测试案例,底层模型为gemini-2.5-flash。代理将其轨迹和日志发送至Agent Anomaly Detection,就像客户代理所做的那样。随后,基准测试自带的Python检查模块读取应用程序的最终状态(例如资金是否离开账户),并对会话进行标记。标签由确定性代码决定,而非模型,因此注入的指令无法误导评分器,Agent Anomaly Detection也无法作弊。每个代理首先运行至少300个正常会话,因为Agent Anomaly Detection需要学习每个代理的常规行为模式。
我们还记录了工具是否将有害指令返回给代理。在许多情况下,代理从未打开包含该指令的邮件或文件。因此,每个有害会话以以下三种方式之一结束:
未读取(Never read):没有工具返回该指令,因此代理从未看到它。
抵制(Resisted):代理读取了指令但未执行。这包括尝试但失败的代理。
执行(Carried out):代理读取了指令并执行了它。由基准测试自带的检查模块判定此结果。
在AgentHarm中,用户发送请求,因此代理始终会读取该指令。
这五个基准测试分别是AgentDojo(NeurIPS 2024)、InjecAgent(ACL 2024 Findings)、Agent Security Bench(ASB,ICLR 2025)、AgentDyn(2026)和AgentHarm(ICLR 2025)。ASB将指令植入代理的长期记忆中。总体而言,Agent Anomaly Detection共评估了1,774个会话。
研究结果
Agent Anomaly Detection标记了87%由代理执行的有害指令,并对普通办公工作产生了一些误报。它在目标劫持和工具滥用方面表现最强,在中毒记忆方面表现最弱。
按OWASP类别划分的结果
每个发现都带有威胁类别,Agent Anomaly Detection的五个类别中有四个与《Agentic Applications OWASP Top 10》一致。我们根据本研究的结果对每个OWASP类别进行评级,而非基于Agent Anomaly Detection的设计目标。
公开基准测试主要集中在目标劫持和工具误用方面,因此我们的证据在这些领域最为有力。我们未发现带有标记代理轨迹的公开基准测试,用于级联故障或身份与权限滥用。针对这些类别的共享基准测试将有助于整个领域的发展。
代理异常检测能标记大部分绕过模型的攻击
图3:在四个具有结果划分的基准测试中,每个有害会话的情况。
按基准测试统计,Agent Anomaly Detection 在 AgentDojo 上标记了 85% 的执行有害指令,在 InjecAgent 上为 87%,在 AgentDyn 上为 99%,在 AgentHarm 上为 81%。在所有有害会话中(包括代理从未读取或拒绝的会话),它标记的比例为 45% 至 62%。在 141 个代理从未读取指令的会话中,没有发生任何事件,仅标记了 1 个。
图4:对于每个应用,代理执行的有害指令中被 Agent Anomaly Detection 标记的比例。部分应用中的计数较小。
结果在各应用中保持一致。在 11 个应用中的 8 个,Agent Anomaly Detection 标记了至少 95% 的执行有害指令。最低比率出现在 AgentDojo 的 Slack 应用中,为 63%。其中许多指令仅请求一个微小操作,例如访问页面,这看起来像正常的浏览行为。
被拒绝的请求仍会留下记录
Agent Anomaly Detection 还标记了许多代理拒绝的请求。在 AgentHarm 中,代理拒绝了大多数请求并执行了 412 个中的 108 个,而 Agent Anomaly Detection 仍然标记了 55% 的被拒绝会话,因为请求位于用户自己的消息中,而该消息会被读取。当代理未遵循隐藏在工具输出中的指令时,它仅标记了 11% 至 25%,因为指令深嵌在工具结果内部。
在普通办公工作中误报很少:在三个注入基准测试中(其良性会话为办公任务),Agent Anomaly Detection 标记了 2% 至 4% 的良性会话。在 AgentHarm 上,它标记了 16%。这些良性任务是有害任务的孪生版本,因此它们会发布到社交媒体、运行终端命令并下载文件。正常使用中的高影响力工具看起来更像误用。
我们仍在改进的领域
Agent Anomaly Detection 在五个方面的表现较差。它仅标记了 11% 至 25% 代理抵抗的指令,因为被抵抗的指令对代理行为的影响很小。它漏掉了更多微小操作(如单次页面访问),因为它们看起来像正常工作。并且它对日常工作中使用高影响力工具的代理产生了更多误报。如果您的代理属于此类,请预期初期会有更多发现,并按严重性和威胁类别进行分类处理。
另外两个领域是新代理和中毒内存。某些 Agent Anomaly Detection 方法需要数百个会话的历史记录:在 AgentDyn 上,当每个代理约有 220 个良性会话时,它标记了 33% 的执行有害指令;拥有 360 个会话时则达到 99%。它还仅捕获了 18 个中毒内存导致代理行动的会话中的 4 个。
我们正在努力的方向:
报告代理抵抗的尝试(以较低的严重性),以便您了解何时有人正在探测您的代理。
捕获到达不可信目标的小操作,例如单次访问未知网页。
区分高影响力工具的正常使用与误用。
让新代理更快获得全面覆盖。
更可靠地检测植入长期内存中的指令。
这对您的代理意味着什么
通过纵深防御保护您的代理。使用在有害动作执行前阻止它们的控制措施,并利用 Agent Anomaly Detection 发现那些漏网之鱼。
发送完整的遥测数据。启用 ADK 追踪和日志记录,包括提示和响应内容。
筛查不可信内容。使用如 Model Armor 等过滤器检查提示和工具结果中的提示注入。
在工具调用执行前拦截高风险操作。处于预览阶段的语义治理策略(Semantic Governance Policy)会将每个拟议的工具调用与用户请求及您的规则进行比对,并拒绝不符合要求的那些调用。随后,智能体异常检测(Agent Anomaly Detection)会报告成功绕过该策略的情况。
对高影响操作要求审批。对于需要人工介入的操作,如付款、外发邮件、数据共享或其他类似行为,请要求人员进行批准。
限制每个智能体的工具权限。仅向每个智能体提供其任务所需的工具和权限。
审查通过的内容。智能体异常检测不会阻止操作,而是报告异常会话,其发现结果也会显示在安全指挥中心(Security Command Center)中;请将严重和高危级别的情况路由至您的事件响应团队。
本研究的局限性
我们仅使用了一个智能体模型并模拟了应用程序,且基准测试中的良性任务可能比您生产环境中的流量更简单,因此您的误报率可能会有所不同。在我们发送的会话中,约有 6% 的会话未返回任何结果;若将这些视为漏报,整体指标将降低 1 到 2 个百分点。
试用智能体异常检测
智能体异常检测目前处于私密预览阶段。如需申请访问权限,请阅读智能体异常检测概述。
AI agents now read email, book travel and move money for the people who use them. Every tool call also pulls in text that someone else wrote, and whoever controls that text can try to steer the agent. OWASP calls this agent goal hijack and ranks it first in its Top 10 for Agentic Applications (2026) .
Figure 1: An indirect prompt injection. The harmful instruction arrives inside data that a tool returns, not from the user.
In September we announced Agent Anomaly Detection in Private Preview on Gemini Enterprise Agent Platform. It reads your agents' traces and logs asynchronously, without adding latency, and flags sessions where an agent acts outside its intended boundaries. We tested this feature against benchmarks for this top risk of agent goal hijack.
Security tools tend to look good on tests their own team wrote, so we ran five non-Google-written, public agent-security benchmarks through Agent Anomaly Detection without changing anything. In four of them, the harmful instruction hides in data that a tool returns. In the fifth, the user asks for harm directly.
The model itself didn't follow about half of the harmful instructions it read. It refused three in four direct requests for harm, and ignored or failed at about 30% of the instructions hidden in tool output. Of the ones that were executed, Agent Anomaly Detection flagged 87% for post-execution review. It raised false alarms on 2% to 16% of benign sessions, depending on the tools the agent uses. Poisoned memory is the clear gap: when instructions planted in the agent’s long-term memory made it act, Agent Anomaly Detection caught 4 of 18.
How we ran the test
Figure 2: The test setup. Agent Anomaly Detection and the benchmark's check see the same agent run, but only the check reads the final state of the apps.
We ran each benchmark case through an agent built with the Agent Development Kit (ADK) using gemini-2.5-flash , on the benchmark's simulated apps. The agent sent its traces and logs to Agent Anomaly Detection, as a customer's agent would. Then the benchmark's own Python check read the final state of the apps, such as whether money left the account, and labeled the session. Deterministic code decides the label, not a model, so an injected instruction can't mislead the grader, and Agent Anomaly Detection cannot cheat the benchmark. Each agent first ran at least 300 benign sessions, because Agent Anomaly Detection learns how each agent usually behaves.
We also recorded whether a tool returned the harmful instruction to the agent. In many cases, the agent never opens the email or file that holds it. So each harmful session ends one of three ways:
Never read : no tool returned the instruction, so the agent never saw it.
Resisted : the agent read the instruction but didn't follow it. This includes an agent that tried and failed.
Carried out : the agent read the instruction and followed it. The benchmark's own check decides this.
In AgentHarm, the user sends the request, so the agent always reads it.
The five benchmarks are AgentDojo (NeurIPS 2024), InjecAgent (ACL 2024 Findings), Agent Security Bench (ASB, ICLR 2025), AgentDyn (2026) and AgentHarm (ICLR 2025). ASB plants the instruction in the agent's long-term memory. In all, Agent Anomaly Detection scored 1,774 sessions.
What we found
Agent Anomaly Detection flagged 87% of the harmful instructions that the agent carried out, and raised a few false alarms on ordinary office work. It's strongest on goal hijack and tool misuse, and weakest on poisoned memory.
Results by OWASP category
Each finding carries a threat category, and four of Agent Anomaly Detection’s five categories align with the OWASP Top 10 for Agentic Applications. We graded each OWASP category on what this study showed, not on what Agent Anomaly Detection is designed to catch.
Public benchmarks concentrate on goal hijack and tool misuse, so our evidence is strongest there. We did not find public benchmarks with labeled agent traces for cascading failures or for identity and privilege abuse. Shared benchmarks for those categories would help the whole field.
Agent Anomaly Detection flags most of what gets past the model
Figure 3: What happened to each harmful session, on the four benchmarks with an outcome split.
By benchmark, Agent Anomaly Detection flagged 85% of the carried-out harmful instructions on AgentDojo, 87% on InjecAgent, 99% on AgentDyn and 81% on AgentHarm. Over all harmful sessions, including the ones that the agent never read or resisted, it flagged 45% to 62%. In the 141 sessions where the agent never read the instruction, nothing happened, and it flagged just 1.
Figure 4: For each app, the share of harmful instructions that the agent carried out and that Agent Anomaly Detection flagged. The counts in some apps are small.
Results held across the apps . In 8 of the 11 apps, Agent Anomaly Detection flagged at least 95% of the carried-out harmful instructions. The lowest rate was in AgentDojo's Slack app, at 63%. Many of those instructions ask for one small action, such as a page visit, which looks like normal browsing.
A refused request still leaves a record
Agent Anomaly Detection also flags many requests that the agent refuses. In AgentHarm, the agent refused most requests and carried out 108 of 412, and Agent Anomaly Detection still flagged 55% of the refused sessions, because the request sits in the user's own message, which it reads. When the agent didn't follow an instruction hidden in tool output, it flagged only 11% to 25%, because the instruction sits deep inside a tool result.
False alarms were rare on ordinary office work: on the three injection benchmarks, whose benign sessions are office tasks, Agent Anomaly Detection flagged 2% to 4% of benign sessions. On AgentHarm it flagged 16%. Those benign tasks are twins of the harmful ones, so they post to social media, run terminal commands and download files. High-impact tools in normal use look more like misuse.
Where we're still improving
Agent Anomaly Detection did less well in five areas. It flagged only 11% to 25% of the instructions that the agent resisted, because a resisted instruction changes little in how the agent behaves. It missed more small actions, like single page visits, because they look like normal work. And it raised more false alarms for agents whose everyday work uses high-impact tools. If your agent is one of them, expect more findings at first, and triage them by severity and threat category.
The other two areas are new agents and poisoned memory. Some Agent Anomaly Detection methods need a few hundred sessions of history: on AgentDyn, it flagged 33% of carried-out harmful instructions when each agent had about 220 benign sessions, and 99% with 360. And it caught only 4 of the 18 sessions where poisoned memory made the agent act.
Here's what we're working on:
Report attempts that the agent resisted, at a lower severity, so you can see when someone is probing your agent.
Catch small actions that reach an untrusted destination, such as a single visit to an unknown web page.
Tell normal use of high-impact tools apart from misuse.
Give new agents full coverage sooner.
Detect instructions planted in long-term memory more reliably.
What this means for your agents
Protect your agents with defense in depth. Use controls that stop harmful actions before they run, and Agent Anomaly Detection to find what gets through.
Send complete telemetry. Enable ADK tracing and logging, including prompt and response content.
Screen untrusted content. Check prompts and tool results for prompt injection with a filter such as Model Armor.
Block risky tool calls before they run. Semantic Governance Policy , in Preview, checks each proposed tool call against the user's request and your rules, and denies the ones that don't fit. Agent Anomaly Detection then reports what gets past it.
Require approval for high-impact actions. Ask a person to approve payments, outbound email, data sharing, or other actions that should have a human in the loop.
Limit each agent's tools. Give each agent only the tools and permissions its task needs.
Review what gets through. Agent Anomaly Detection doesn’t block actions. It reports anomalous sessions, and its findings also appear in Security Command Center; route the Critical and High ones to your incident team.
Limits of this study
We used one agent model and simulated apps, and the benchmarks' benign tasks are likely simpler than your production traffic, so your false-alarm rate can differ. Agent Anomaly Detection returned no result for about 6% of the sessions we sent; counting those as misses lowers the overall rates by 1 to 2 points.
Try Agent Anomaly Detection
Agent Anomaly Detection is in Private Preview. To request access, read the Agent Anomaly Detection overview .
| 刊期 | 得分 | 排名 | 结果 |
|---|---|---|---|
| 2026-11-16 | 8.4 | 20 | 入选 |
| 2026-11-15 | 8.4 | 31 | 未入选 |
| 2026-11-14 | 8.4 | 46 | 未入选 |
| 2026-11-13 | 8.4 | 54 | 未入选 |