Skip to content

Guide · Agent skill

How to use the Model Armor Response Sanitizer agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Model Armor Response Sanitizer is an agent skill that teaches an AI agent to send model-generated text to Google Cloud's Model Armor service, which checks it against a safety template you name. It is aimed at developers building chatbots or AI features on Google Cloud who want an output safety check before an answer reaches a person. After this guide you will know what the skill does, how to install it, how to ask an agent to use it, and what you need in place for it to work.

Model Armor Response Sanitizergoogleworkspace/cli · Apache-2.0

Quick start

  1. 1Check prerequisites. Confirm the gws tool, a Google Cloud project with Model Armor enabled, and a configured template are in place. Set up Google authentication as described in the gws-shared skill.
  2. 2Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or your project's .claude/skills/ folder.
  3. 3Or upload it in the Claude apps. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload the skill.
  4. 4Test the command. Run gws modelarmor +sanitize-response with your full template name and a sample --text value to confirm the setup works.
  5. 5Ask the agent in plain language. Describe the task, such as checking a chatbot reply against your template before showing it to a user, and include the template name.
  6. 6Review the result. Read the result the tool reports and apply your own handling for flagged or failed checks.

What is an agent skill, and what does this one do?

An agent skill is a folder of instructions and command examples that an AI agent reads when a task matches the skill's description. This skill is defined in a single SKILL.md file. It tells the agent how to use the gws command-line tool to run a piece of model output through Google Cloud's Model Armor service with a template you specify.

The skill adds no logic of its own. It is a set of instructions and command examples that call the gws tool. 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.

  • Direction: outbound, from the model to the user.
  • Input: a template resource name plus the text to check, or a full JSON request body.
  • Output: the result reported by Model Armor through the gws tool.
  • For checking user input before it reaches a model, the SKILL.md points to a different skill, +sanitize-prompt.

What you need before you install

The skill will fail without these pieces in place. Set them up first.

The skill also expects the gws-shared skill for authentication, global flags and security rules. The SKILL.md says that if that file is missing, you should run gws generate-skills to create it.

  • The gws command-line tool (Google Workspace CLI) installed and available on your path.
  • A Google Cloud project with Model Armor enabled.
  • A configured Model Armor template in that project.
  • Google authentication set up as described in the gws-shared skill.

Install the skill from a ZIP file

Download the ZIP for this skill from this page and unzip it. Put the resulting folder in one of two places, depending on how you want to use it.

For a personal setup available to all your projects, place it in your user skills folder. For a single project, place it in that project's .claude/skills/ folder so it travels with the code.

  • Personal: unzip into ~/.claude/skills/
  • Project only: unzip into .claude/skills/ inside your project folder
  • Claude apps: open Settings, go to Capabilities, then Skills, and upload the skill there
~/.claude/skills/gws-modelarmor-sanitize-response/SKILL.md

How to ask the agent to use it

You do not need a special command to trigger the skill. Describe the task in plain language that matches what the skill does: checking a model's answer with a Model Armor template before showing it to a user. The agent should load the skill when the request fits its description.

If the agent does not pick it up, name the skill or the tool directly in your request, for example 'use the gws modelarmor sanitize-response skill'. Include the template resource name so the agent does not have to guess it.

  • "Check this model answer against my Model Armor template before I show it to the user."
  • "Run this chatbot reply through projects/my-project/locations/us-central1/templates/my-template using gws."
  • "Pipe the output of my generation script through Model Armor and tell me the result."

Run the command yourself

The skill is built around one command. You can run it directly to test your setup before asking an agent to use it. The --template flag is required and takes the full resource name in the form projects/PROJECT/locations/LOCATION/templates/TEMPLATE.

Use --text for a short string. Use --json to pass a full JSON request body, which overrides --text. You can also pipe output from another program into the command.

  • --template (required): full template resource name.
  • --text: text content to sanitize.
  • --json: full JSON request body; overrides --text.
  • Run gws modelarmor +sanitize-response --help for the current flag list on your installed version.
gws modelarmor +sanitize-response --template projects/P/locations/L/templates/T --text 'model output'

Safety notes: scripts and network access

This skill runs scripts and uses the network. Its job is to send your text to Google Cloud's Model Armor service, so the text you check leaves your machine. Only use it with text you are allowed to send to that service, and check your organisation's data rules first.

The skill is a filter, not a guarantee. It passes text to the filter and reports the result, and the filter itself can miss content. Do not rely on it alone for high-stakes safety decisions, and keep your own review and fallback handling in your application.

  • Scripts: yes. Network: yes.
  • Text you check is sent to Google Cloud Model Armor.
  • A pass result does not prove the output is safe.
  • Read the gws-shared skill for authentication and security rules before use.

Tips for getting reliable results

Use this skill on the output side of your pipeline. If you also need to screen what users type, add the +sanitize-prompt skill for that direction. Keep the template name exact, since a wrong resource name is a common cause of failure.

The gws-modelarmor skill lists the other Model Armor commands that filter user-generated content, which is useful if you need more than this one step.

  • Use +sanitize-response for model to user checks.
  • Use +sanitize-prompt for user to model checks.
  • Double-check the template path, including project, location and template name.
  • Use --json when you need to send a full request body rather than plain text.

What people use it for

  • Screening a chatbot's reply before it is shown to a customer.
  • Piping a batch of generated text through a template in a script and reviewing the flagged items.
  • Adding an output safety check to an AI feature that already runs on Google Cloud.
  • Testing a Model Armor template against sample model outputs during development.

Frequently asked questions

Is the Model Armor Response Sanitizer skill free?

The skill is licensed under Apache-2.0, as listed on this page. Model Armor is a Google Cloud service, so using it depends on your Google Cloud project and its terms, which this skill does not change.

How do I install the gws-modelarmor-sanitize-response skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. You can also upload it in the Claude apps under Settings, then Capabilities, then Skills.

What do I need before the skill will work?

You need the gws command-line tool, a Google Cloud project with Model Armor enabled, a configured Model Armor template, and Google authentication set up as described in the gws-shared skill. Without these, the command will fail.

What is the difference between sanitize-response and sanitize-prompt?

Sanitize-response checks model output before it reaches a user. Sanitize-prompt checks user input before it reaches a model. This skill covers the first direction only.

Does this skill guarantee that model output is safe?

No. The skill sends text to the filter and reports the result, but the filter can miss content. Keep your own review and fallback handling in place for anything high-stakes.

Why does the command fail with a template error?

The most common cause is a wrong template resource name. Use the full form projects/PROJECT/locations/LOCATION/templates/TEMPLATE and confirm the template exists in that project.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Choose this skill if you build chatbots or AI features on Google Cloud, already use Model Armor templates and the gws tool, and want a scriptable output check. Pick something else if you need to filter user input, if you lack a Google Cloud project and template, or if you need a guarantee of safety, since this skill only passes text to a filter that can miss content.

Download the skill