This document describes how to view and update Model Armor floor settings and provides an example of a floor setting violation.
Floor settings serve two primary purposes:
Template conformance: Ensure new templates are at least as restrictive as those defined in the floor settings. Template conformance is defined at the organization and folder levels.
Inline enforcement: Apply Model Armor protections to Gemini models and Google Cloud MCP servers. Inline enforcement is configured at the project level. If you use floor settings for inline enforcement, template conformance is required.
Before you begin
Before you begin, complete the following tasks.
Obtain the required permissions
To get the permissions that
you need to manage floor settings,
ask your administrator to grant you the
Model Armor Floor Setting Admin (roles/modelarmor.floorSettingsAdmin)
IAM role on Model Armor floor settings.
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 APIs
You must enable Model Armor APIs before you can use Model Armor.
Console
Enable the Model Armor API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.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:
In the Google Cloud console, activate Cloud Shell.
At the bottom of the Google Cloud console, a Cloud Shell 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.
-
Run the following command to use the global API endpoint:
gcloud config set api_endpoint_overrides/modelarmor "https://modelarmor.googleapis.com/"
Floor settings application
Local settings are always applied. For example, if floor settings conflict, the settings lower in the resource hierarchy take precedence. Similarly, project-level floor settings override conflicting folder-level floor settings.
The following table lists how floor settings are applied at different locations:
| Floor settings location | Application |
|---|---|
| Organization level | Applies to everything within the organization. |
| Folder level | Applies to all projects inside that specific folder. |
| Project level | Applies only to that one specific project. |
To illustrate how floor settings are applied when set at different levels, consider the following example scenario. For example, suppose you set floor settings as follows:
- Folder-level (less specific) floor settings: All content in this folder must enable a malicious URI filter.
- Project-level (more specific) floor settings: Your project in the folder must use prompt injection and jailbreak detection with medium confidence.
In this scenario, the settings result in the following:
Any template you create in your project must include the prompt injection and jailbreak detection filter because the project-level settings always take precedence over folder-level settings.
A template created in a different project or folder isn't affected by the malicious URI filter rule from the first folder.
Floor settings apply only within their specific location in the hierarchy, unless set at the organization level, in which case, they apply throughout the organization.
Templates and floor settings conformance
When a Model Armor template is created or updated, Model Armor checks whether the template's configuration conforms with the floor settings. You cannot create or update a template that's less strict than the floor settings.
You can set floor settings at the organization, folder, and project levels. The user interface is available only at the project level and lets you inherit organization-level or folder-level settings. To set floor settings at the organization or folder level, you must use the API.
Template conformance validates template configurations. Data inspection uses the configurations defined in a conformant template to analyze prompts or responses during runtime. The following table describes how template conformance and data inspection apply to templates and floor settings.
| Check | Floor settings | Templates |
|---|---|---|
| Template conformance | Configured at the organization, folder, or project level. Note: Sensitive Data Protection can be set to enforce data security policies on the templates. However, it does not validate the template conformance. |
Configured only at the project level. |
| Data inspection | Enforced only at the project level using the inspect and block mode. | Enforced using REST API, Service Extensions, Gemini Enterprise, and Vertex AI. |
Integration with Vertex AI and Google Cloud MCP servers
Model Armor integrates with Vertex AI and Google Cloud MCP servers to screen requests and responses from Gemini models and Google Cloud remote MCP servers based on the floor settings you define. You must enable Cloud Logging to view prompts and responses. For more information, see Model Armor integration with Vertex AI and Model Armor integration with Google Cloud MCP servers
Configure floor settings
Configure floor settings to define the minimum detection thresholds for Model Armor templates. These settings ensure that all new and modified templates meet specific requirements.
To configure floor settings, do the following:
- In the Google Cloud console, go to the Model Armor page.
- Select a project.
- On the Model Armor page, go to the Floor settings tab and click Configure floor settings.
- On the Configure floor settings page, select the configuration option.
- In the Detections section, configure the detection settings.
- Optional: If you select Sensitive Data Protection detection, configure the Sensitive Data Protection settings.
In the Responsible AI section, set the confidence level for each content filter.
In the Services section, select the services where these floor settings apply.
In the Logs section, select Enable Cloud Logging to log all user prompts, model responses, and the floor settings detector results.
Select Enable multi-language support to use the multi-language detection settings.
Click Save floor settings.
Allow a few minutes for the changes to the floor settings to take effect.
Define how floor settings are inherited
When configuring floor settings, select the configuration option.
Inherit parent's floor settings: Inherit floor settings set earlier in the resource hierarchy. Click Save floor settings and skip the remaining steps. To view the inherited settings, go to the Floor settings tab.
Custom: Define floor settings for this project. Custom settings that you define for a project override any inherited floor settings.
Disable: Disable any inherited floor settings. This means no detection rules apply to the Model Armor templates and Vertex AI for your Gemini workloads. Click Save floor settings and skip the remaining steps. View the disabled status on the Floor settings tab.
Define where floor settings are applied
Select one of the following services where the configured floor settings apply.
Model Armor - Template creation & update: Model Armor checks every new and modified Model Armor template in a project to ensure that the minimum settings align with the floor settings.
Google MCP Server: Floor settings check requests sent to or from Google or Google Cloud remote MCP servers to ensure they meet the floor setting thresholds. For more information, see Model Armor integration with Google Cloud MCP servers (Preview).
Vertex AI: Screen requests sent to Gemini models, and then log or block requests that meet floor settings thresholds.
If you select Vertex AI, the Vertex AI section appears where you choose how floor settings are enforced.
- Inspect only: Detect requests that don't meet floor settings but don't block them.
- Inspect and block violations: Detect and block requests that don't meet the floor settings.
View Model Armor floor settings
View Model Armor floor settings to verify existing settings, to identify the minimum requirements for your AI applications, or to troubleshoot issues when a template is not behaving as expected.
Run the following command to view the Model Armor floor settings.
Console
In the Google Cloud console, go to the Model Armor page.
Verify that you are viewing the project that you activated Model Armor on.
On the Model Armor page, go to the Floor settings tab. If floor settings are set at the organization level, you can view them. If no floor settings are defined, you must configure them. For more information, see Configure floor settings.
gcloud
View the Model Armor floor setting for a project.
gcloud model-armor floorsettings describe \ --full-uri='projects/PROJECT_ID/locations/global/floorSetting'
View the Model Armor floor setting for an organization.
gcloud model-armor floorsettings describe \ --full-uri='organizations/ORGANIZATION_ID/locations/global/floorSetting'
View the Model Armor floor setting for a folder.
gcloud model-armor floorsettings describe \ --full-uri='folders/FOLDER_ID/locations/global/floorSetting'
Replace the following:
- The ID of the project for the floor settings.
- The ID of the folder for the floor settings.
- The ID of the organization for the floor settings.
REST
View the Model Armor floor setting for a project.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://modelarmor.googleapis.com/v1/projects/PROJECT_ID/locations/global/floorSetting"
View the Model Armor floor setting for a folder.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://modelarmor.googleapis.com/v1/folders/FOLDER_ID/locations/global/floorSetting"
View the Model Armor floor setting for an organization.
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://modelarmor.googleapis.com/v1/organizations/ORGANIZATION_ID/locations/global/floorSetting"
Replace the following:
- The ID of the project for the floor settings.
- The ID of the folder for the floor settings.
- The ID of the organization for the floor settings.
C#
To run this code, first set up a C# development environment and install the Model Armor C# SDK.
View the Model Armor floor setting for a given project.
View the Model Armor floor setting for a given folder.
View the Model Armor floor setting for a given organization.
Go
To run this code, first set up a Go development environment and install the Model Armor Go SDK.
View the Model Armor floor setting for a given project.
View the Model Armor floor setting for a given folder.
View the Model Armor floor setting for a given organization.
Java
To run this code, first set up a Java development environment and install the Model Armor Java SDK.
View the Model Armor floor setting for a given project.
View the Model Armor floor setting for a given folder.
View the Model Armor floor setting for a given organization.
Node.js
To run this code, first set up a Node.js development environment and install the Model Armor Node.js SDK.
View the Model Armor floor setting for a given project.
View the Model Armor floor setting for a given folder.
View the Model Armor floor setting for a given organization.
PHP
To run this code, first set up a PHP development environment and install the Model Armor PHP SDK.
View the Model Armor floor setting for a given project.
View the Model Armor floor setting for a given folder.
View the Model Armor floor setting for a given organization.
Python
To run this code, first set up a Python development environment and install the Model Armor Python SDK.
View the Model Armor floor setting for a given project.
View the Model Armor floor setting for a given folder.
View the Model Armor floor setting for a given organization.
Update Model Armor floor settings
Update Model Armor floor settings to change the minimum requirements for templates, reflect changes in security policies, correct misconfigurations, or resolve conflicts between floor settings.
Run the following command to update the Model Armor floor settings.
Console
In the Google Cloud console, go to the Model Armor page.
Verify that you are viewing the project that you activated Model Armor on.
On the Model Armor page, go to the Floor settings tab and click Configure floor settings.
Update the required fields and click Save floor settings.
gcloud
gcloud model-armor floorsettings update --full-uri=<full-uri-of-the-floorsetting>
Example command:
gcloud model-armor floorsettings update \
--malicious-uri-filter-settings-enforcement=ENABLED \
--pi-and-jailbreak-filter-settings-enforcement=DISABLED \
--pi-and-jailbreak-filter-settings-confidence-level=LOW_AND_ABOVE \
--basic-config-filter-enforcement=ENABLED \
--add-rai-settings-filters='[{"confidenceLevel": "low_and_above", "filterType": "HARASSMENT"}, {"confidenceLevel": "high", "filterType": "SEXUALLY_EXPLICIT"}]'
--full-uri='folders/FOLDER_ID/locations/global/floorSetting' \
--enable-floor-setting-enforcement=true
To configure floor settings with multi-language detection enabled, run the following command:
gcloud model-armor floorsettings update \
--full-uri=projects/PROJECT_ID/locations/global/floorSetting \
--enable-multi-language-detection
Replace the following:
PROJECT_ID: the ID of the project for the floor settings.FOLDER_ID: the ID of the folder for the floor settings.
REST
Update the Model Armor floor setting for a given project.
curl -X PATCH -d '{"filterConfig" :{"piAndJailbreakFilterSettings": { "filterEnforcement": "ENABLED"}, "maliciousUriFilterSettings": { "filterEnforcement": "ENABLED" }, "rai_settings":{"rai_filters":{"filter_type":"DANGEROUS", "confidence_level":"LOW_AND_ABOVE" }, \ "rai_filters":{"filter_type":"HATE_SPEECH", "confidence_level":"LOW_AND_ABOVE" }, "rai_filters":{"filter_type":"HARASSMENT", "confidence_level":"LOW_AND_ABOVE" }, "rai_filters":{"filter_type":"SEXUALLY_EXPLICIT", "confidence_level":"LOW_AND_ABOVE" }}},"enableFloorSettingEnforcement":"true"}' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $(gcloud auth print-access-token) \ "https://modelarmor.googleapis.com/v1/projects/PROJECT_ID/locations/global/floorSetting"
Update the Model Armor floor setting for a given folder.
curl -X PATCH \ -d '{"filterConfig" :{"piAndJailbreakFilterSettings": { "filterEnforcement": "ENABLED"}, "maliciousUriFilterSettings": {"filterEnforcement": "ENABLED" }},"enableFloorSettingEnforcement":"true"}' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://modelarmor.googleapis.com/v1/folders/FOLDER_ID/locations/global/floorSetting"
Update the Model Armor floor setting for a given organization.
curl -X PATCH \ -d '{"filterConfig" :{"piAndJailbreakFilterSettings": { "filterEnforcement": "ENABLED"}, "maliciousUriFilterSettings": { "filterEnforcement": "ENABLED" }},"enableFloorSettingEnforcement":"true"}' \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://modelarmor.googleapis.com/v1/organizations/ORGANIZATION_ID/locations/global/floorSetting"
Replace the following:
PROJECT_ID: the ID of the project for the floor settings.FOLDER_ID: the ID of the folder for the floor settings.ORGANIZATION_ID: the ID of the organization for the floor settings.
The update command returns the following response:
{ "name": "projects/PROJECT_ID/locations/global/floorSetting", "updateTime": "2024-12-19T15:36:21.318191Z", "filterConfig": { "piAndJailbreakFilterSettings": { "filterEnforcement": "ENABLED" }, "maliciousUriFilterSettings": { "filterEnforcement": "ENABLED" } } }
C#
To run this code, first set up a C# development environment and install the Model Armor C# SDK.
Update the Model Armor floor setting for a given project.
Update the Model Armor floor setting for a given folder.
Update the Model Armor floor setting for a given organization.
Go
To run this code, first set up a Go development environment and install the Model Armor Go SDK.
Update the Model Armor floor setting for a given project.
Update the Model Armor floor setting for a given folder.
Update the Model Armor floor setting for a given organization.
Java
To run this code, first set up a Java development environment and install the Model Armor Java SDK.
Update the Model Armor floor setting for a given project.
Update the Model Armor floor setting for a given folder.
Update the Model Armor floor setting for a given organization.
Node.js
To run this code, first set up a Node.js development environment and install the Model Armor Node.js SDK.
Update the Model Armor floor setting for a given project.
Update the Model Armor floor setting for a given folder.
Update the Model Armor floor setting for a given organization.
PHP
To run this code, first set up a PHP development environment and install the Model Armor PHP SDK.
Update the Model Armor floor setting for a given project.
Update the Model Armor floor setting for a given folder.
Update the Model Armor floor setting for a given organization.
Python
To run this code, first set up a Python development environment and install the Model Armor Python SDK.
Update the Model Armor floor setting for a given project.
Update the Model Armor floor setting for a given folder.
Update the Model Armor floor setting for a given organization.
Review findings about floor setting violation
Each Model Armor finding identifies a floor setting violation. A violation occurs when a Model Armor template fails to meet the minimum security standards defined by the resource hierarchy's floor settings. Floor settings define the minimum requirements for templates.
Findings are generated when any of the following floor setting violations occur:
- A template with less restrictive settings is created before you configure floor settings.
- A template is missing required filters.
- A template does not meet the minimum confidence level for the filters.
When the system detects a violation, the system generates a high-severity finding in Security Command Center (if you use the Premium or Enterprise service tier of Security Command Center). The finding specifies the violated floor setting, the non-compliant template, and details about the violation.
The following example shows the finding's sourceProperties field. This
violation, related to the malicious URI filter, occurred
because the template setting for maliciousUriFilterSettings is
DISABLED, but the floor settings require it to be ENABLED.
{ "filterConfig": { "raiSettings": { "raiFilters": [ { "filterType": "HATE_SPEECH", "confidenceLevel": { "floorSettings": "LOW_AND_ABOVE", "template": "MEDIUM_AND_ABOVE" } }, { "filterType": "HARASSMENT", "confidenceLevel": { "floorSettings": "MEDIUM_AND_ABOVE", "template": "HIGH" } } ] }, "piAndJailbreakFilterSettings": { "confidenceLevel": { "floorSettings": "LOW_AND_ABOVE", "template": "HIGH" } }, "maliciousUriFilterSettings": { "floorSettings": "ENABLED", "template": "DISABLED" } } }
What's next
- Learn more about Model Armor.
- Learn about Model Armor templates.
- Sanitize prompts and responses.
- Troubleshoot Model Armor issues.