Skip to content

Model Armor Prompt Sanitizer

Screen user prompts through a Google Model Armor template before sending them to a model.

Stars
32,059
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an agent to run the gws command-line tool so that a user's text is checked against a Google Cloud Model Armor template, a service that screens content for safety issues such as prompt injection or harmful material. The agent can pass text directly, a full JSON request, or piped stdin, and receives the sanitization result. It is aimed at checking inbound user input before an AI model processes it.

Great for

  • Developers building AI apps on Google Cloud who want to screen user prompts before they reach a model
  • Security or platform teams adding a safety check step to an existing Model Armor setup
  • Agents that need to verify user input against a configured Model Armor template

Skip it if

  • Checking the model's outgoing responses; the skill's own tips say to use +sanitize-response for that direction
  • Setups without a Google Cloud project and an existing Model Armor template, since the required --template resource name cannot be supplied
  • Treating it as a complete safety guarantee; it only applies the filters configured in the chosen template

Try asking

  • “Sanitize this user prompt against my Model Armor template projects/my-proj/locations/us-central1/templates/strict before I send it to the model”
  • “Run this incoming chat message through Model Armor and tell me whether it was flagged”
  • “Pipe this support ticket text through my prompt sanitization template and report the result”
Step-by-step guide: how to use Model Armor Prompt SanitizerInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.

    gws-modelarmor-sanitize-prompt.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip gws-modelarmor-sanitize-prompt.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip gws-modelarmor-sanitize-prompt.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Provide the full template resource name in the form projects/PROJECT/locations/LOCATION/templates/TEMPLATE.
  • Use --json for a full request body when you need settings beyond plain text; it overrides --text.
  • Run gws generate-skills first if the shared gws-shared skill file is missing.

What's inside

  • SKILL.md

Redistributed unmodified from googleworkspace/cli under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.