# Google adds an inline policy check before AI agent tool calls run

Google's preview compares proposed tool calls with user intent and plain-language business rules before execution. It addresses a gap between permission and purpose, but the LLM judge can make mistakes.[1][2]

Google released Semantic governance policies in Preview for Gemini Enterprise Agent Platform. Agent Gateway intercepts a model's proposed tool call, sends it to a managed policy engine and either passes the call through or replaces it with a denial.[1][2]

The useful change is the enforcement point. A rule in the agent prompt can be overridden by hostile context, while IAM only decides whether the agent may reach a tool. The new layer asks whether this particular action matches the user's request and the organization's rules.[1][2]

It remains a probabilistic control. Google advises teams to test verdicts in dry run mode before enforcement and keep baseline controls such as IAM, rate limits and network security.[1][2][3] Learnetto also recommends code-level validation and human approval for consequential actions.

## What Google released

[Google announced Semantic governance policies on November 20](https://developers.googleblog.com/check-what-your-ai-agents-do-before-they-do-it-with-semantic-governance-policies/) [1]. The Preview adds a policy decision point to Gemini Enterprise Agent Platform. It evaluates proposed tool calls before the agent receives and executes them.[1][2]

The check has two parts. User-intent matching, enabled by default, asks whether the call follows the trusted request rather than instructions found later in a document or message. Natural-language constraints ask whether the call follows rules attached to the agent or a specific tool. Both must pass when both checks are active.[1][2]

Agent Gateway is currently the supported enforcement point. It intercepts the model response, sends the current prompt, conversation history, tool manifest, proposed call and applicable policies to the policy engine, then returns either the unchanged response or a denial in the provider's response format.[1][2]

Google lists Gemini, Anthropic Messages, Claude on its platform and OpenAI-compatible chat-completions endpoints among the supported request formats. That makes the control model-independent within the documented integration paths, rather than limited to a Gemini model.[1][2]

## Why permissions and prompt rules leave a gap

Permissions answer whether an identity can call send_email, issue_refund or delete_file. They cannot decide whether sending this attachment to this recipient matches the user's request. A broad permission may be operationally necessary while a particular use remains unsafe.

System instructions express intended behavior, but the same model interprets those instructions and untrusted context. An indirect prompt injection can place conflicting directions in an email, web page or retrieved file. Google's example has a planning document tell an agent to delete drafts even though the user never requested deletion; the intent check denies the proposed call.[1][2]

An external policy gate changes the trust boundary. The action-producing model does not get the final word on its own call. This is useful for semantically rich rules that are awkward to encode as simple allowlists, such as requiring documented approval before an invoice is submitted.[1][2]

Deterministic checks still deserve priority when they can express the rule exactly. A refund ceiling, tenant boundary, database constraint or signed approval token should also be validated in code. A semantic judge can cover meaning and context, while ordinary software enforces facts that must never vary.

## The judge is another probabilistic control

Google states that the policy engine uses an LLM to evaluate natural-language rules and that verdicts may be inaccurate.[2] A false allow can expose an unsafe action. A false denial can interrupt a valid workflow. The right question is therefore how much residual risk the layer removes on a representative test set, not whether its rationale sounds persuasive.

Policy quality depends on the evidence available to the judge. Tool, action and parameter descriptions must be clear enough to distinguish effects. Google caps those descriptions at 1,000, 750 and 300 characters respectively and truncates longer text.[3] Vague labels such as process_item make both the agent and policy judge harder to evaluate.

Natural-language constraints also need explicit terms. Google's guidance favors exact amounts, times, regions and parameter names over words such as reasonable or expensive.[3] Conflicting rules and undefined business vocabulary create avoidable uncertainty.

Every policy needs positive, negative and ambiguous cases. Include valid exceptions, missing evidence, conflicting conversation turns, indirect instructions, multi-tool plans and calls whose arguments are individually allowed but unsafe in combination. Review false allows separately from false denials because their costs differ.

## How this differs from anomaly detection

Semantic governance is inline and action-specific: it can prevent a proposed tool call from reaching the agent. It does not inspect ordinary text-only planning or answers, because no action is being executed.[1][3]

Agent Anomaly Detection is asynchronous. It analyzes OpenTelemetry logs and traces after they are produced, using layered detectors to find tool misuse, privilege abuse, loops, rogue behavior and resource exhaustion without adding latency to the live response.[4] It can see patterns across a session that one call may not reveal.

The controls therefore cover different moments. The inline gate tries to stop a risky call. Anomaly detection looks for drift, repeated calls and suspicious session patterns, including behavior that remained technically permitted.[1][4] Neither replaces application authorization or incident response.

Anomaly monitoring also changes the data boundary. Google's cross-cloud setup sends prompts, responses, traces and logs into a Google Cloud project for analysis.[4] Teams must decide what may be captured, set retention and access rules, and verify that user notice and regional storage match their obligations before enabling full-content telemetry.

## A measured adoption plan

- Choose one consequential tool with a clear business rule, such as refunds, outbound email or infrastructure provisioning. Keep existing authorization and approval checks in place.
- Write a threat model that separates identity, tool access, user intent, business constraints, argument validation, approval and post-action audit. Assign one control to each risk rather than asking the semantic gate to do everything.
- Rewrite tool and parameter descriptions so another engineer can predict when the tool should run, what it changes and what each argument means. Stay within the documented description limits.[3]
- Express policies with exact thresholds, named parameters, time zones and permitted exceptions. Avoid subjective adjectives and conflicting agent-wide and tool-specific rules.[3]
- Build a labeled evaluation set from real workflows and abuse cases. Measure false allows, false denials, judge latency, token use and task completion by risk slice.
- Enable dry run mode first. Google says this logs verdicts and rationales while allowing every tool call, which lets teams compare decisions with expected labels without blocking production work.[1][3]
- Inspect denial messages for policy leakage. Use a fixed user-facing denial when a rationale could reveal confidential rules or thresholds.[1][2]
- Move to enforcement for a small traffic slice only after critical false-allow cases pass. Keep a rollback path and alert on denial-rate shifts after model, prompt, tool-description or policy changes.
- Re-run the suite whenever the agent model, policy-engine behavior, tool schema, business rule or conversation template changes. Treat policy text as versioned production configuration.

## Limits teams should design around

- Semantic governance policies are a Preview feature and may change before general availability.[1][2]
- Streamed model responses aren't evaluated. Google's documentation says tool calls in streamed responses might not be blocked, so governed model calls must use a supported non-streaming path.[1][2]
- Text-only responses, plans and questions are not evaluated because the engine acts when a model proposes a tool call.[1][3]
- The policy engine depends on an LLM judge. Verdicts can vary or be wrong, and dry run evidence does not remove the need for deterministic controls.[1][2]
- The judge can only reason from the supplied user prompt, conversation history, policies, tool manifest and proposed call. Missing approval state or ambiguous metadata can lead to the wrong verdict.[1][2]
- A denied call is blocked as a whole. If one recipient or argument violates a rule, the application should not assume the engine will safely rewrite only that field.[1]
- Denial rationales may expose policy details unless teams configure a fixed message or sanitize the response.[1][2]
- Inline evaluation adds model work, latency and token cost. Google logs token consumption, but teams still need workload measurements and budgets.[1][2]

## Frequently asked questions

- Does this replace IAM? No. IAM controls access; semantic governance evaluates the meaning of a proposed action after access exists.[1][2]
- Does it stop prompt injection? It can deny tool calls that depart from user intent, including calls influenced by hostile retrieved text. It does not remove the injection or inspect every text response.[1][2]
- Can compliance teams write the rules? The rules use plain language, but engineering should map them to real tool names and parameters, test them and keep code-level controls for exact invariants.[2][3]
- Should teams enforce immediately? Google recommends dry run mode first so verdicts can be compared with expected outcomes before calls are blocked.[1][3]
- Is anomaly detection the same feature? No. Semantic governance is an inline gate for proposed calls; Agent Anomaly Detection reviews session telemetry asynchronously.[1][4]
- What should teams test first? Start with unauthorized actions that the agent is technically permitted to perform, valid exceptions that must continue working and indirect instructions that conflict with the user's request.

## Sources

- [[1] Google Developers: Semantic governance announcement](https://developers.googleblog.com/check-what-your-ai-agents-do-before-they-do-it-with-semantic-governance-policies/)
- [[2] Google Cloud: Semantic governance policies overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/policies/semantic-governance-overview)
- [[3] Google Cloud: Semantic governance policy best practices](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/policies/best-practices)
- [[4] Google Cloud: Agent Anomaly Detection overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/agent-anomalies-overview)
