--- id: google-cloud-modelarmor version: "0.7.1" license: Apache-2.0 license_treatment: permissive maintenance: active --- # google-cloud-modelarmor — Google Cloud Modelarmor API client library License: permissive · Maintenance: active · Downloads: 1.4M/mo ## What it is and what it does Google Cloud Model Armor is a Python client library for Google Cloud's Model Armor service, which helps protect generative AI applications from security risks. It lets you define policies that filter user prompts before they reach a model and filter model responses before they reach users, helping prevent prompt injection attacks, harmful content generation, and unintended data leakage. The library wraps Google Cloud's gRPC API and depends on standard Google Cloud authentication and transport libraries (google-auth, grpcio, proto-plus, protobuf). It's maintained as part of the googleapis/google-cloud-python monorepo and supports current Python versions (3.10 through 3.14). Setup requires a Google Cloud project with Model Armor enabled and proper authentication configured. Use it for: - Protect chatbot or LLM applications from prompt injection attacks by filtering user inputs before model processing - Enforce content policies by filtering model outputs to prevent generation of harmful, inappropriate, or sensitive information - Prevent accidental data leakage by defining policies that detect and block responses containing regulated or confidential data - Centralize security policy management across multiple generative AI applications using Google Cloud infrastructure ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python client for Google Cloud Model Armor, enabling you to define and enforce policies that filter user prompts and model responses to protect generative AI applications against prompt injection, harmful content, and data leakage. Yes, if you are building generative AI applications on Google Cloud and need policy-based prompt/response filtering. The library is actively maintained, has low install friction, and carries a permissive license. Requires Python 3.10+, Google Cloud project setup, and authentication configuration; not suitable for non-Google-Cloud deployments. ## Install pip install google-cloud-modelarmor uv add google-cloud-modelarmor poetry add google-cloud-modelarmor ## Installing google-cloud-modelarmor Before you install: Low friction installation with a pure-Python wheel. Active maintenance with recent releases; last commit 2026-08-14. Requires Python 3.10 or later and standard Google Cloud authentication setup. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes. Quickstart: pip install google-cloud-modelarmor from google.cloud import modelarmor_v1 client = modelarmor_v1.ModelArmorClient() Requires Python >= 3.10. Requires Google Cloud project setup, billing enabled, Model Armor service enabled, and authentication credentials configured (see google-auth documentation). Verify before relying: - Specific policy definition syntax and filtering capabilities beyond prompt/response filtering - Performance characteristics and latency for real-time filtering in production workloads - Integration patterns with popular generative AI frameworks and model providers ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags prompt injection protection, generative ai security, model response filtering, harmful content detection, google cloud modelarmor client, ai safety policies, data leakage prevention, generative-ai-security, google-cloud, prompt-injection [View on SkillFed](https://skillfed.io/packages/google-cloud-modelarmor) · [View on PyPI](https://pypi.org/project/google-cloud-modelarmor/)