[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/gemini/enterprise/notebooklm-enterprise/docs/enable-model-armor [Back]  [Original]

Enable Model Armor in Gemini Notebook Enterprise  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Enable Model Armor in Gemini Notebook Enterprise Stay organized with collections Save and categorize content based on your preferences.

Preview

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions.

This document describes how to enable Model Armor for Gemini Notebook Enterprise. Model Armor is a Google Cloud service that enhances the security and safety of your AI applications by proactively screening the prompts and responses given using Gemini Notebook Enterprise. This helps protect against various risks and ensures responsible AI practices. Model Armor is supported on Gemini Notebook Enterprise at no additional cost.

Note: Enabling Model Armor in Gemini Notebook Enterprise can increase latency.

Model Armor's response to potential issues in user queries or responses from Gemini Notebook Enterprise is governed by the template's enforcement type.

For more information, see Define the enforcement type.

Before you begin

Make sure you have the required roles assigned to you and the service account:

Create a Model Armor template

You can create and use the same Model Armor template for user prompts and responses from the assistant, or you can create two separate Model Armor templates. For more information, see Create and manage Model Armor templates.

When creating a Model Armor template for Gemini Notebook Enterprise, consider these configurations:

Configure Gemini Notebook Enterprise with the Model Armor templates

The following steps describe how to add the Model Armor templates to Gemini Notebook Enterprise.

REST

To add the Model Armor templates to Gemini Notebook Enterprise, run the following command :

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: PROJECT_ID" \
"https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER?update_mask=customerProvidedConfig" \
-d '{
  "customerProvidedConfig": {
    "notebooklmConfig": {
      "modelArmorConfig": {
        "userPromptTemplate": "QUERY_PROMPT_TEMPLATE",
        "responseTemplate": "RESPONSE_PROMPT_TEMPLATE"
      }
    }
  }
}'

Replace the following:

Example command and result

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: my-project-123" \
"https://discoveryengine.googleapis.com/v1/projects/123456?update_mask=customerProvidedConfig" \
-d '{
  "customerProvidedConfig": {
    "notebooklmConfig": {
      "modelArmorConfig": {
        "userPromptTemplate": "projects/my-project-123/locations/us/templates/model-armor-template",
        "responseTemplate": "projects/my-project-123/locations/us/templates/model-armor-template"
      }
    }
  }
}'

{ "name": "projects/123456", "createTime": "2025-04-18T19:38:23.299346527Z", "provisionCompletionTime": "2025-04-18T19:38:23.299346527Z", "customerProvidedConfig": { "notebooklmConfig": { "modelArmorConfig": { "userPromptTemplate": "projects/my-project-123/locations/us/templates/model-armor-template", "responseTemplate": "projects/my-project-123/locations/us/templates/model-armor-template" } } } }
Note: The Model Armor templates takes 10 minutes or more to take effect.

Test if the Model Armor template is enabled

After configuring the Model Armor template, test if Gemini Notebook Enterprise proactively screens and blocks user prompts and responses according to the confidence levels set in the Model Armor filters.

When the Model Armor template is configured to Inspect and block requests that violate the policy, the following policy violation message is shown:

Console

For example, you see the policy violation message: Shows the message a user gets when it violates the model-armor template that is enabled for Gemini Notebook Enterprise. [Shows the message a user gets when it violates the model-armor template that is enabled for Gemini Notebook Enterprise.] Model Armor policy violation message

REST

A JSON response which includes the following:

For example: json "answer.state": "SKIPPED", "answer.assist_skipped_reasons": "CUSTOMER_POLICY_VIOLATION_REASON"

Remove the Model Armor templates from Gemini Notebook Enterprise

To remove the Model Armor templates from Gemini Notebook Enterprise, run the following command:

REST

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: PROJECT_ID" \
"https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_NUMBER?update_mask=customerProvidedConfig" \
-d '{
  "customerProvidedConfig": {
    "notebooklmConfig": {
      "modelArmorConfig": {}
    }
  }
}'

Replace the following:

Example command and result

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
-H "X-Goog-User-Project: my-project-123" \
"https://discoveryengine.googleapis.com/v1/projects/123456?update_mask=customerProvidedConfig" \
-d '{
  "customerProvidedConfig": {
    "notebooklmConfig": {
    }
  }
}'

{ "name": "projects/123456", "createTime": "2025-04-18T19:38:23.299346527Z", "provisionCompletionTime": "2025-04-18T19:38:23.299346527Z", "customerProvidedConfig": { "notebooklmConfig": {} } }

Configure audit logs

Model Armor records Data Access audit logs that you can use to analyze the request and response screening verdicts. These logs don't contain the user queries or responses from Gemini Notebook Enterprise, so they are safe for reporting and analytics. For more information, see Audit logging for Model Armor.

To access these logs, you need to have the Private Logs Viewer (roles/logging.privateLogViewer) IAM role.

Enable Data Access audit logs

To enable the Data Access audit logs, follow these steps:

  1. In the Google Cloud console, go to IAM & Admin > Audit Logs.

  2. Select the Model Armor API.

  3. In the Permission type section, select the Data read permission type.

  4. Click Save.

Examine Data Access audit logs

To examine the Data Access audit logs, follow these steps:

  1. In the Google Cloud console, go to Logs Explorer.

  2. Search the logs for the following method names:

    • google.cloud.modelarmor.v1.ModelArmor.SanitizeUserPrompt to view the user requests that were screened.

    • google.cloud.modelarmor.v1.ModelArmor.SanitizeModelResponse to view the responses that were screened.

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-18 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-18 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page