設定 Agent Gateway,以便 Workspace MCP 傳入資料

支援這項功能的版本:Gemini Enterprise。

您可以設定 Google Cloud 專案,透過資料連接器連線至 Google Workspace MCP 伺服器,並啟用 Workspace 政策決策點 (PDP) 的選擇加入代理程式閘道,對這些專案進行 Workspace 管理。

透過 Workspace PDP 設定 Agent Gateway 後,AI 代理 (例如 Gemini Enterprise 代理) 就能存取 Workspace 應用程式資料 (例如 Google 雲端硬碟),同時強制執行直接在 Google 管理控制台中設定的存取控管政策。

必備條件

設定 Agent Gateway 前,請先準備好:

  • 已啟用 Gemini Enterprise 的 Google Cloud 雲端專案。
  • 已通過驗證的 gcloud CLI,具備在 Google Cloud 專案中啟用 API,以及管理網路服務、網路安全和服務擴充功能資源的權限。
  • Google Workspace 管理員權限 (安全性管理員權限)。
  • 瞭解如何在 Google Cloud 中設定 Agent Gateway

步驟 1:建立或選取 Google Cloud 專案

  1. Google Cloud 控制台中,建立新的 Google Cloud 專案,或選取現有專案進行這項設定,並記下專案 ID (例如 my-project-id)。

步驟 2:啟用必要的網路和安全 API

使用 gcloud 或 Cloud 控制台,在 Google Cloud 雲端專案中啟用 Network Services 和 Network Security API:

gcloud services enable networkservices.googleapis.com \
                       networksecurity.googleapis.com \
                       --project=PROJECT_ID

PROJECT_ID 替換為您的 Google Cloud 專案 ID。

步驟 3:啟用 Agent Registry API 和 MCP

  1. 前往 Google Cloud 控制台,依序點選「API 和服務」接下來「程式庫」
  2. 搜尋並啟用 Agent Registry API (agentregistry.googleapis.com)。
  3. 啟用工作流程所需的 Google 雲端硬碟 MCP 或其他 MCP 伺服器。詳情請參閱「註冊 MCP 伺服器」。

重要事項:啟用 MCP 伺服器並選擇加入 Agent Gateway 後,Gemini Enterprise 只會將流量導向標準、第一方 (1P) 和第三方 (3P) 資料連接器的閘道。Workspace 資料治理不支援設定自訂資料連接器。

步驟 4:建立及匯入 Agent Gateway 和授權資源

設定 Agent Gateway、授權擴充功能 (Workspace 政策決策點) 和授權政策資源。您可以使用 YAML 設定檔以宣告方式定義這些資源,並使用 gcloud 匯入這些資源:

  1. 建立代理程式閘道設定檔 (agent-gateway.yaml):

    name: AGENT_GATEWAY_NAME
    protocols:
    - MCP
    googleManaged:
      governedAccessPath: AGENT_TO_ANYWHERE
    registries:
      - //agentregistry.googleapis.com/projects/PROJECT_ID/locations/global
    

    AGENT_GATEWAY_NAME 替換為 Agent Gateway 資源的名稱 (例如 ge-agent-gateway),並將 PROJECT_ID 替換為您的 Google Cloud 雲端專案 ID。

  2. 建立授權擴充功能設定檔,指向 Workspace 政策決策點 (ws-pdp-authz-extension.yaml):

    name: AUTHZ_EXT_NAME
    service: workspacepolicyengine.pa.googleapis.com
    failOpen: true
    timeout: 5s
    

    AUTHZ_EXT_NAME 替換為授權擴充功能的名稱 (例如 ws-pdp-authz-ext)。

  3. 建立授權政策設定檔 (ws-pdp-authz-policy.yaml),將擴充功能與閘道建立關聯:

    name: AUTHZ_POLICY_NAME
    target:
      resources:
      - "projects/PROJECT_ID/locations/LOCATION/agentGateways/AGENT_GATEWAY_NAME"
    policyProfile: CONTENT_AUTHZ
    action: CUSTOM
    customProvider:
      authzExtension:
        resources:
        - "projects/PROJECT_ID/locations/LOCATION/authzExtensions/AUTHZ_EXT_NAME"
    

    請替換下列項目:

    • AUTHZ_POLICY_NAME:授權政策的名稱 (例如 ws-pdp-authz-policy)。
    • PROJECT_ID:您的 Google Cloud 專案 ID。
    • LOCATION:部署作業的區域 (例如 us-central1)。
    • AGENT_GATEWAY_NAME:步驟 1 中的 Agent Gateway 名稱。
    • AUTHZ_EXT_NAME:步驟 2 中的授權擴充功能名稱。
  4. 使用 gcloud 匯入 YAML 設定檔:

    # Import the Agent Gateway
    gcloud beta network-services agent-gateways import AGENT_GATEWAY_NAME \
      --source=agent-gateway.yaml \
      --location=LOCATION \
      --project=PROJECT_ID
    
    # Import the Authorization Extension
    gcloud beta service-extensions authz-extensions import AUTHZ_EXT_NAME \
      --source=ws-pdp-authz-extension.yaml \
      --location=LOCATION \
      --project=PROJECT_ID
    
    # Import the Authorization Policy
    gcloud beta network-security authz-policies import AUTHZ_POLICY_NAME \
      --source=ws-pdp-authz-policy.yaml \
      --location=LOCATION \
      --project=PROJECT_ID
    

步驟 5:驗證 Agent Gateway 設定並取得資源名稱

  1. 列出已部署的 Agent Gateway,確認匯入成功:

    gcloud beta network-services agent-gateways list --location=LOCATION --project=PROJECT_ID
    
  2. 說明 Agent Gateway 資源:

    gcloud beta network-services agent-gateways describe AGENT_GATEWAY_NAME --location=LOCATION --project=PROJECT_ID
    
  3. 複製完整的 Agent Gateway 資源名稱 (格式為 projects/PROJECT_ID/locations/LOCATION/agentGateways/AGENT_GATEWAY_NAME,例如 projects/my-project/locations/us-central1/agentGateways/ge-agent-gateway)。

步驟 6:連線至 Google Identity Provider

  1. Gen App Builder Engines Console 中,依序前往「Settings」接下來「Authentication」
  2. 將引擎連線至 Google Identity 提供者。
  3. 如需其他說明文件,請參閱「Google Cloud 資料來源存取權控管」。

步驟 7:在 Gemini Enterprise 執行個體中設定 Agent Gateway

  1. Gemini Enterprise (GE) 執行個體中,前往「連結的資料儲存庫」
  2. 在「MCP servers」(MCP 伺服器) 下方,選取「Configure Agent Gateway」(設定代理閘道)
  3. 輸入在步驟 5 中取得的完整 Agent Gateway 資源名稱 (例如 projects/PROJECT_ID/locations/us-central1/agentGateways/ge-agent-gateway)。

步驟 8:在 Google 管理控制台中設定 Workspace 服務專員存取控制項

設定 Agent Gateway 和 Workspace Policy Decision Point 後,即可直接透過 Google 管理控制台管理代理程式存取政策:

  1. 在 Google 管理控制台中,依序點選「選單」圖示 接下來「代理程式」
  2. 在「設定」分頁中,設定所有 Gemini Enterprise 代理的預設存取權政策。詳情請參閱「控管 Gemini Enterprise 代理的存取權」。
  3. 在「代理管理」分頁中,將特定代理新增至管理清單,即可設定個別存取權 (「可信任」或「已封鎖」)。詳情請參閱「為 Workspace 使用者管理 Gemini Enterprise 代理」。