Get started with Model Armor

This page details the permissions required for Model Armor and provides instructions for enabling and disabling Model Armor.

Required permissions

You control access to Model Armor using IAM roles. The following roles grant access to the Model Armor capabilities:

Role Permissions
Administrators and owners

modelarmor.admin

resourcemanager.projects.get
resourcemanager.projects.list
modelarmor.templates.create
modelarmor.templates.update
modelarmor.templates.delete
resourcemanager.projects.get
resourcemanager.projects.list
modelarmor.templates.useToSanitizeUserPrompt
modelarmor.templates.useToSanitizeModelResponse
resourcemanager.projects.get
resourcemanager.projects.list
modelarmor.templates.get
modelarmor.templates.list
Users and applications planning to screen prompts and responses

modelarmor.user

resourcemanager.projects.get
resourcemanager.projects.list
modelarmor.templates.useToSanitizeUserPrompt
modelarmor.templates.useToSanitizeModelResponse
Template viewers (detectors and thresholds)

modelarmor.viewer

resourcemanager.projects.get
resourcemanager.projects.list
modelarmor.templates.get
modelarmor.templates.list
Administrators and owners

modelarmor.floorSettingsAdmin

resourcemanager.projects.get
resourcemanager.projects.list
resourcemanager.folders.get
resourcemanager.folders.list
resourcemanager.organizations.get
modelarmor.floorSettings.get
modelarmor.floorSettings.update
Floor settings viewers

modelarmor.floorSettingsViewer

resourcemanager.projects.get
resourcemanager.projects.list
resourcemanager.folders.get
resourcemanager.folders.list
resourcemanager.organizations.get
modelarmor.floorSettings.get

Enable Model Armor

You must enable Model Armor APIs before you can use Model Armor.

Console

  1. In the Google Cloud console, go to the Model Armor page.
  2. Click Enable Model Armor APIs.

gcloud

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

  1. Run the gcloud auth login command to authenticate your Google Cloud account so that the Google Cloud CLI tool can interact with Google Cloud services on your behalf.
  2. Run the following command to set the default Google Cloud project for the Google Cloud CLI tool.

    gcloud config set project project_id

    Replace project_id with the actual ID of your project.

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

    gcloud config set api_endpoint_overrides/modelarmor
    "https://modelarmor.location_id.rep.googleapis.com/"

    Replace location_id with the region where you want to use Model Armor.

Enable Model Armor

Run the following command to enable Model Armor.

  gcloud services enable modelarmor.googleapis.com --project=projectID

Disable Model Armor

Run the following command to disable Model Armor.

  gcloud services disable modelarmor.googleapis.com

What's next