agentleFS
Google CloudKnown publisherGoogleCloudPlatform/devrel-demos/ai-ml/dev-signal/.agent/skills/gcp-agent-safety-gatekeeper/SKILL.md

gcp-agent-safety-gatekeeper

Skill404 starsChanged 14 days agoApache-2.0View on GitHub

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

The file

Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.