Skip to content

Guide · Agent skill

How to use the Model Armor Prompt Sanitizer agent skill

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

The Model Armor Prompt Sanitizer is an agent skill from the googleworkspace/cli project that teaches an AI agent to run the gws command-line tool and check a piece of user text against a Google Cloud Model Armor template. It is meant for screening inbound user input before an AI model processes it. 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 first.

Model Armor Prompt Sanitizergoogleworkspace/cli · Apache-2.0

Quick start

  1. 1Set up Google Cloud and Model Armor. Create or pick a Google Cloud project with Model Armor enabled and make sure you have a configured template. Note its full resource name.
  2. 2Install the gws tool and authentication. Install the gws command-line tool and set up authentication as described in the gws-shared skill. If that file is missing, run gws generate-skills.
  3. 3Download and unzip the skill. Download the ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
  4. 4Ask for a prompt check. Make a natural request that names the text and the full template resource name, such as projects/P/locations/L/templates/T.
  5. 5Read the sanitization result. Have the agent report the result from the sanitize command so you can decide whether to pass the input to your model.

What does the skill make the agent do?

The skill describes one command: gws modelarmor +sanitize-prompt. When the agent uses it, the gws tool sends a user's text to a Google Cloud Model Armor template. Model Armor screens content for safety issues such as prompt injection or harmful material, and the agent receives the sanitization result.

The skill is aimed at checking input before it reaches a model. For checking a model's outgoing responses, the skill's own tips point to a different command, +sanitize-response.

  • Passes text directly with --text, or a full JSON request with --json.
  • Reads from stdin when neither --text nor --json is given.
  • Requires a --template value containing the full resource name in the form projects/PROJECT/locations/LOCATION/templates/TEMPLATE.

What do you need before installing?

The skill lists three requirements. Without a Google Cloud project and an existing Model Armor template, the required --template resource name cannot be supplied, so the skill will not be useful.

The skill also depends on the gws command-line tool (Google Workspace CLI) and on authentication set up according to the gws-shared skill. If that shared skill file is missing, the source says to run gws generate-skills to create it.

  • The gws command-line tool (Google Workspace CLI).
  • A Google Cloud project with Model Armor enabled and a configured template.
  • Authentication set up as described in the gws-shared skill.

How do you install the skill?

Download the ZIP for this skill from this page and unzip it. The skill ships as a single file, SKILL.md. For Claude Code, unzip it into ~/.claude/skills/ to make it available everywhere, or into a project's .claude/skills/ folder to limit it to that project.

In the Claude apps, you can instead upload the skill under Settings → Capabilities → Skills.

  • Personal install: ~/.claude/skills/
  • Project install: .claude/skills/ inside your project folder
  • Claude apps: Settings → Capabilities → Skills, then upload

How do you trigger the skill with a natural request?

You do not need to type the command yourself. Ask the agent in plain language to check a prompt against your Model Armor template, and include the template's full resource name so the agent can fill in --template. The skill's description covers sanitizing a user prompt through a Model Armor template, so requests about that task are the ones it is meant to handle.

If you already have the text in a file or pipeline, you can say so and the agent can pipe it in through stdin.

  • "Check this user message against my Model Armor template projects/my-project/locations/us-central1/templates/my-template before we send it to the model."
  • "Screen this prompt for prompt injection using template projects/P/locations/L/templates/T."
  • "Sanitize this text with Model Armor and tell me the result."

Command examples

These are the examples from the skill source. Replace P, L and T with your own project, location and template names. The first passes text directly; the second pipes text in through stdin.

gws modelarmor +sanitize-prompt --template projects/P/locations/L/templates/T --text 'user input' echo 'prompt' | gws modelarmor +sanitize-prompt --template ...

What are the safety notes and limits?

This skill runs scripts and uses the network, because the gws tool calls Google Cloud Model Armor. Review what you are installing, and keep your authentication credentials under the rules described in the gws-shared skill.

The skill is a filter, not a guarantee. It only applies the filters configured in the template you choose, so a template with few filters will catch less. Plan for other safety layers in your application as well.

  • Runs scripts: yes.
  • Uses network: yes.
  • Results depend entirely on the filters configured in your Model Armor template.

Tips for getting good results

Use the skill for inbound user input. The source explicitly says outbound safety should use +sanitize-response instead. For the wider set of Model Armor commands, the related gws-modelarmor skill covers filtering user-generated content.

  • Use --json when you need to send a full request body; the source says it overrides --text.
  • Run gws modelarmor +sanitize-prompt --help to see the current flags for your installed version.
  • Check the gws-shared skill first if authentication errors appear.

What people use it for

  • Screening a user's chat message for prompt injection before an AI model answers it.
  • Adding a Model Armor check step to an existing app or pipeline by piping input through stdin.
  • Letting an agent verify user input against a shared template set up by a security or platform team.
  • Testing what a given Model Armor template flags by sending sample prompts through it.

Frequently asked questions

How do I install the Model Armor Prompt Sanitizer skill?

Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps you can instead upload it under Settings → Capabilities → Skills.

What do I need to use this skill?

You need the gws command-line tool, a Google Cloud project with Model Armor enabled, a configured Model Armor template, and authentication set up per the gws-shared skill. Without a template you cannot supply the required --template value.

Is the Model Armor Prompt Sanitizer free?

The source material for this skill is licensed under Apache-2.0. It does not state pricing for Google Cloud or Model Armor, so check Google Cloud's own pricing for the service.

Can this skill check the model's responses?

No. The skill is for screening user prompts before they reach a model. The skill's tips say to use +sanitize-response for outbound safety.

What is the difference between --text and --json?

--text sends the text you provide directly. --json takes a full JSON request body and overrides --text. If neither is given, the command reads from stdin.

Does this skill guarantee my app is safe?

No. It only applies the filters configured in the template you choose, so it is one layer of protection rather than a complete safety guarantee.

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

This skill suits developers and security or platform teams on Google Cloud who already run Model Armor and want an agent to screen user input against a configured template. Skip it if you have no Google Cloud project or template, if you need to check model outputs (use +sanitize-response instead), or if you expect it to be a complete safety solution on its own.

Download the skill

Find exactly what
you're looking for