google-cloud-modelarmor
Google Cloud Modelarmor API client library
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 on this page — 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
google-cloud-modelarmor on PyPI
pip
pip install google-cloud-modelarmoruv
uv add google-cloud-modelarmorpoetry
poetry add google-cloud-modelarmorInstalling 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 the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — google-api-core, google-auth, grpcio, proto-plus, protobuf |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,389,663/month — #3,967 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: google_cloud_modelarmor-0.7.1-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
google-cloud-securitycenterPython client library for Google Cloud Security…
permissive · top 15,000 on PyPI
google-cloud-dlpPython client library for Google Cloud's…
permissive · top 1,000 on PyPI
google-cloud-discoveryenginePython client library for Google Cloud…
permissive · top 5,000 on PyPI
google-cloud-automlPython client library for Google Cloud AutoML,…
permissive · top 1,000 on PyPI
google-cloud-appengine-loggingClient library for Google Cloud AppEngine…
permissive · top 1,000 on PyPI
google-cloud-recommendations-aiPython client library for Google Cloud…
permissive · top 5,000 on PyPI
google-cloud-iamProvides a Python client library for Google…
permissive · top 5,000 on PyPI
google-cloud-webriskPython client library for Google Cloud Web…
permissive · top 15,000 on PyPI
grpc-google-iam-v1Provides gRPC-based Python client bindings for…
permissive · top 1,000 on PyPI
google-cloud-access-context-managerPython client library for Google Cloud Access…
permissive · top 5,000 on PyPI