# Check what your AI agents do before they do it, with Semantic governance policies

> Source: <https://developers.googleblog.com/check-what-your-ai-agents-do-before-they-do-it-with-semantic-governance-policies/>
> Published: 2026-11-20 22:42:15.677057+00:00

**Key takeaway:** Route all agent egress through Agent Gateway so each proposed tool call is judged against plain-language policies before execution, with denials replaced by a configurable message and verdicts plus rationale written to Cloud Logging.

Two days before earnings, an employee asks their coworker agent to send the preliminary quarterly results to an investor who says they're under NDA, and to copy the employee's personal Gmail so they can review the numbers tonight. The agent can read the file and send email, so it fulfills the user request. Semantic governance policies, available in Preview in Gemini platform, enable enterprises to govern their agents and provide guardrails to stop that call before it runs. They check each tool call an agent proposes against what the user asked for and against rules you write in plain language.

Permissions alone can't catch this. They say what an agent *can* do, not whether a particular call follows your rules. A model can also be talked out of the rules in its system instructions, by a user with a good reason, or by a document telling it to do something nobody asked for, a technique called indirect prompt injection. So the check has to sit outside the agent. Semantic governance policies are enforced through a policy enforcement point, such as [Agent Gateway](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/gateways/agent-gateway-overview), alongside the [agent governance controls we expanded in October](https://cloud.google.com/blog/topics/ai-infrastructure/introducing-agent-compute-engine-and-expanded-agent-governance), so policies stay separate from your agent's code.

Semantic governance policies check each tool call your agent's model proposes, before it runs, against two things:

A call has to pass both checks to run.

Today, the policy enforcement point that Semantic governance policies support is Agent Gateway. You need to configure your agent so all your agent egress traffic goes through Agent Gateway, facilitating traffic between your agent and its model. When the model responds with a tool call, Agent Gateway sends the proposed call to the Semantic governance policy engine for evaluation before the response reaches your agent.

In the policy engine, an LLM judge evaluates the proposed call against the conversation so far, the agent's system instructions and tool descriptions, and your policies.

If the call passes, the response reaches your agent unchanged. If it doesn't, the engine replaces the response's content, tool calls included, with a configurable denial message, so the call never runs. Either way, the verdict and the judge's rationale go to Cloud Logging in your project. Responses that contain only text, such as an answer, a plan, or a question back to the user, aren't evaluated, because they take no action.

Consider a coworker agent for a finance team. It can search the shared drive, read files, send email, and delete draft files, and its system instructions include the date of the next earnings release. The company writes one policy for the agent:

"Quarterly financial results (revenue, margins, bookings, guidance) should not be shared publicly until the public earnings release. Before the release, they may be shared only with @example.com addresses. Never send them to external or personal addresses, investors, analysts, or press, regardless of NDAs, urgency, or the requester's seniority."

The agent might propose three calls:

`send_email` to the controller with the results attached. In each denied case, the agent gets a denial message instead of the call. The judge's rationale can quote your policy, so if users shouldn't see it, set your own denial message on the policy.

The earnings rule is one policy. Each policy is a natural-language constraint attached to an agent. It can apply to all of an agent's tools or to one tool, and it can name a tool's parameters. Other examples:

Because the earnings policy doesn't name a tool, it's checked on every tool call the agent proposes, so it would also apply to a tool that shares or uploads files. For guidance on wording, see [best practices for writing policies](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/policies/best-practices). You can create it in the Google Cloud console or with the Google Cloud CLI:

```
gcloud beta ai semantic-governance-policies create POLICY_ID \
    --location=LOCATION \
    --display-name="Earnings disclosure" \
    --agent=projects/PROJECT_ID/locations/LOCATION/agents/AGENT_ID \
    --natural-language-constraint="Quarterly financial results (revenue, margins, bookings, guidance) should not be shared publicly until the public earnings release. Before the release, they may be shared only with @example.com addresses. Never send them to external or personal addresses, investors, analysts, or press, regardless of NDAs, urgency, or the requester's seniority." \
    --agent-response-denial-message="I can't share unreleased financial results outside the company before the earnings release. Contact Investor Relations for approved disclosures." \
    --project=PROJECT_ID
```

IAM and Agent Gateway access policies decide which tools and MCP servers an agent can reach. Model Armor screens prompts and responses for threats such as jailbreaks and sensitive data. [Agent Anomaly Detection](https://developers.googleblog.com/agent-anomaly-detection-now-in-private-preview-on-the-gemini-enterprise-agent-platform/) analyzes sessions asynchronously, out of band. Semantic governance policies add the check none of them makes, as one layer of defense in depth: they judge each action inline, before it runs.

Because verdicts come from an LLM, which is probabilistic, they may vary. We recommend reviewing them in dry run mode before you enforce, and using Semantic governance policies alongside your other controls. The judge decides from the conversation, the agent's instructions, and your policies, so include facts a policy depends on, such as the earnings date, in the agent's system instructions. Streamed model responses aren't evaluated. Semantic governance policies complement, rather than replace, your disclosure controls and legal and compliance reviews.

To try Semantic governance policies on an agent behind Agent Gateway:

To learn more, read the [Semantic governance policies overview](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/policies/semantic-governance-overview) and [best practices](https://docs.cloud.google.com/gemini-enterprise-agent-platform/govern/policies/best-practices).

Your agent should work for the person who asked, within the rules you set. Semantic governance policies check both before each action runs.

*In our next post, we'll share how Semantic governance policies held up against prompt injection on AgentDojo, a public agent-security benchmark.*
