Menyiapkan Agent Gateway untuk ingress MCP Workspace

Edisi yang didukung untuk fitur ini: Gemini Enterprise.

Anda dapat mengonfigurasi project Google Cloud untuk terhubung ke server MCP Google Workspace melalui konektor data dan mengaktifkan Gateway Agen yang bersifat opsional dengan Titik Keputusan Kebijakan (PDP) Workspace agar memiliki tata kelola Workspace.

Menyiapkan Gateway Agen dengan PDP Workspace memungkinkan agen AI (seperti agen Gemini Enterprise) mengakses data aplikasi Workspace (seperti Google Drive) sekaligus menerapkan kebijakan kontrol akses yang dikonfigurasi langsung di konsol Admin Google.

Prasyarat

Sebelum menyiapkan Agent Gateway, Anda memerlukan:

Langkah 1: Buat atau pilih project Google Cloud

  1. Di Konsol Google Cloud, buat project Google Cloud baru atau pilih project yang sudah ada untuk penyiapan ini, dan catat project ID Anda (misalnya, my-project-id).

Langkah 2: Aktifkan Network & Security API yang diperlukan

Aktifkan Network Services API dan Network Security API di project Google Cloud Anda menggunakan gcloud atau Konsol Cloud:

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

Ganti PROJECT_ID dengan project ID Google Cloud Anda.

Langkah 3: Aktifkan Agent Registry API dan MCP

  1. Di Konsol Google Cloud, buka APIs & Services lalu Library.
  2. Telusuri dan aktifkan Agent Registry API (agentregistry.googleapis.com).
  3. Aktifkan MCP Google Drive atau server MCP lain yang diperlukan untuk alur kerja Anda. Untuk mengetahui detailnya, buka Mendaftarkan server MCP.

Penting: Saat mengaktifkan server MCP dengan Agent Gateway keikutsertaan, Gemini Enterprise hanya merutekan traffic ke gateway untuk konektor data pihak pertama (1P) dan pihak ketiga (3P) standar. Mengonfigurasi konektor data kustom tidak didukung dengan tata kelola data Workspace.

Langkah 4: Buat dan impor resource otorisasi dan Agent Gateway

Konfigurasi resource Agent Gateway, Ekstensi Otorisasi (Workspace Policy Decision Point), dan Kebijakan Otorisasi. Anda dapat menentukan resource ini secara deklaratif menggunakan file konfigurasi YAML dan mengimpornya menggunakan gcloud:

  1. Buat file konfigurasi Agent Gateway (agent-gateway.yaml):

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

    Ganti AGENT_GATEWAY_NAME dengan nama untuk resource Agent Gateway Anda (seperti ge-agent-gateway) dan PROJECT_ID dengan project ID Google Cloud Anda.

  2. Buat file konfigurasi Ekstensi Otorisasi yang mengarah ke Titik Keputusan Kebijakan Workspace (ws-pdp-authz-extension.yaml):

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

    Ganti AUTHZ_EXT_NAME dengan nama untuk ekstensi otorisasi (seperti ws-pdp-authz-ext).

  3. Buat file konfigurasi Kebijakan Otorisasi (ws-pdp-authz-policy.yaml) untuk mengaitkan ekstensi dengan gateway Anda:

    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"
    

    Ganti kode berikut:

    • AUTHZ_POLICY_NAME: Nama untuk kebijakan otorisasi (seperti ws-pdp-authz-policy).
    • PROJECT_ID: Project ID Google Cloud Anda.
    • LOCATION: Region untuk deployment Anda (misalnya, us-central1).
    • AGENT_GATEWAY_NAME: Nama Agent Gateway dari langkah 1.
    • AUTHZ_EXT_NAME: Nama ekstensi otorisasi dari langkah 2.
  4. Impor file konfigurasi YAML menggunakan gcloud:

    # 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
    

Langkah 5: Verifikasi penyiapan Agent Gateway & dapatkan nama resource

  1. Buat daftar Gateway Agen yang di-deploy untuk memverifikasi keberhasilan impor:

    gcloud beta network-services agent-gateways list --location=LOCATION --project=PROJECT_ID
    
  2. Mendeskripsikan resource Agent Gateway:

    gcloud beta network-services agent-gateways describe AGENT_GATEWAY_NAME --location=LOCATION --project=PROJECT_ID
    
  3. Salin nama resource Agent Gateway lengkap (diformat sebagai projects/PROJECT_ID/locations/LOCATION/agentGateways/AGENT_GATEWAY_NAME, misalnya, projects/my-project/locations/us-central1/agentGateways/ge-agent-gateway).

Langkah 6: Hubungkan ke Penyedia Identitas Google

  1. Di Konsol Mesin Gen App Builder, buka Setelan lalu Autentikasi.
  2. Hubungkan mesin Anda ke Penyedia Identitas Google.
  3. Untuk dokumentasi tambahan, buka Kontrol Akses Sumber Data Google Cloud.

Langkah 7: Konfigurasi Agent Gateway di instance Gemini Enterprise

  1. Di Instance Gemini Enterprise (GE), buka Connected data stores.
  2. Di bagian MCP servers, pilih Configure Agent Gateway.
  3. Masukkan nama resource Agent Gateway lengkap yang diperoleh di Langkah 5 (misalnya, projects/PROJECT_ID/locations/us-central1/agentGateways/ge-agent-gateway).

Langkah 8: Konfigurasi Kontrol Akses Agen Workspace di konsol Google Admin

Setelah menyiapkan Agent Gateway dan Workspace Policy Decision Point, Anda dapat mengelola kebijakan akses agen langsung dari konsol Google Admin:

  1. Di konsol Google Admin, buka Menu lalu Agen.
  2. Di tab Setelan, konfigurasi kebijakan akses default untuk semua agen Gemini Enterprise. Untuk mengetahui detailnya, buka Mengontrol akses ke agen Gemini Enterprise.
  3. Di tab Pengelolaan agen, tambahkan agen tertentu ke daftar pengelolaan Anda untuk mengonfigurasi izin akses individual (Tepercaya atau Diblokir). Untuk mengetahui detailnya, buka Mengelola agen Gemini Enterprise untuk pengguna Workspace.