
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
/ 20
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
Execute a file-based prompt to sanitize a file
/ 20
Model Armor on Google Cloud Platform enhances AI safety by screening both user prompts and LLM responses for risks like 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 left is the Lab Details pane with the following:
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 Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
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 Vertex AI > Workbench.
Find the
The JupyterLab interface for your Workbench instance opens in a new browser tab.
1. Close the browser tab for JupyterLab, and return to the Workbench home page.
2. Select the checkbox next to the instance name, and click Reset.
3. After the Open JupyterLab button is enabled again, wait one minute, and then click Open JupyterLab.
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.
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 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 Validating 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.
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.
You have successfully completed the challenge to create a Model Armor template and you have executed different user prompts to screen for varying Sensitive Data Protection (SDP) infoTypes.
Manual Last Updated June 25, 2025
Lab Last Tested June 25, 2025
Copyright 2025 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 will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one