Integrating Model Armor with Gemini Enterprise lets you screen user prompts to and responses from your AI agents, mitigating risks such as prompt injection, harmful content, and sensitive data leakage. After the integration is set up, it applies to all user interactions.
Before you begin
Create a Model Armor template and ensure that it is in the same Google Cloud project as Gemini Enterprise. The location of the template and the Gemini Enterprise instance must match. For more information about supported locations, see Model Armor locations and Gemini Enterprise locations.
Required roles
Before you integrate Model Armor with Gemini Enterprise, ensure that you have the required role.
To get the permissions that
you need to create and manage Model Armor templates,
ask your administrator to grant you the
Model Armor Admin (roles/modelarmor.admin) IAM role on Model Armor templates.
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Enable the integration
To enable Gemini Enterprise with Model Armor, your security administrator creates policies in Model Armor and your Gemini Enterprise administrator applies these policies to the Gemini Enterprise instance.
Limitations and considerations
Consider the following limitations and considerations when integrating Model Armor with Gemini Enterprise:
- De-identification and masking: When Model Armor uses a
Sensitive Data Protection template for scanning prompts or responses,
Model Armor checks if the content matches the infoType detector
criteria defined in the template. Although Sensitive Data Protection
supports de-identification based on the template configuration,
Model Armor doesn't pass de-identified or masked data back to
Gemini Enterprise. If the content triggers any infoType detectors
from Sensitive Data Protection and the enforcement type is
INSPECT_AND_BLOCK, Gemini Enterprise blocks the request or response rather than de-identifying it. - Document screening: In addition to text prompts, the integration supports documents (such as PDFs). Documents included in user requests are screened when added; if a document violates configured policies, it is discarded and not included in the request. Images embedded within documents are not screened.
- Screened agents and interactions: Screening applies to the Gemini Enterprise assistant, employee-made agents (created in the Gemini Enterprise app using the Agent Designer), and Google-made agents. Interactions with custom agents from your organization (such as ADK, A2A, and Dialogflow) are not screened.
- Token limits and quotas: Although there are no direct token limits when you use Model Armor with Gemini Enterprise, the total throughput of Model Armor evaluations is governed by Gemini Enterprise system quotas and Model Armor API rate limits.
- Service Level Agreement (SLA): Gemini Enterprise provides a Service Level Agreement. When Gemini Enterprise is configured to use Model Armor, blocked queries don't count as SLA violations, regardless of whether the fail-open or fail-closed mode is used.
- Compliance: Both Gemini Enterprise and Model Armor offer various compliance certifications. When used together, the effective compliance certifications are the common subset of both products. Review the compliance certifications for both products to ensure that they meet your regulatory requirements.
How it works
After the integration is configured, Gemini Enterprise routes user inputs and assistant outputs through the Model Armor API for screening using the selected templates. The Gemini Enterprise authenticates to Model Armor using the service agent. Model Armor responds based on the filter configuration defined in the template, which Gemini Enterprise acts upon by either blocking the request or response or allowing it.
For example, Gemini Enterprise might detect a request containing personally identifiable information and route it to Model Armor for screening. If the Model Armor template is configured to block personally identifiable information (PII), it tells Gemini Enterprise to block the request.
Logging
Model Armor generates platform logs for sanitization requests and
their responses in Cloud Logging. You need the Private Logs Viewer
(roles/logging.privateLogViewer) IAM role to view the
Model Armor audit logs. For more information about the
auto-generated audit logs, see
Model Armor audit logging.
To log the sanitize operations, set the templateMetadata.logSanitizeOperations
field to true. For more information, see
Configure logging in templates.