Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
googleworkspace avatar

Gws Modelarmor Sanitize Prompt

  • 23.6k installs
  • 30k repo stars
  • Updated July 22, 2026
  • googleworkspace/cli

gws-modelarmor-sanitize-prompt is a CLI skill that filters user prompts through Model Armor templates.

About

CLI command to filter user prompts through Google Model Armor safety templates before processing by LLM. Developers use this for inbound content safety - preventing prompt injection and malicious user input. Complements sanitize-response for comprehensive LLM safety.

  • Sanitizes user prompts through Model Armor templates
  • Inbound safety filtering for user-generated content
  • Supports stdin, text flag, and JSON request body customization

Gws Modelarmor Sanitize Prompt by the numbers

  • 23,643 all-time installs (skills.sh)
  • +799 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #22 of 2,209 Security skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

gws-modelarmor-sanitize-prompt capabilities & compatibility

Works with
gcp
Use cases
security audit
From the docs

What gws-modelarmor-sanitize-prompt says it does

Sanitize a user prompt through a Model Armor template
SKILL.md
For outbound safety, use +sanitize-response instead
SKILL.md
If neither --text nor --json is given, reads from stdin
SKILL.md
npx skills add https://github.com/googleworkspace/cli --skill gws-modelarmor-sanitize-prompt

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs23.6k
repo stars30k
Security audit3 / 3 scanners passed
Last updatedJuly 22, 2026
Repositorygoogleworkspace/cli

How do you sanitize prompts before LLM inference?

Filter user prompts through Model Armor to prevent injection attacks before processing.

Who is it for?

Preventing prompt injection and filtering user input before LLM processing

Skip if: Output filtering after generation or teams still needing to create a Model Armor template first.

When should I use this skill?

Need to validate/filter user-generated prompts against jailbreak attempts

What you get

A Model Armor-sanitized prompt cleared or flagged by the configured safety template.

  • Filtered/sanitized prompt text
  • Safety validation result

By the numbers

  • Metadata version 0.22.5 in googleworkspace/cli
  • Documents gws modelarmor +sanitize-prompt with required --template flag

Files

SKILL.mdMarkdownGitHub ↗

modelarmor +sanitize-prompt

PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.

Sanitize a user prompt through a Model Armor template

Usage

gws modelarmor +sanitize-prompt --template <NAME>

Flags

FlagRequiredDefaultDescription
--templateFull template resource name (projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
--textText content to sanitize
--jsonFull JSON request body (overrides --text)

Examples

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

Tips

  • If neither --text nor --json is given, reads from stdin.
  • For outbound safety, use +sanitize-response instead.

See Also

  • gws-shared — Global flags and auth
  • gws-modelarmor — All filter user-generated content for safety commands

Related skills

How it compares

Use gws-modelarmor-sanitize-prompt for inbound prompt checks; use gws-modelarmor sanitize-response helpers for post-generation output filtering.

FAQ

What happens to unsafe prompts?

Model Armor returns a filtered version or rejection - implementation depends on template configuration.

Can I use stdin?

Yes - if neither --text nor --json is provided, the command reads from stdin (e.g., `echo prompt | gws modelarmor +sanitize-prompt ...`)

Securityappsec

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.