Skip to content

Model Armor Response Sanitizer

Screen an AI model's output through a Google Model Armor safety template before showing it to users.

Stars
32,059
Licence
Apache-2.0
Files
1 file

What it does

This skill teaches an agent to use the gws command-line tool to send a piece of model-generated text to Google Cloud's Model Armor service, which checks it against a safety template you specify. It is meant for the step where an AI's answer is about to reach an end user, so problematic content can be caught first. The skill itself is a set of instructions and command examples; it does not add new logic beyond calling the tool.

Great for

  • Developers building chatbots or AI features on Google Cloud who want an output safety check
  • Teams already using Google Model Armor templates and the gws CLI
  • Engineers who need a scriptable way to pipe model output through a filter

Skip it if

  • Filtering user input before it reaches a model; the SKILL.md points to +sanitize-prompt for that direction
  • Anyone without a Google Cloud project, a Model Armor template, and the gws tool set up, since the command will fail without them
  • Situations needing a guarantee of safety: the skill only passes text to a filter and reports the result, and the filter itself can miss content

Try asking

  • “Check this model response against our Model Armor template before showing it to the customer: <text>”
  • “Run the output of my summarizer through projects/my-project/locations/us-central1/templates/safe-output”
  • “Pipe the generated answer through gws modelarmor sanitize-response and tell me whether it was flagged”
Step-by-step guide: how to use Model Armor Response 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-response.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

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

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip gws-modelarmor-sanitize-response.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, including project and location, as shown in the flags table.
  • Use --json for a full request body when you need more control than --text allows.
  • Pair this with the sanitize-prompt skill to screen both user input and model output.

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.