为 Workspace MCP 入口设置 Agent Gateway

支持此功能的版本:Gemini Enterprise。

您可以配置 Google Cloud 项目,使其通过数据连接器连接到 Google Workspace MCP 服务器,并启用选择性加入的代理网关和工作区政策决策点 (PDP),以便对这些项目进行工作区治理。

通过 Agent Gateway 设置 Workspace PDP 后,AI 智能体(例如 Gemini Enterprise 智能体)便可在直接在 Google 管理员控制台中强制执行配置的访问权限控制政策的同时,访问 Workspace 应用数据(例如 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 API 和 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 服务器

重要提示:启用选择性加入的 Agent Gateway 的 MCP 服务器后,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 替换为您的代理网关资源的名称(例如 ge-agent-gateway),并将 PROJECT_ID 替换为您的 Google Cloud 项目 ID。

  2. 创建指向 Workspace Policy Decision Point (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 步中的代理网关的名称。
    • 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. 列出已部署的代理网关,以验证导入是否成功:

    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 提供方

  1. Gen App Builder Engines 控制台中,依次前往设置 然后 身份验证
  2. 将您的引擎连接到 Google Identity 提供方。
  3. 如需查看其他文档,请参阅 Google Cloud 数据源访问权限控制

第 7 步:在 Gemini Enterprise 实例中配置 Agent Gateway

  1. Gemini Enterprise (GE) 实例中,前往关联的数据存储区
  2. MCP 服务器下,选择配置 Agent Gateway
  3. 输入在第 5 步中获得的完整 Agent Gateway 资源名称(例如 projects/PROJECT_ID/locations/us-central1/agentGateways/ge-agent-gateway)。

第 8 步:在 Google 管理控制台中配置 Workspace 客服人员访问权限控制

设置 Agent Gateway 和 Workspace 政策决策点后,您可以直接通过 Google 管理控制台管理代理访问政策:

  1. 在 Google 管理控制台中,依次点击菜单 然后 智能体
  2. 设置标签页上,为所有 Gemini Enterprise 智能体配置默认访问权限政策。如需了解详情,请参阅控制对 Gemini Enterprise 代理的访问权限
  3. 智能体管理标签页上,将特定智能体添加到您的管理列表中,以配置个别访问权限(受信任或已屏蔽)。如需了解详情,请参阅为 Workspace 用户管理 Gemini Enterprise 智能体