skillfed

google-cloud-modelarmor

Google Cloud Modelarmor API client library

google-cloud-modelarmor v0.7.1 1.4M downloads/30d#3,967 on PyPI5,373
Permissive license Apache-2.0 Active released

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-modelarmor

uv

uv add google-cloud-modelarmor

poetry

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 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet

Tags

prompt injection protectiongenerative ai securitymodel response filteringharmful content detectiongoogle cloud modelarmor clientai safety policiesdata leakage prevention
generative-ai-securitygoogle-cloudprompt-injection

More Internet packages

botocore

Botocore provides low-level, data-driven access…

permissive · top 100 on PyPI

aiobotocore

Provides an async client for AWS services using…

permissive · top 100 on PyPI

pydantic

Pydantic validates Python data structures…

permissive · top 100 on PyPI

filelock

Provides a platform-independent file locking…

permissive · top 100 on PyPI

fastapi

FastAPI is a Python web framework for building…

permissive · top 100 on PyPI

googleapis-common-protos

Provides common Protocol Buffer message…

permissive · top 100 on PyPI

google-cloud-securitycenter

Python client library for Google Cloud Security…

permissive · top 15,000 on PyPI

google-cloud-dlp

Python client library for Google Cloud's…

permissive · top 1,000 on PyPI

google-cloud-discoveryengine

Python client library for Google Cloud…

permissive · top 5,000 on PyPI

google-cloud-automl

Python client library for Google Cloud AutoML,…

permissive · top 1,000 on PyPI

google-cloud-appengine-logging

Client library for Google Cloud AppEngine…

permissive · top 1,000 on PyPI

google-cloud-recommendations-ai

Python client library for Google Cloud…

permissive · top 5,000 on PyPI

google-cloud-iam

Provides a Python client library for Google…

permissive · top 5,000 on PyPI

google-cloud-webrisk

Python client library for Google Cloud Web…

permissive · top 15,000 on PyPI

grpc-google-iam-v1

Provides gRPC-based Python client bindings for…

permissive · top 1,000 on PyPI

google-cloud-access-context-manager

Python client library for Google Cloud Access…

permissive · top 5,000 on PyPI

Further reading