Men-deploy Secure Web Proxy sebagai Gateway Agen

Halaman ini menjelaskan cara mengonfigurasi dan men-deploy instance Secure Web Proxy sebagai Gateway Agen.

Ringkasan

Workload AI perusahaan yang di-deploy di seluruh Google Cloud memerlukan batas jaringan terstruktur untuk menjaga kepatuhan privasi data, mencegah kebocoran data sensitif, dan melindungi dari ancaman AI yang muncul seperti injeksi perintah.

Agent Gateway menyediakan tata kelola keamanan terpusat, penegakan identitas, dan guardrail konten untuk traffic keluar dari agen AI ke model bahasa besar (LLM), alat Model Context Protocol (MCP), API eksternal, agen jarak jauh, dan tujuan web standar.

Anda dapat men-deploy Gateway Agen yang dikelola Google atau instance Secure Web Proxy sebagai Gateway Agen yang dikelola sendiri. Kedua model deployment menyediakan solusi tata kelola Gemini Enterprise Agent Platform yang umum, termasuk kebijakan akses terpusat, integrasi Agent Registry, dan guardrail konten.

Pilih di antara opsi deployment berikut berdasarkan preferensi operasional Anda:

  • Agent Gateway yang dikelola Google: gunakan opsi ini jika Anda menginginkan pengalaman yang terkelola sepenuhnya dan tanpa pemeliharaan, tanpa perlu mengelola infrastruktur proxy jaringan. Untuk mengetahui informasi selengkapnya, lihat Agent Gateway yang dikelola Google. Model ini dioptimalkan untuk agen yang berjalan di Gemini Enterprise atau Agent Runtime di Gemini Enterprise Agent Platform.

  • Secure Web Proxy sebagai Gateway Agen yang dikelola sendiri: deploy instance Secure Web Proxy sebagai Gateway Agen jika Anda ingin mempertahankan kontrol penuh atas perimeter jaringan VPC, sertifikat CA pribadi, dan perutean proxy untuk mendukung agen yang berjalan di Google Kubernetes Engine (GKE) atau Cloud Run.

Manfaat

Men-deploy Secure Web Proxy sebagai Agent Gateway memberikan manfaat berikut:

  • Infrastruktur yang dikontrol pelanggan: Anda dapat mengelola gateway Secure Web Proxy di jaringan Virtual Private Cloud (VPC) Anda sendiri, sehingga mempertahankan kontrol penuh atas pemilihan rute jaringan, alamat IP, sertifikat CA pribadi, dan pemeriksaan TLS.

  • Penerapan kebijakan AI terpusat: Anda dapat menentukan kebijakan otorisasi pada resource agentGateway. Dengan demikian, Anda dapat langsung menerapkan kebijakan ini di gateway Secure Web Proxy untuk membatasi panggilan alat MCP, memfilter tujuan eksternal agen AI, dan memanggil layanan pembersihan konten seperti Model Armor.

  • Dukungan runtime: Anda dapat merutekan traffic keluar dari agen AI yang dihosting di berbagai runtime, seperti GKE atau Cloud Run, melalui satu perimeter proxy.

  • Kemampuan observasi berbasis agen: log transaksi di Cloud Logging secara otomatis berisi metadata eksekusi agen AI (agentGatewayInfo), termasuk metode MCP, nama alat, dan Uniform Resource Name (URN) tujuan Agent Registry.

Arsitektur

Langkah-langkah berikut menunjukkan cara Secure Web Proxy mengamankan traffic keluar sebagai Gateway Agen:

  1. Agent Runtime: agen otonom yang berjalan di GKE atau Cloud Run memulai koneksi keluar ke API eksternal, penyedia model, server alat MCP, agen jarak jauh, atau tujuan web standar.

  2. Pemilihan rute traffic keluar: traffic agen diarahkan ke Secure Web Proxy menggunakan pemilihan rute proxy dalam VPC atau lampiran layanan Private Service Connect (PSC) lintas VPC.

  3. Evaluasi kebijakan dan sanitasi konten: Secure Web Proxy menghentikan koneksi TLS, menerapkan kebijakan otorisasi MCP, dan memanggil layanan ekstensi seperti Model Armor atau Identity-Aware Proxy (IAP) untuk membersihkan payload dan memverifikasi identitas klien.

Sebelum memulai

Sebelum men-deploy instance Secure Web Proxy sebagai Gateway Agen, selesaikan prasyarat berikut:

  1. Aktifkan API Google Cloud yang diperlukan berikut:

    gcloud services enable \
        networkservices.googleapis.com \
        networksecurity.googleapis.com \
        privateca.googleapis.com \
        certificatemanager.googleapis.com \
        serviceextensions.googleapis.com \
        agentregistry.googleapis.com \
        compute.googleapis.com
    
  2. Pastikan Anda memiliki peran Identity and Access Management (IAM) yang diperlukan berikut:

  3. Konfigurasikan variabel lingkungan berikut untuk deployment Anda:

    export PROJECT_ID="my-project-id"
    export PROJECT_NUMBER="my-project-number"
    export REGION="us-central1"
    export NETWORK_NAME="swp-vpc"
    export PROXY_SUBNET_NAME="swp-proxy-subnet"
    export PSC_NAT_SUBNET_NAME="swp-psc-nat-subnet"
    export CA_POOL_NAME="swp-ca-pool"
    export ROOT_CA_NAME="swp-root-ca"
    export TLS_INSPECTION_POLICY_NAME="swp-tls-inspection-policy"
    export SECURE_WEB_PROXY_NAME="swp-agent-gateway"
    export SWP_IP_ADDRESS="10.129.0.10"
    export SWP_CERTIFICATE_NAME="swp-cert"
    export SERVER_TLS_POLICY_NAME="swp-server-tls-policy"
    export GATEWAY_SECURITY_POLICY_NAME="swp-security-policy"
    export SERVICE_ATTACHMENT_NAME="swp-service-attachment"
    export AGENT_GATEWAY_NAME="my-agent-gateway"
    
  4. Opsional: Jika Agent Runtime Anda beroperasi di jaringan VPC atau lingkungan terkelola yang terpisah, seperti cluster GKE atau Cloud Run lintas project, Anda harus mengekspos Secure Web Proxy melalui lampiran layanan Private Service Connect:

Menyiapkan pemeriksaan TLS

Secure Web Proxy menghentikan koneksi TLS untuk memeriksa header HTTP, mengevaluasi metode MCP, dan membersihkan payload.

Untuk mengonfigurasi pemeriksaan TLS, buat kumpulan Certificate Authority (CA) pribadi, CA root, lalu resource tlsInspectionPolicy dengan melakukan hal berikut:

  1. Membuat kumpulan CA pribadi.

    gcloud privateca pools create CA_POOL_NAME \
        --location=REGION \
        --tier=devops \
        --project=PROJECT_ID
    

    Ganti kode berikut:

    • CA_POOL_NAME: nama kumpulan CA
    • REGION: region tempat kumpulan CA dibuat
    • PROJECT_ID: ID project Google Cloud Anda
  2. Buat CA root di kumpulan CA pribadi.

    gcloud privateca roots create ROOT_CA_NAME \
        --pool=CA_POOL_NAME \
        --location=REGION \
        --subject="CN=Agent Gateway SWP Root CA, O=MyOrganization" \
        --auto-enable \
        --project=PROJECT_ID
    

    Ganti kode berikut:

    • ROOT_CA_NAME: nama root CA
    • CA_POOL_NAME: nama kumpulan CA
    • REGION: region tempat root CA dibuat
    • PROJECT_ID: ID project Google Cloud Anda

    Catatan: Agar workload klien, seperti Cloud Run atau GKE, memercayai sertifikat yang diterbitkan oleh kumpulan CA ini selama pemeriksaan TLS, ekspor sertifikat root CA, lalu tambahkan ke trust store workload Anda. Misalnya, Anda dapat menetapkan variabel lingkungan AGENT_GATEWAY_ROOT_CERTIFICATES.

  3. Memberikan izin kepada akun layanan keamanan jaringan untuk meminta sertifikat.

    gcloud privateca pools add-iam-policy-binding CA_POOL_NAME \
        --location=REGION \
        --member="serviceAccount:service-PROJECT_NUMBER@gcp-sa-networksecurity." \
        --role="roles/privateca.certificateRequester" \
        --project=PROJECT_ID
    
  4. Buat resource tlsInspectionPolicy dalam file bernama tls-inspection-policy.yaml.

    name: projects/PROJECT_ID/locations/REGION/tlsInspectionPolicies/TLS_INSPECTION_POLICY_NAME
    caPool: projects/PROJECT_ID/locations/REGION/caPools/CA_POOL_NAME
    

    Ganti kode berikut:

    • PROJECT_ID: ID project Google Cloud Anda
    • REGION: region tempat TlsInspectionPolicy dibuat
    • TLS_INSPECTION_POLICY_NAME: nama resource TlsInspectionPolicy
    • CA_POOL_NAME: nama kumpulan CA
  5. Untuk mengimpor kebijakan, jalankan perintah gcloud network-security tls-inspection-policies import.

    gcloud network-security tls-inspection-policies import TLS_INSPECTION_POLICY_NAME \
        --source=tls-inspection-policy.yaml \
        --location=REGION \
        --project=PROJECT_ID
    

Men-deploy Secure Web Proxy

Membuat gateway Secure Web Proxy dengan mutual TLS (mTLS) yang dikonfigurasi.

  1. Pastikan jaringan VPC Anda memiliki subnet khusus proxy di region tempat Anda ingin men-deploy gateway.

    gcloud compute networks subnets create PROXY_SUBNET_NAME \
        --purpose=REGIONAL_MANAGED_PROXY \
        --role=ACTIVE \
        --region=REGION \
        --network=NETWORK_NAME \
        --range=10.129.0.0/23
    

    Ganti kode berikut:

    • PROXY_SUBNET_NAME: nama subnet khusus proxy
    • NETWORK_NAME: nama jaringan VPC Anda
    • REGION: region tempat subnet dibuat
  2. Opsional: Pilih alamat IP yang tersedia dari rentang subnet khusus proxy Anda—misalnya, 10.129.0.10 dalam 10.129.0.0/23—untuk ditetapkan ke SWP_IP_ADDRESS Anda.

    Catatan: Jika Anda tidak menambahkan kolom addresses dalam file swp.yaml, Secure Web Proxy akan otomatis mengalokasikan alamat IP dari subnet khusus proxy.

  3. Untuk memastikan gateway Secure Web Proxy Anda dapat menerima koneksi agen klien yang masuk dengan aman, buat sertifikat server SSL/TLS regional di Certificate Manager.

    1. Buat sertifikat dan kunci pribadi yang dikelola sendiri.

      openssl req -x509 -newkey rsa:2048 -nodes \
          -keyout "swp.key" \
          -out "swp.crt" \
          -days 365 \
          -subj "/CN=SWP_IP_ADDRESS"
      

      Ganti SWP_IP_ADDRESS dengan alamat IP gateway Secure Web Proxy Anda.

    2. Untuk mengupload sertifikat ke Certificate Manager, jalankan perintah gcloud certificate-manager certificates create.

      gcloud certificate-manager certificates create SWP_CERTIFICATE_NAME \
          --location=REGION \
          --certificate-file="swp.crt" \
          --private-key-file="swp.key" \
          --project=PROJECT_ID
      

      Ganti kode berikut:

      • SWP_CERTIFICATE_NAME: nama resource sertifikat
      • REGION: region tempat sertifikat dibuat
      • PROJECT_ID: ID project Google Cloud Anda
  4. Untuk mengaktifkan mTLS frontend, buat resource ServerTlsPolicy. Agar workload, seperti Cloud Run, dapat meneruskan sertifikat identitasnya ke layanan seperti IAP, konfigurasikan kebijakan dengan clientValidationMode: ALLOW_INVALID_OR_MISSING_CLIENT_CERT.

    Catatan: Jika Anda menggunakan IAP, jangan tetapkan nilai apa pun untuk kolom clientValidationTrustConfig karena tidak didukung.

    1. Buat file bernama server-tls-policy.yaml, lalu tambahkan konten berikut:

      name: projects/PROJECT_ID/locations/REGION/serverTlsPolicies/SERVER_TLS_POLICY_NAME
      mtlsPolicy:
        clientValidationMode: ALLOW_INVALID_OR_MISSING_CLIENT_CERT
      

      Ganti kode berikut:

      • PROJECT_ID: ID project Google Cloud Anda
      • REGION: region tempat ServerTlsPolicy dibuat
      • SERVER_TLS_POLICY_NAME: nama resource ServerTlsPolicy
    2. Untuk mengimpor kebijakan, jalankan perintah gcloud network-security server-tls-policies import.

      gcloud network-security server-tls-policies import SERVER_TLS_POLICY_NAME \
          --source=server-tls-policy.yaml \
          --location=REGION \
          --project=PROJECT_ID
      
  5. Buat kebijakan keamanan gateway untuk melampirkan tlsInspectionPolicy Anda.

    1. Buat file bernama gateway-security-policy.yaml, lalu tambahkan konten berikut:

      name: projects/PROJECT_ID/locations/REGION/gatewaySecurityPolicies/GATEWAY_SECURITY_POLICY_NAME
      tlsInspectionPolicy: projects/PROJECT_ID/locations/REGION/tlsInspectionPolicies/TLS_INSPECTION_POLICY_NAME
      

      Ganti kode berikut:

      • PROJECT_ID: ID project Google Cloud Anda
      • REGION: region tempat GatewaySecurityPolicy dibuat
      • GATEWAY_SECURITY_POLICY_NAME: nama resource GatewaySecurityPolicy
      • TLS_INSPECTION_POLICY_NAME: nama resource TlsInspectionPolicy
    2. Untuk mengimpor kebijakan, jalankan perintah gcloud network-security gateway-security-policies import.

      gcloud network-security gateway-security-policies import GATEWAY_SECURITY_POLICY_NAME \
          --source=gateway-security-policy.yaml \
          --location=REGION \
          --project=PROJECT_ID
      
  6. Buat file spesifikasi Secure Web Proxy bernama swp.yaml.

    name: projects/PROJECT_ID/locations/REGION/gateways/SECURE_WEB_PROXY_NAME
    type: SECURE_WEB_GATEWAY
    addresses:
      - "SWP_IP_ADDRESS"
    ports:
      - 443
    routingMode: EXPLICIT_ROUTING_MODE
    certificateUrls:
      - projects/PROJECT_ID/locations/REGION/certificates/SWP_CERTIFICATE_NAME
    serverTlsPolicy: projects/PROJECT_ID/locations/REGION/serverTlsPolicies/SERVER_TLS_POLICY_NAME
    network: projects/PROJECT_ID/global/networks/NETWORK_NAME
    subnetwork: projects/PROJECT_ID/regions/REGION/subnetworks/PROXY_SUBNET_NAME
    gatewaySecurityPolicy: projects/PROJECT_ID/locations/REGION/gatewaySecurityPolicies/GATEWAY_SECURITY_POLICY_NAME
    

    Ganti kode berikut:

    • PROJECT_ID: ID project Google Cloud Anda
    • REGION: region tempat gateway Secure Web Proxy Anda dibuat
    • SECURE_WEB_PROXY_NAME: nama gateway Secure Web Proxy Anda
    • SWP_IP_ADDRESS: Alamat IP gateway Secure Web Proxy Anda
    • SWP_CERTIFICATE_NAME: nama sertifikat yang terkait dengan gateway Secure Web Proxy Anda
    • SERVER_TLS_POLICY_NAME: nama resource ServerTlsPolicy
    • NETWORK_NAME: nama jaringan VPC Anda
    • PROXY_SUBNET_NAME: nama subnet khusus proxy
    • GATEWAY_SECURITY_POLICY_NAME: nama resource GatewaySecurityPolicy
  7. Untuk mengimpor gateway Secure Web Proxy, jalankan perintah gcloud network-services gateways import.

    gcloud network-services gateways import SECURE_WEB_PROXY_NAME \
        --source=swp.yaml \
        --location=REGION \
        --project=PROJECT_ID
    

Untuk mengubah kolom ini di gateway Secure Web Proxy yang ada tanpa menyebabkan periode nonaktif workload, lakukan hal berikut:

  1. Buat gateway Secure Web Proxy lain dengan nama baru dan konfigurasi yang diperlukan.

  2. Perbarui resource agentGateway (selfManaged.resourceUris) untuk merujuk ke gateway Secure Web Proxy baru.

  3. Perbarui resource EgressRouting Anda agar mengarah ke gateway Secure Web Proxy yang baru.

  4. Setelah Anda memverifikasi bahwa gateway baru berhasil mengelola rute traffic, hapus gateway Secure Web Proxy lama dari resource agentGateway, lalu hapus resource gateway lama.

Mengaitkan instance Secure Web Proxy Anda dengan Agent Gateway

Untuk mengaitkan instance Secure Web Proxy dengan resource agentGateway, lakukan hal berikut:

  1. Buat file konfigurasi bernama agent-gateway.yaml.

    name: projects/PROJECT_ID/locations/REGION/agentGateways/AGENT_GATEWAY_NAME
    selfManaged:
      resourceUris:
        - //networkservices.googleapis.com/projects/PROJECT_ID/locations/REGION/gateways/SECURE_WEB_PROXY_NAME
    registries:
      - //agentregistry.googleapis.com/projects/PROJECT_ID/locations/REGION
    

    Ganti kode berikut:

    • PROJECT_ID: ID project Google Cloud Anda
    • REGION: region tempat Agent Gateway dibuat
    • AGENT_GATEWAY_NAME: nama Agent Gateway
    • SECURE_WEB_PROXY_NAME: nama instance Secure Web Proxy Anda

    Opsional: Kolom registries mengaitkan Agent Gateway Anda dengan Agent Registry. Jika Anda tidak ingin menggunakan Agent Registry untuk resolusi tujuan atau alat, jangan tentukan kolom registries.

  2. Untuk mengimpor resource agentGateway, jalankan perintah gcloud beta network-services agent-gateways import.

    gcloud beta network-services agent-gateways import AGENT_GATEWAY_NAME \
        --source=agent-gateway.yaml \
        --location=REGION \
        --project=PROJECT_ID
    

Mengonfigurasi binding ekstensi dan kebijakan otorisasi

Untuk mengatur traffic agen AI keluar, konfigurasikan binding ekstensi dan kebijakan otorisasi pada resource agentGateway Anda. Proxy mengabaikan kebijakan apa pun yang langsung dilampirkan ke resource Gateway Secure Web Proxy yang mendasarinya.

Agent Gateway mendukung dua lapisan tata kelola berikut:

  • Binding ekstensi: melampirkan layanan keamanan dan tata kelola eksternal, seperti IAP dan Model Armor, langsung ke Agent Gateway Anda menggunakan Service Extensions.

  • Kebijakan otorisasi: menerapkan batasan metode MCP L7 dan aturan jaringan L4.

Melampirkan binding ekstensi ke Agent Gateway

Gunakan binding ekstensi di Service Extensions untuk mengikat layanan terkelola ke Agent Gateway Anda guna memeriksa, mengautentikasi, dan mengontrol interaksi agen.

Langkah 1: Ikat Identity-Aware Proxy (IAP) ke Agent Gateway Anda

Untuk memverifikasi identitas pemanggil agen dan menerapkan kebijakan akses sebelum traffic mencapai alat target, ikat IAP ke Agent Gateway Anda dengan melakukan hal berikut:

  1. Buat file konfigurasi bernama ext-binding-iap.yaml.

    name: ext-binding-iap
    target:
      resources:
      - "//networkservices.googleapis.com/projects/PROJECT_ID/locations/REGION/agentGateways/AGENT_GATEWAY_NAME"
    failOpen: false
    producerExtension: iap.googleapis.com
    matchConditions:
    - to:
        destination:
          resources:
          - prefix: "urn:mcp"
        notDestinations:
          hosts:
          - suffix: ".googleapis.com"
    

    Ganti kode berikut:

    • PROJECT_ID: ID project Google Cloud Anda
    • REGION: region tempat binding ekstensi dibuat
    • AGENT_GATEWAY_NAME: nama Agent Gateway
  2. Untuk mengimpor binding ekstensi, jalankan perintah gcloud beta service-extensions extension-bindings import.

    gcloud beta service-extensions extension-bindings import ext-binding-iap \
        --source=extension-binding-iap.yaml \
        --location=REGION
    

Untuk mengetahui informasi selengkapnya, lihat Mendelegasikan otorisasi ke IAP.

Langkah 2: Ikat Model Armor untuk sanitasi perintah dan respons

Untuk melindungi dari injeksi perintah, konten beracun, dan kebocoran data sensitif, ikat Model Armor ke Agent Gateway Anda dengan melakukan hal berikut:

  1. Buat file konfigurasi bernama ext-binding-model-armor.yaml.

    name: ext-binding-model-armor
    target:
      resources:
      - "//networkservices.googleapis.com/projects/PROJECT_ID/locations/REGION/agentGateways/AGENT_GATEWAY_NAME"
    failOpen: false
    producerExtension: modelarmor.googleapis.com
    producerMetadata:
      model_armor_settings: '[
        {
          "request_template_id": "projects/PROJECT_ID/locations/REGION/templates/REQUEST_TEMPLATE_ID",
          "response_template_id": "projects/PROJECT_ID/locations/REGION/templates/RESPONSE_TEMPLATE_ID"
        }
      ]'
    matchConditions:
    - to:
        destination:
          resources:
          - prefix: "urn:mcp"
    

    Ganti kode berikut:

    • PROJECT_ID: ID project Google Cloud Anda
    • REGION: region tempat binding ekstensi dibuat
    • AGENT_GATEWAY_NAME: nama Agent Gateway
    • REQUEST_TEMPLATE_ID: ID template permintaan Model Armor
    • RESPONSE_TEMPLATE_ID: ID template respons Model Armor
  2. Untuk mengimpor binding ekstensi, jalankan perintah gcloud beta service-extensions extension-bindings import.

    gcloud beta service-extensions extension-bindings import ext-binding-model-armor \
        --source=extension-binding-model-armor.yaml \
        --location=REGION
    

Untuk mengetahui informasi selengkapnya, lihat Mendelegasikan otorisasi ke Model Armor dan Contoh 3: Mengaktifkan deep payload inspection dengan Model Armor menggunakan binding ekstensi di Menyiapkan kebijakan otorisasi untuk Secure Web Proxy.

Membatasi alat MCP menggunakan kebijakan otorisasi

Untuk membatasi penemuan dan eksekusi alat agen ke alat yang disetujui, buat dan impor kebijakan otorisasi dengan melakukan hal berikut:

  1. Buat file konfigurasi bernama authz-policy-restrict-mcp-tools.yaml.

    name: authz-policy-restrict-mcp-tools
    target:
      resources:
      - "projects/PROJECT_ID/locations/REGION/agentGateways/AGENT_GATEWAY_NAME"
    policyProfile: REQUEST_AUTHZ
    httpRules:
    - to:
        operations:
        - mcp:
            baseProtocolMethodsOption: MATCH_BASE_PROTOCOL_METHODS
            methods:
            - name: "tools/list"
            - name: "tools/call"
              params:
              - exact: "get_weather"
              - exact: "get_location"
    action: ALLOW
    

    Ganti kode berikut:

    • PROJECT_ID: ID project Google Cloud Anda
    • REGION: region tempat kebijakan otorisasi dibuat
    • AGENT_GATEWAY_NAME: nama Agent Gateway
  2. Untuk mengimpor kebijakan otorisasi, jalankan perintah gcloud network-security authz-policies import.

    gcloud network-security authz-policies import authz-policy-restrict-mcp-tools \
        --source=authz-policy-restrict-mcp-tools.yaml \
        --location=REGION \
        --project=PROJECT_ID
    

Merutekan agen melalui Agent Gateway

Setelah mengonfigurasi Agent Gateway dan melampirkan kebijakan otorisasi ke gateway tersebut, Anda harus mengonfigurasi lingkungan runtime agen untuk mengarahkan traffic keluar ke instance Secure Web Proxy Anda. Perutean traffic keluar beroperasi secara transparan di lapisan jaringan, mengalihkan permintaan ke gateway tanpa mengubah kode aplikasi agen Anda.

Bergantung pada tempat workload AI Anda berjalan, lihat aset dokumentasi berikut untuk mengonfigurasi pemilihan rute keluar:

  • GKE: menggunakan jaringan ambient Cloud Service Mesh untuk mengintersepsi traffic agen keluar di level node, lalu meneruskannya melalui tunnel CONNECT HTTP ke instance Secure Web Proxy Anda. Untuk mengonfigurasi kebijakan perutean di cluster Anda, lihat Merutekan traffic keluar ambien melalui Secure Web Proxy dan Agent Gateway untuk GKE.
  • Cloud Run: mengonfigurasi traffic keluar VPC Langsung untuk mengirim traffic agen keluar ke jaringan VPC Anda, tempat jaringan ambient Cloud Run mengalihkan permintaan ke instance Secure Web Proxy Anda melalui tunnel HTTP CONNECT yang membawa identitas agen. Untuk menyiapkan perutean traffic keluar, lihat Direct VPC dengan jaringan VPC dan Agent Gateway untuk Cloud Run.

Telemetri, logging, dan pemantauan

Saat gateway Secure Web Proxy Anda dikaitkan dengan resource Gateway Agen, log transaksi akan dikeluarkan di bawah resource yang dimonitor networkservices.googleapis.com/Gateway Secure Web Proxy standar. Logging diaktifkan secara default dengan frekuensi sampling 1.0.

Logging

Entri log di Cloud Logging menggunakan format LoadBalancerLogEntry dan berisi kolom payload keamanan dan agen AI berikut:

  • agentGatewayInfo: berisi metadata tentang transaksi agen:

    • agentRegistryResource: nama resource lengkap Agent Registry target yang cocok, seperti server MCP atau skill
    • destinationUrn: informasi tentang URN tujuan
    • mcpInfo: Detail panggilan JSON-RPC MCP, termasuk metode seperti tools/call atau resources/read, dan nama alat atau URI resource
  • authzPolicyInfo: hasil evaluasi otorisasi (ALLOWED atau DENIED) dan nama kebijakan yang cocok

  • tls: Detail negosiasi TLS dan atribut verifikasi sertifikat klien kriptografis (mTLS), seperti clientCertPresent dan clientCertSha256Fingerprint

Metrik pemantauan

Agent Gateway mengekspor metrik berikut ke Cloud Monitoring:

  • Durasi MCP:

    • gcp.mcp.server.operation.duration: latensi operasi yang dilakukan server alat MCP
    • gcp.mcp.client.operation.duration: durasi pulang pergi end-to-end dari panggilan klien MCP
  • Latensi HTTP:

    • http.server.request.duration: latensi eksekusi untuk permintaan agen masuk yang diproses gateway
    • http.client.request.duration: latensi untuk permintaan keluar dari proxy ke tujuan eksternal
  • Throughput traffic:

    • gcp.server.request.total_size dan gcp.server.response.total_size: ukuran dalam byte permintaan dan respons yang diterima dan dikirim gateway
    • gcp.client.request.total_size dan gcp.client.response.total_size: ukuran dalam byte permintaan dan respons yang dikirim gateway ke tujuan eksternal

Langkah berikutnya