# GCP Agent Safety Gatekeeper

> Implements the "Defense-in-Depth" integration pattern in Python (intercepting prompts, parsing filter results).

- Skill: `googlecloudplatform/gcp-agent-safety-gatekeeper` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add googlecloudplatform/gcp-agent-safety-gatekeeper`
- Raw SKILL.md: https://api.skillmd.com/api/skills/googlecloudplatform/gcp-agent-safety-gatekeeper/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: GoogleCloudPlatform (https://skillmd.com/u/googlecloudplatform)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/googlecloudplatform/gcp-agent-safety-gatekeeper

---


# gcp-agent-safety-gatekeeper

This skill implements the Python integration layer for Model Armor. Grounded in `security_blog.md`, it provides the `safety_util` functions needed to intercept prompts, sanitize them against your security policy, and handle safety triggers in your FastAPI backend.

## Usage

Ask Antigravity to:
- "Add a safety gatekeeper to my agent backend"
- "Implement Model Armor prompt sanitization in Python"
- "Create a safety utility to parse Model Armor findings"
- "Handle prompt injection errors in my FastAPI app"

## Integration Pattern

1. **Client Initialization**: Configures the `ModelArmorClient` with the correct regional endpoint.
2. **`safety_util.py`**: A robust parser that converts `SanitizeUserPromptResponse` into a list of human-readable security triggers (e.g., "Prompt Injection", "PII: Person names").
3. **Application Interception**: Logic to block or sanitize prompts before they reach the GenAI model or agent orchestrator.

## Boilerplate Implementation

Refer to `scripts/safety_util.py` for the core parsing logic.

