Back to Skills

gws-modelarmor-sanitize-prompt

Google Model Armor: Sanitize a user prompt through a Model Armor template.

24,995stars1,274forksUpdated 4/19/2026

Security Assessment

Safe(100/100)
Security Score100/100

About gws-modelarmor-sanitize-prompt

The gws-modelarmor-sanitize-prompt skill is designed to help sanitize user prompts through a Model Armor template, ensuring that input is cleaned and made safe before further processing. This is especially valuable in contexts where user-generated content may pose security risks or violate predefined guidelines. By using a Model Armor template, this skill filters the text or JSON input and applies rules that protect against harmful or unwanted content, such as potentially malicious code or inappropriate language.

FAQ

How do I use the gws-modelarmor-sanitize-prompt skill?

To use the skill, execute the following command: `gws modelarmor +sanitize-prompt --template <NAME>`, where `<NAME>` is the full template resource name. You can also use the `--text` or `--json` flags to provide input directly.

Can I provide input through stdin?

Yes, if neither the `--text` nor the `--json` flag is provided, the skill will read the input from stdin.

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

The `--text` flag allows you to provide plain text for sanitization, while `--json` accepts a full JSON request body, which will override the `--text` input if both are given.

What are the prerequisites for using this skill?

Before using this skill, make sure to read the `../gws-shared/SKILL.md` for authentication, global flags, and security rules. If the file is missing, run `gws generate-skills` to create it.

What should I use for outbound safety instead of this skill?

For outbound safety, use the `+sanitize-response` command instead.

Install gws-modelarmor-sanitize-prompt

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill