Einbindung von Model Armor in Google Cloud-Dienste
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Model Armor lässt sich in verschiedene Google Cloud -Dienste einbinden:
Google Kubernetes Engine (GKE) und Dienst-Extensions
Vertex AI
GKE und Diensterweiterungen
Model Armor kann über Dienst-Erweiterungen in GKE eingebunden werden. Mit Dienst-Erweiterungen können Sie interne (Google Cloud -Dienste) oder externe (nutzerverwaltete) Dienste einbinden, um Traffic zu verarbeiten. Sie können eine Dienst-Extension für Application Load Balancer, einschließlich GKE-Inferenz-Gateways, konfigurieren, um den Traffic zu und von einem GKE-Cluster zu filtern. So wird überprüft, ob alle Interaktionen mit den KI-Modellen durch Model Armor geschützt sind. Weitere Informationen finden Sie unter Integration in GKE.
Vertex AI
Model Armor kann entweder über Floor-Einstellungen oder Vorlagen direkt in Vertex AI integriert werden.
Bei dieser Integration werden Anfragen und Antworten von Gemini-Modellen überprüft und Anfragen und Antworten, die gegen die Mindesteinstellungen verstoßen, werden blockiert. Diese Integration bietet Schutz für Prompts und Antworten in der Gemini API in Vertex AI für die Methode generateContent. Sie müssen Cloud Logging aktivieren, um die Ergebnisse der Bereinigung von Prompts und Antworten zu sehen. Weitere Informationen finden Sie unter Integration mit Vertex AI.
Hinweise
APIs aktivieren
Sie müssen die Model Armor APIs aktivieren, bevor Sie Model Armor verwenden können.
Console
Enable the Model Armor API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM
role (roles/serviceusage.serviceUsageAdmin), which
contains the serviceusage.services.enable permission. Learn how to grant
roles.
At the bottom of the Google Cloud console, a
Cloud Shell
session starts and displays a command-line prompt. Cloud Shell is a shell environment
with the Google Cloud CLI
already installed and with values already set for
your current project. It can take a few seconds for the session to initialize.
Führen Sie den folgenden Befehl aus, um den API-Endpunkt für den Model Armor-Dienst festzulegen.
Bei der REST API-Integrationsoption fungiert Model Armor nur als Detector, der Vorlagen verwendet. Das bedeutet, dass potenzielle Richtlinienverstöße hauptsächlich anhand vordefinierter Vorlagen erkannt und gemeldet werden, anstatt aktiv verhindert zu werden.
Mit der Vertex AI-Integrationsoption bietet Model Armor eine Inline-Durchsetzung mithilfe von Untergrenzeneinstellungen oder Vorlagen. Das bedeutet, dass Model Armor Richtlinien aktiv durchsetzt, indem es direkt in den Prozess eingreift, ohne dass Änderungen an Ihrem Anwendungscode erforderlich sind.
Ähnlich wie bei Vertex AI bietet die GKE-Einbindungsoption auch nur die Inline-Durchsetzung mithilfe von Vorlagen. Das bedeutet, dass Model Armor Richtlinien direkt im Inference-Gateway erzwingen kann, ohne dass Änderungen an Ihrem Anwendungscode erforderlich sind.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-10 (UTC)."],[],[],null,["# Model Armor integration with Google Cloud services\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nModel Armor integrates with various Google Cloud services:\n\n- Google Kubernetes Engine (GKE) and Service Extensions\n- Vertex AI\n\nGKE and Service Extensions\n--------------------------\n\nModel Armor can be integrated with GKE through\nService Extensions. Service Extensions allow you to integrate\ninternal (Google Cloud services) or external (user-managed) services to process\ntraffic. You can configure a service extension on application load balancers,\nincluding GKE inference gateways, to screen traffic to and from a\nGKE cluster. This verifies that all interactions with the AI models\nare protected by Model Armor. For more information, see\n[Integration with GKE](/security-command-center/docs/model-armor-gke-integration).\n\nVertex AI\n---------\n\nModel Armor can be directly integrated into Vertex AI using either\n[floor settings](/security-command-center/docs/model-armor-vertex-integration#configure-floor-settings) or\n[templates](/security-command-center/docs/model-armor-vertex-integration#configure-templates).\nThis integration screens Gemini model requests and responses, blocking\nthose that violate floor settings. This integration provides prompt and response\nprotection within Gemini API in Vertex AI for the\n`generateContent` method. You need to enable Cloud Logging to get visibility\ninto the sanitization results of prompts and responses. For more information, see\n[Integration with Vertex AI](/security-command-center/docs/model-armor-vertex-integration).\n\nBefore you begin\n----------------\n\n### Enable APIs\n\nYou must enable Model Armor APIs before you can use Model Armor. \n\n### Console\n\n1.\n\n\n Enable the Model Armor API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=modelarmor.googleapis.com)\n\n \u003cbr /\u003e\n\n2. Select the project where you want to activate Model Armor.\n\n### gcloud\n\nBefore you begin, follow these steps using the Google Cloud CLI with the\nModel Armor API:\n\n1.\n\n\n In the Google Cloud console, activate Cloud Shell.\n\n [Activate Cloud Shell](https://console.cloud.google.com/?cloudshell=true)\n\n\n At the bottom of the Google Cloud console, a\n [Cloud Shell](/shell/docs/how-cloud-shell-works)\n session starts and displays a command-line prompt. Cloud Shell is a shell environment\n with the Google Cloud CLI\n already installed and with values already set for\n your current project. It can take a few seconds for the session to initialize.\n\n \u003cbr /\u003e\n\n2. Run the following command to set the API endpoint for the\n Model Armor service.\n\n ```bash\n gcloud config set api_endpoint_overrides/modelarmor \"https://modelarmor.\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e.rep.googleapis.com/\"\n ```\n\n Replace \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e with the region where you want to use Model Armor.\n\nRun the following command to enable Model Armor.\n\n\u003cbr /\u003e\n\n```bash\n gcloud services enable modelarmor.googleapis.com --project=PROJECT_ID\n \n```\n\n\u003cbr /\u003e\n\nReplace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of the project.\n\nOptions when integrating Model Armor\n------------------------------------\n\nModel Armor offers the following integration options. Each option provides different\nfeatures and capabilities.\n\nFor the REST API integration option, Model Armor functions as a detector\nonly using templates. This means it primarily identifies and reports potential\npolicy violations based on predefined templates, rather than actively preventing\nthem.\n\nWith the Vertex AI integration option, Model Armor provides\ninline enforcement using floor settings or templates. This means\nModel Armor actively enforces policies by intervening directly\nin the process without requiring modifications to your application code.\n\nSimilar to Vertex AI, the GKE integration option also\noffers inline enforcement only using templates. This indicates that\nModel Armor can enforce policies directly within the inference gateway\nwithout requiring modifications to your application code."]]