Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Enable the Model Armor API
/ 10
Create a Model Armor template
/ 10
Configure Sensitive Data Protection with Inspect and De-identify templates
/ 10
Input a user prompt to screen Responsible AI
/ 10
Input a user prompt to screen Malicious URI
/ 10
Input a user prompt to screen DLP
/ 10
Input a model response to screen DLP
/ 20
Sanitize a file-based user prompt
/ 20
Enable the Model Armor API
/ 10
Create a Model Armor template
/ 10
Configure Sensitive Data Protection with Inspect and De-identify templates
/ 10
Input a user prompt to screen Responsible AI
/ 10
Input a user prompt to screen Malicious URI
/ 10
Input a user prompt to screen DLP
/ 10
Input a model response to screen DLP
/ 20
Sanitize a file-based user prompt
/ 20
Model Armor on Google Cloud enhances AI safety by screening both user prompts and LLM responses for risks such as harmful content, prompt injection, and sensitive data leaks. It allows organizations to centrally manage and enforce security policies for their AI applications, acting as a filter to ensure interactions are safe and compliant. This service integrates with Security Command Center for unified visibility and helps protect against unauthorized exposure or manipulation of AI models.
In this lab, you explore sanitizing prompts and their responses using Model Armor.
This lab challenges you to demonstrate your ability to do the following:
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the right is the Lab setup and access panel with the following:
Note that the lab timer is located near the top of the page, showing the remaining time.
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab setup and access panel.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab setup and access panel.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Before you can begin using Model Armor, you must enable the API.
In the Google Cloud console, activate Cloud Shell.
Execute the following command:
Click Check my progress to verify the objective.
In the Google Cloud console, on the Navigation menu (), click Agent Platform > Notebooks > Workbench.
Find the
The JupyterLab interface for your Workbench instance opens in a new browser tab.
Open the
In the Select Kernel dialog, choose Python 3 from the list of available kernels.
Run through the Getting Started and the Import libraries sections of the notebook.
429 response from any of the notebook cell executions, wait 1 minute before running the cell again to proceed.
In this task, you create a Model Armor template, ma-template, to define security and content filtering rules for AI interactions. This template establishes policies for detecting and mitigating sensitive data exposure, ensuring compliance with data protection standards.
Run through the Create a Model Armor Template section of the notebook to create the ma-template in the
Click Check my progress to verify the objective.
In this task, you create Cloud Sensitive Data Protection (DLP) Inspect and De-identify templates, and link them to an advanced Model Armor template, ma-sdp-template, using advancedConfig. This enables custom inspection rules and automated data masking for AI prompt and response sanitization.
Run through the Configure Sensitive Data Protection with Inspect and De-identify Templates section of the notebook to create ma-inspect-template and ma-deidentify-template.
Execute the cells to create the advanced Model Armor template ma-sdp-template using advancedConfig.
Test sanitizing model responses to observe sensitive infoTypes being de-identified.
Click Check my progress to verify the objective.
In this task, you test various user prompts to evaluate how Model Armor detects and screens different types of sensitive data based on predefined Sensitive Data Protection (SDP) infoTypes. This process helps ensure that Model Armor effectively filters and protects against unauthorized data exposure.
Go through the Validate user prompts with Model Armor section of the notebook to execute various commands for sanitizing user prompts against different security features. Once complete, return here to check your progress and verify the objectives.
WARNING messages in the sanitizationMetadata output regarding filter version V1 moving to LEGACY. This is an informational service notice from Model Armor regarding future filter versioning and does not indicate an error or affect your lab execution.Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
Click Check my progress to verify the objective.
In this task, you inspect the Model Armor sanitization operation logs in Cloud Logging to review prompt and response screening details, filter matches, and evaluation metadata.
In the Google Cloud console navigation menu, click Monitoring > Logs Explorer.
In the Query pane, enter the following log query:
Ensure the time range filter (top-right next to Run Query) is set to Last 1 hour.
Click Run Query.
Inspect the returned log entries to review the Model Armor sanitization results and filter evaluation details.
You have successfully completed the lab to create Model Armor templates, configure Sensitive Data Protection Inspect and De-identify templates, execute prompts and model responses to screen and de-identify sensitive data, and view sanitization logs in Logs Explorer.
Manual Last Updated August 24, 2026
Lab Last Tested August 24, 2026
Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We can notify you via email when it becomes available
Great!
We can contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one