將 Model Armor 與 Google Agentspace 整合,即可篩選使用者傳送給 AI 代理的提示詞,以及 AI 代理的回覆,降低提示詞注入、有害內容和敏感資料外洩等風險。整合設定完成後,就會套用至所有使用者互動。
事前準備
建立 Model Armor 範本,並確保該範本與 Google Agentspace 位於同一個 Google Cloud專案中。範本和 Google Agentspace 執行個體的位置必須相符。如要進一步瞭解支援的位置,請參閱「Model Armor 位置」和「Google Agentspace 位置」。
必要的角色
將 Model Armor 與 Google Agentspace 整合前,請確認您具備所需角色。
如要取得建立及管理 Model Armor 範本所需的權限,請要求管理員授予您 Model Armor 範本的 Model Armor 管理員 (roles/modelarmor.admin
) IAM 角色。如要進一步瞭解如何授予角色,請參閱「管理專案、資料夾和機構的存取權」。
啟用整合功能
如要啟用 Model Armor 版 Google Agentspace,安全管理員必須在 Model Armor 中建立政策,然後 Google Agentspace 管理員將這些政策套用至 Google Agentspace 執行個體。
運作方式
設定整合後,Google Agentspace 會透過 Model Armor API 傳送使用者輸入內容和助理輸出內容,並使用所選範本進行篩選。Google Agentspace 會使用服務代理向 Model Armor 進行驗證。Model Armor 會根據範本中定義的篩選器設定做出回應,Google Agentspace 則會根據回應封鎖或允許要求/回覆。
舉例來說,Google Agentspace 可能會偵測到含有個人識別資訊的要求,並將其傳送至 Model Armor 進行篩選。如果 Model Armor 範本設定為封鎖個人識別資訊 (PII),就會告知 Google Agentspace 封鎖要求。
記錄
Model Armor 會在 Cloud Logging 中,為清理要求及其回應產生平台記錄。您必須具備私密記錄檢視者 (roles/logging.privateLogViewer
) IAM 角色,才能查看 Model Armor 稽核記錄。如要進一步瞭解自動產生的稽核記錄,請參閱「Model Armor 稽核記錄」。
如要記錄範本作業,請將 templateMetadata.logSanitizeOperations
欄位設為 true
。詳情請參閱「在範本中設定記錄」。