AI

Google secures AI agents against prompt injection attacks with Semantic governance policies

Google's Semantic governance policies reduce AI agent prompt injection attack success rates from 48.7% to 0.9% with minimal impact on legitimate tasks.

3 min readSource: Google Developers Blog

Curated by Kandala Guruprasad. Drafted with AI and checked against the source.

Google secures AI agents against prompt injection attacks with Semantic governance policies

TL;DR

  • Semantic governance policies evaluate each tool call an AI agent proposes against user intent and natural-language policies before execution, stopping indirect prompt injection attacks where hidden instructions
  • Testing on AgentDojo benchmark shows attack success rates fell from 48.7% to 0.9% with Semantic governance policies enabled, with only a 2.6 percentage point cost to utility on benign tasks.
  • The defense distinguishes between trusted context (user requests and agent instructions) and untrusted context (tool results, files, messages), treating injected content as data rather than instructions.
  • Zero successful attacks occurred among 929 tool-requiring attacks across six full benchmark runs when Semantic governance policies was enabled, covering transfers, messages, and data sharing.
Attack success rate
48.7% to 0.9% on AgentDojo
Benign task utility
2.6 percentage points average
Benchmark tested
AgentDojo v1.2.2 (97 tasks, 949

What happened

Google published security research on Semantic governance policies, a defense mechanism against indirect prompt injection attacks on AI agents. The research demonstrates how these policies prevent agents from being hijacked into performing unintended actions when processing untrusted content like documents, emails, and API responses.

How prompt injection hijacking works

Indirect prompt injection occurs when an attacker hides instructions inside content an AI agent reads from external sources. For example, a banking agent asked to pay a bill could encounter hidden text in the bill file instructing it to send money to an attacker's account instead. Without protection, the agent treats the injected instruction as legitimate and executes the unauthorized transaction. This represents a real attack vector, demonstrated in AgentDojo, an open security benchmark for testing AI agents.

How Semantic governance policies stop attacks

Semantic governance policies intercept each tool call before an agent executes it. An LLM judge evaluates the proposed action against user intent and configured policies. The key distinction is how the judge treats different sources of information: the user's original request and agent system instructions are treated as trusted context; tool results, files, and messages from external sources are treated as untrusted data, never as instructions. When an agent proposes an action, the judge asks a single question: did the user ask for this? In the bill-payment scenario, the agent could read the bill file, but when the hidden instruction tried to trigger a money transfer to an attacker's account, the policy engine denied the action because the user never requested that transfer. When a user explicitly asks for a transfer to the same account, the action is allowed.

Benchmark results

Google tested Semantic governance policies against AgentDojo v1.2.2, a public benchmark developed by ETH Zurich and Invariant Labs that simulates banking, Slack, travel, and workspace applications. The testing ran a Gemini 2.5 Flash agent through 97 user tasks with 949 attack variations across six full benchmark runs. With only the default user intent matching enabled and no additional policies configured, the attack success rate fell from 48.7% to 0.9%. This represents a 98.2% reduction in successful attacks. The cost to legitimate work was minimal: clean utility (benign tasks without attacks) dropped by 2.6 percentage points on average. Across different domains, banking, Slack, and workspace attacks dropped to zero successful attacks in every run. Among 929 attacks that required tool calls, none succeeded in any of the six runs, covering attacks attempting to send messages, transfer money, or share data.

Limitations and remaining gaps

The Semantic governance policies judge reads untrusted content to evaluate actions, so it could theoretically be manipulated by attacks specifically designed against it, such as requests disguised to appear as legitimate user instructions. AgentDojo's fixed attacks were not adapted to Semantic governance policies, so this research does not measure adaptive attacks. NIST's Center for AI Standards and Innovation found that attacks developed through red-teaming can raise attack success rates significantly higher. Text-only attacks that ask an agent to include specific information in its response rather than perform an action bypass the tool-call checks entirely, since no tool call is involved; these require complementary defenses such as response filtering. In the Slack domain, unintended over-blocking affected one of 97 benign tasks where the agent was asked to follow instructions from external web pages, a pattern that resembles prompt injection.

What to do

Developers deploying AI agents can enable Semantic governance policies with user intent matching as a default safeguard. The policy engine runs in Agent Gateway, intercepting tool calls before they execute. Additional custom policies can be configured to block domain-specific actions beyond the default user intent check. Organizations should monitor for cases where legitimate tasks are over-blocked and consider complementary controls such as response filtering for text-only attacks, especially when agents interact with external instructions or untrusted content sources.

Source

Google Developers Bloghttps://developers.googleblog.com/did-the-user-ask-for-this-securing-ai-agents-against-intent-hijacking-with-semantic-governance-policies/

AI-assisted, verified against the source. This post was drafted with AI from the primary source linked above and checked automatically against it. For anything you depend on, read the original.

  • #aisecurity
  • #promptinjection
  • #agentsecurity
  • #aisafety
  • #gemini

More in AI