This document explains 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 the 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. When using 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, floor settings set at the project level override conflicting floor settings set at the folder level above it.
The following tables 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. Suppose that you set floor settings similar to the following:
- 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, located in the folder, must use prompt injection and jailbreak detection, set to medium confidence.
In this scenario, the settings that you set result in the following occurring:
Any template that 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, even a template created in a different folder, isn't affected by the malicious URI filter rule from the first folder.
Floor settings apply only within their specific place 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 if the template's configuration is conformant with the floor settings. You cannot create or update a template that's less strict than the floor settings.
Floor settings can be set at the organization, folder, and project level. The user interface is only available for the project level and lets you inherit the organization or folder level settings. To set the floor settings at the organization or folder level, you must use the API.
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 your defined floor settings. You need to enable Cloud Logging to get visibility into 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
You use floor settings to configure the minimum detection thresholds for Model Armor templates. These settings verify that all new and modified templates meet certain 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, you need to configure the Sensitive Data Protection settings.
In the Responsible AI section, set the confidence level for each content filter.
In the Services section, choose the services where these floor settings will be applied.
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.
Wait 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: Inherits floor settings set higher in the resource hierarchy. Click Save floor settings and skip the next steps. To view the inherited settings, go to the Floor settings tab.
Custom: Define floor settings for this project. The custom settings that you define for a project override any inherited floor settings.
Disable: Disables any inherited floor settings, which means no detection rules are applied to the Model Armor templates and Vertex AI for your Gemini workloads. Click Save floor settings and skip the next 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 are applied.
Model Armor - Template creation & update: Every new and modified Model Armor template in a project is checked to ensure that the minimum settings are specified according to the floor settings.
Google MCP Server: Requests sent to or from Google or Google Cloud remote MCP servers are checked to ensure that 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 log or block those that meet floor settings thresholds.
If you select Vertex AI, the Vertex AI section is displayed where you can 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 what the minimum requirements are 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 here. If no floor settings are defined, then you must configure them. For more information, see Configure floor settings.
gcloud
View the Model Armor floor setting for a given project.
gcloud model-armor floorsettings describe \ --full-uri='projects/PROJECT_ID/locations/global/floorSetting'
View the Model Armor floor setting for a given organization.
gcloud model-armor floorsettings describe \ --full-uri='organizations/ORGANIZATION_ID/locations/global/floorSetting'
View the Model Armor floor setting for a given folder.
gcloud model-armor floorsettings describe \ --full-uri='folders/FOLDER_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.
REST
View the Model Armor floor setting for a given 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 given 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 a given 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:
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.
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 to reflect changes in security policies, to correct misconfigurations, or to 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 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 floor settings are configured.
- A template is missing required filters.
- A template does not meet the minimum confidence level for the filters.
When a violation is detected, a high-severity finding is generated in Security Command Center (only if you're using 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 the 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.