Model Armor integrates with Google Cloud services to secure
AI and large language model (LLM) interactions. Model Armor
identifies and reports potential policy violations and can actively block
actions based on security evaluations.

## When to use Model Armor integrations

The following are some common use cases:

- **Secure API gateway traffic**: Intercept malicious requests and responses to protect backend AI endpoints at the gateway layer using Apigee or Agent Gateway.
- **Enforce inline model protections**: Filter prompt and response streams directly within Agent Platform, Gemini, and Gemini Enterprise workflows without custom wrapper code.
- **Centralize security operations and alerting**: Route findings and policy violation events directly into Security Command Center for unified threat monitoring.
- **Safeguard agent interactions**: Provide guardrails for conversational agents and tool invocations across integrated enterprise architectures.

## Supported modalities

The modalities that Model Armor can scan and sanitize depend on
how you access the service:

- **Direct REST API** : The Model Armor REST API supports all modalities, including text, [documents](https://docs.cloud.google.com/model-armor/overview#ma-support-screening-pdfs), and [images](https://docs.cloud.google.com/model-armor/overview#image-screening). For more information, see [Sanitize prompts and responses](https://docs.cloud.google.com/model-armor/sanitize-prompts-responses).
- **Integrations with other services** : In Model Armor integrations with other Google Cloud services, only the [Gemini Enterprise integration](https://docs.cloud.google.com/model-armor/integrations#gemini-enterprise) supports documents. All other integrations scan and sanitize only text.

For details on the supported document types and size limits, see
[Document screening](https://docs.cloud.google.com/model-armor/overview#ma-support-screening-pdfs).

## Supported services

This section describes the Google Cloud services that you can integrate
with Model Armor.

### Agent Gateway

Integrate Model Armor with Agent Gateway to
enforce security policies on traffic flowing to and from all agents governed by
the gateway. This integration allows for inline inspection and blocking of
malicious or non-compliant content. This integration aims to improve workflow
security and adherence to organizational safety guidelines, without needing
modifications to the application code. This protection applies to supported
protocols on both ingress (to the agent) and egress (from the agent) paths. For
more information, see [Integrate with Agent Gateway](https://docs.cloud.google.com/model-armor/model-armor-agent-gateway-integration).

### Apigee

The Model Armor and Apigee integration lets you use the
AI protection capabilities of Model Armor
directly within the Apigee API gateway layer. You configure
specific Model Armor policies within your
Apigee API proxies. When an API call passes through an Apigee
proxy that has these policies, Apigee sends the prompts and responses to
the Model Armor service for inspection. For more information,
see [Integrate with Apigee](https://docs.cloud.google.com/model-armor/model-armor-apigee-integration).

### Gemini Enterprise

Model Armor can be directly integrated with
Gemini Enterprise
using [templates](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration#configure-templates).
Gemini Enterprise routes the interactions between users
and agents and the underlying LLMs through Model Armor. This
means prompts from users or agents and the responses generated by the LLMs are
inspected by Model Armor before being presented to the user. For
more information, see [Integrate with Gemini Enterprise](https://docs.cloud.google.com/model-armor/model-armor-gemini-enterprise-integration).

In addition to the modalities listed in [Supported modalities](https://docs.cloud.google.com/model-armor/integrations#modalities), the
Model Armor integration with Gemini Enterprise
also supports [documents](https://docs.cloud.google.com/model-armor/overview#ma-support-screening-pdfs).
However, images embedded in documents aren't screened.

> [!NOTE]
> **Note:** The Gemini Enterprise integration does not support data de-identification or masking. If the content triggers any infoType detectors from Sensitive Data Protection, Gemini Enterprise blocks the response rather than de-identifying it.

### Google and Google Cloud MCP servers

Model Armor can be configured to help protect your data and
secure content when sending requests to Google Cloud services that expose
Model Context Protocol (MCP) tools and servers. Model Armor helps
secure your agentic AI applications by sanitizing MCP tool calls and responses
using [floor settings](https://docs.cloud.google.com/model-armor/configure-floor-settings). This process
mitigates risks such as prompt injection and sensitive data disclosure. For more
information, see [Integrate with
Google and Google Cloud MCP servers](https://docs.cloud.google.com/model-armor/model-armor-mcp-google-cloud-integration).

### Service Extensions

Model Armor can be integrated with Google Cloud networking services
through Service Extensions. Service Extensions lets you
integrate Google Cloud services or user-managed services to
process traffic. You can configure a service extension on application load balancers to
screen network traffic for various AI interactions, such as with agents and MCP
servers. You can also use service extensions with
GKE inference gateways to screen traffic to and from a
GKE cluster. Doing so helps ensure that all AI interactions passing
through the load balancer are protected by Model Armor. For more
information, see [Integrate with Google Cloud networking services](https://docs.cloud.google.com/model-armor/model-armor-gke-integration).

### Gemini Enterprise Agent Platform

Model Armor can be directly integrated into Gemini Enterprise Agent Platform using either
[floor settings](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration#configure-floor-settings) or
[templates](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration#configure-templates).
This integration screens Gemini model requests and responses, blocking
those that violate floor settings. This integration provides prompt and response
protection within Gemini API in Vertex AI for the
`generateContent` method. Sanitizing prompts and responses that contain documents
or images isn't supported in this integration. You need to enable Cloud Logging to get visibility
into the sanitization results of prompts and responses. For more information, see
[Integrate with Gemini Enterprise Agent Platform](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration).

## Before you begin

### Enable APIs

You must enable the Model Armor API before you can use Model Armor.

### Console

1.


   Enable the Model Armor API, if it is not already enabled.


   **Roles required to enable APIs**


   To enable APIs, you need the `serviceusage.services.enable` permission. If you
   created the project, then you likely already have this permission through the
   Owner role (`roles/owner`). Otherwise, you can get this permission through the
   Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`).
   [Learn how to grant roles](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).

   [Enable the API](https://console.cloud.google.com/apis/enableflow?apiid=modelarmor.googleapis.com)

   <br />

2. Select the project where you want to activate Model Armor.

### gcloud

Before you begin, follow these steps using the Google Cloud CLI with the
Model Armor API:

1.


   In the Google Cloud console, activate Cloud Shell.

   [Activate Cloud Shell](https://console.cloud.google.com/?cloudshell=true)


   At the bottom of the Google Cloud console, a
   [Cloud Shell](https://docs.cloud.google.com/shell/docs/how-cloud-shell-works)
   session starts and displays a command-line prompt. Cloud Shell is a shell environment
   with the Google Cloud CLI
   already installed and with values already set for
   your current project. It can take a few seconds for the session to initialize.

   <br />

2.


   Enable the Model Armor API, if it is not already enabled:


   **Roles required to enable APIs**


   To enable APIs, you need the `serviceusage.services.enable` permission. If you
   created the project, then you likely already have this permission through the
   Owner role (`roles/owner`). Otherwise, you can get this permission through the
   Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`).
   [Learn how to grant roles](https://docs.cloud.google.com/iam/docs/granting-changing-revoking-access).

   ```bash
   gcloud services enable modelarmor.googleapis.com
   ```

   <br />

3. [Set the API endpoint override using the
   gcloud CLI](https://docs.cloud.google.com/model-armor/integrations#gcloud-override).

### Set the API endpoint override using the gcloud CLI

This step is only required if you use the gcloud CLI with
Model Armor and want to use a region or multi-region other than
the default `us` multi-region. You must manually set the API endpoint override
to ensure the gcloud CLI correctly routes requests to the
Model Armor service.

Run the following command to set the API endpoint for the
Model Armor service.

```bash
gcloud config set api_endpoint_overrides/modelarmor "https://modelarmor.LOCATION.rep.googleapis.com/"
```

Replace `LOCATION` with the [region or multi-region where
you want to use Model Armor](https://docs.cloud.google.com/model-armor/data-residency#data-residency-enforced).

## Manage quota

Model Armor uses a [quota system](https://docs.cloud.google.com/model-armor/quotas)
to ensure fair usage and protect system stability. The default quota for the
Model Armor API is 1,200 QPM per project. You can apply a value
from 0 to 1,200 QPM per project. To request an adjustment, see
[Request a quota adjustment](https://docs.cloud.google.com/docs/quotas/view-manage#requesting_higher_quota).
If you need more than the default quota, contact
[Cloud Customer Care](https://cloud.google.com/support-hub).

Model Armor quota requires important considerations when
integrating with other services. The primary quota that you interact with is the
number of API requests per minute per project.

Consider the following quota types when integrating Model Armor
with other services.

- **Model Armor default quota:** When a service makes a call to the Model Armor API for analysis (for example, checking prompts or responses), this consumes your project's Model Armor API quota.
- **Integrating services quota:** Model Armor quota is separate from any quotas associated with the integrating services. You need to make sure there is sufficient quota for all services in your request path. Any call made to the Model Armor API to sanitize content for your application counts against [Model Armor API quota limits](https://docs.cloud.google.com/model-armor/quotas).

### Discover out-of-quota situations

You hit Model Armor quota limits if your application logs show
errors from Model Armor, typically HTTP `429 RESOURCE_EXHAUSTED`
errors, which indicates too many requests.

### Estimate quota needs

To determine how much Model Armor quota to request:

- Estimate the peak number of requests per minute your services will send to Model Armor.
- Consider how many times Model Armor is called per user interaction with your service (for example, once for the prompt and once for the response).
- Factor in the maximum number of concurrent users or sessions.
- Request a quota with a reasonable buffer (for example, 20-30% above your expected peak) to handle unexpected spikes.
- Start with your best estimate, monitor usage closely after launch, and request further adjustments as needed.

For example, if you expect 500 users per minute, and each user interaction calls
Model Armor twice (prompt and response), you need at least 1,000 QPM.
Factoring in a buffer, requesting 1,200-1,300 QPM is a good starting point.

### Considerations

When integrating with other services, consider the following:

- Make sure that you monitor and manage quotas for other services. Running out of quota for other services impacts your application, even if you have sufficient Model Armor quota.
- Implement client-side retries with exponential backoff in your application setup to handle transient quota issues or other retryable errors. For more information, see [Retry strategy](https://docs.cloud.google.com/model-armor/retry-strategy).

## Enforcement types

When integrating Model Armor with other services, a crucial
aspect to configure is the enforcement type. This setting determines how
Model Armor acts upon detecting a potential policy violation in
the data it inspects, such as LLM prompts or responses. The enforcement type
dictates whether Model Armor only reports violations or actively
intervenes. For more information, see [Define the enforcement type](https://docs.cloud.google.com/model-armor/overview#define-enforcement-type).

## Integrate using the REST API

When you use the REST API for integration, Model Armor functions
only as a detector using templates. It identifies and reports potential policy
violations based on predefined templates rather than actively preventing them.
When integrating with the Model Armor API, your application can use output from
Model Armor to block or allow actions based on the security
evaluation results provided. The Model Armor API returns information about
potential threats or policy violations related to your API traffic, especially
in the case of AI interactions. Your application can call the
Model Armor API and use the information received in the response to make
a decision and take action based on your predefined custom logic.

## Options when integrating Model Armor

Model Armor offers the following integration options. Each option
provides different features and capabilities.

| Integration option | Configure detections | Supported modalities | [Inspect only](https://docs.cloud.google.com/model-armor/overview#define-enforcement-type) | [Inspect and block](https://docs.cloud.google.com/model-armor/overview#define-enforcement-type) | Coverage |
|---|---|---|---|---|---|
| [Agent Gateway](https://docs.cloud.google.com/model-armor/model-armor-agent-gateway-integration) | Only using templates | Text | Yes | Yes | All models and all clouds |
| [Apigee](https://docs.cloud.google.com/model-armor/model-armor-apigee-integration) | Only using templates | Text | Yes | Yes | All models and all clouds^2^ |
| [Gemini Enterprise](https://docs.cloud.google.com/model-armor/model-armor-gemini-enterprise-integration) | Only using templates | Text, documents | Yes | Yes | All models and all clouds^2^ |
| [Google and Google Cloud MCP servers](https://docs.cloud.google.com/model-armor/model-armor-mcp-google-cloud-integration) | Only using floor settings | Text | Yes | Yes | Google and Google Cloud MCP servers |
| [Service Extensions](https://docs.cloud.google.com/model-armor/model-armor-gke-integration) | Only using templates | Text | Yes | Yes | OpenAI format models^1^, agents, and MCP servers on all clouds^2^ |
| [Gemini Enterprise Agent Platform](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration) | Both using [floor settings](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration#configure-floor-settings) and [templates](https://docs.cloud.google.com/model-armor/model-armor-vertex-integration#configure-templates) | Text | Yes | Yes | Gemini models (non-streaming) |

^1^Several popular models---including Anthropic Claude, Mistral AI, and
Grok---support OpenAI specifications. These models are typically deployed using
inference engines like vLLM, which provide the necessary OpenAI-compatible API
layer. vLLM supports a wide range of models, including the Meta Llama
series, DeepSeek, Mistral and Mixtral families, and Gemma.

^2^Includes other public clouds like AWS and Azure.

<br />

With the Gemini Enterprise Agent Platform integration, Model Armor provides
inline enforcement using floor settings or templates. Inline policy enforcement
lets Model Armor actively enforce policies by intervening directly
in the process without requiring modifications to your application code.

The Service Extensions and Gemini Enterprise
integrations only use templates for inline policy enforcement. Through inline
policy enforcement, Model Armor can enforce policies directly
without requiring you to modify application code both within
Service Extensions and during user or agent interactions within
Gemini Enterprise instances.

The Model Armor integrations with
Gemini Enterprise, Agent Runtime, and
Apigee sanitize the initial user prompt, the final agent or model
response, and intermediate steps, such as grounding data and responses
returned by web search tools. If the retrieved grounding data or intermediate
payload violates your configured Model Armor templates or
Sensitive Data Protection policies, the request is blocked and logged
with a `SANITIZE_USER_PROMPT` operation type.

## Model Armor in Security Command Center

Model Armor inspects LLM prompts and responses for various threats,
including prompt injection, jailbreak attempts, malicious URLs, and harmful
content. When Model Armor [detects a violation](https://docs.cloud.google.com/model-armor/configure-floor-settings#floor-settings-violation)
of a configured floor setting, it blocks the prompt or response and sends a
finding to Security Command Center. For more information, see
[Model Armor findings](https://docs.cloud.google.com/security-command-center/docs/concepts-vulnerabilities-findings#model-armor-findings).