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
Google Cloud 的 Model Armor 會過濾使用者提示詞和 LLM 回覆,抵禦有害內容、提示詞注入和敏感資料外洩等風險,強化 AI 安全防護。這項服務能讓組織集中管理並落實 AI 應用的安全政策,透過篩選機制確保互動安全且符合規範。Model Armor 整合了 Security Command Center,您可以在統一的檢視畫面掌握全局,防止 AI 模型未經授權即遭人公開或操縱。
在本實驗室中,您將瞭解如何使用 Model Armor 清理提示詞和回覆。
挑戰本實驗室,展現執行下列工作的能力:
請詳閱以下操作說明。實驗室活動會計時,且中途無法暫停。點選「Start Lab」後就會開始計時,顯示可使用 Google Cloud 資源的時間。
您將在真正的雲端環境完成實作實驗室活動,而不是模擬或示範環境。為此,我們會提供新的暫時憑證,供您在實驗室活動期間登入及存取 Google Cloud。
為了順利完成這個實驗室,請先確認:
按一下「Start Lab」按鈕。如果實驗室會產生費用,請在開啟的對話方塊中選取付款方式。右側的「Lab setup and access」面板會顯示下列項目:
請注意,實驗室計時器位於頁面頂端附近,會顯示剩餘時間。
按一下「Open Google Cloud console」。如果使用 Chrome 瀏覽器,也可以按一下滑鼠右鍵,選取「在無痕視窗中開啟連結」。
接著,實驗室會啟動相關資源,並開啟另一個分頁,顯示「登入」頁面。
提示:您可以在不同的視窗並排開啟分頁。
如有必要,請將下方的 Username 貼到「登入」對話方塊。
您也可以在「Lab setup and access」面板找到「Username」。
點選「下一步」。
複製下方的 Password,並貼到「歡迎使用」對話方塊。
您也可以在「Lab setup and access」面板找到「Password」。
點選「下一步」。
繼續點按後續頁面:
Google Cloud 控制台稍後會在這個分頁開啟。
您必須先啟用 API,才能使用 Model Armor。
在 Google Cloud 控制台啟用 Cloud Shell。
執行下列指令:
點選「Check my progress」,確認目標已達成。
在 Google Cloud 控制台,依序點選「導覽選單」圖示 >「Agent Platform」>「Notebooks」>「Workbench」。
找出
Workbench 執行個體的 JupyterLab 介面會在新瀏覽器分頁中開啟。
開啟
在「Select Kernel」對話方塊,從可用核心清單選取「Python 3」。
執行筆記本的「Getting Started」和「Import libraries」部分。
429 回應,請稍候 1 分鐘再重新執行儲存格,即可繼續操作。
在這項工作中,您將建立 Model Armor 範本 ma-template,定義 AI 互動的安全防護和內容篩選規則。這個範本會建立相關政策,協助偵測並降低敏感資料外洩風險,確保符合資料保護標準。
執行筆記本的「Create a Model Armor Template」部分,依照提供的過濾設定,在 ma-template。完成後,請返回這裡查看進度並確認目標已達成。
點選「Check my progress」,確認目標已達成。
在這項工作中,您將測試各種使用者提示詞,評估 Model Armor 能否根據預先定義的 Sensitive Data Protection (SDP) infoType,偵測及過濾不同類型的敏感資料。這項程序可確保 Model Armor 有效過濾內容,防範未經授權的資料暴露事件。
前往筆記本的「Validate user prompts with Model Armor」部分,然後執行各種指令,運用不同安全防護功能清理使用者提示詞。完成後,請返回這裡查看進度並確認目標已達成。
點選「Check my progress」,確認目標已達成。
點選「Check my progress」,確認目標已達成。
點選「Check my progress」,確認目標已達成。
點選「Check my progress」,確認目標已達成。
點選「Check my progress」,確認目標已達成。
您已成功完成挑戰,建立 Model Armor 範本,並執行不同的使用者提示詞,針對各類 Sensitive Data Protection (SDP) infoType 過濾內容。
使用手冊上次更新日期:2026 年 5 月 18 日
實驗室上次測試日期:2026 年 4 月 22 日
Copyright 2026 Google LLC 保留所有權利。Google 和 Google 標誌是 Google LLC 的商標,其他公司和產品名稱則有可能是其關聯公司的商標。
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