PluginBench
Skill
Pass
Audit score 90

gws-modelarmor-sanitize-prompt

googleworkspace/cli

Sanitize user prompts through Google Model Armor templates for safety compliance.

What is gws-modelarmor-sanitize-prompt?

This skill applies Google Model Armor templates to sanitize user-provided prompts before processing. Use it when you need to filter incoming text for safety, policy compliance, or content moderation in AI workflows.

  • Applies Model Armor safety templates to user prompts
  • Accepts text input via flag, stdin, or JSON request body
  • Returns sanitized prompt output for downstream processing
  • Supports full template resource names for fine-grained control
  • Integrates with Google Workspace CLI authentication

How to install gws-modelarmor-sanitize-prompt

npx skills add null --skill gws-modelarmor-sanitize-prompt
Prerequisites
  • Google Workspace CLI (gws) installed and configured
  • Valid Google Cloud authentication via gws
  • Access to a deployed Model Armor template with resource name
  • Read gws-shared/SKILL.md for auth and global flags
Claude Code
Cursor
Windsurf
Cline

How to use gws-modelarmor-sanitize-prompt

  1. 1.Install the skill via npx skills add null --skill gws-modelarmor-sanitize-prompt
  2. 2.Authenticate with Google Workspace using gws auth
  3. 3.Identify your Model Armor template resource name (projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
  4. 4.Call the skill with --template flag and your prompt text via --text flag, stdin, or --json
  5. 5.Process the returned sanitized prompt for downstream use

Use cases

Good for
  • Filter user input before sending to language models to prevent unsafe content
  • Enforce content policies on customer-submitted prompts in production systems
  • Sanitize chatbot inputs to comply with safety guidelines
  • Pre-process user queries in multi-turn conversations for consistency
  • Validate prompt content against organization-specific Model Armor templates
Who it's for
  • Security engineers implementing content moderation
  • AI/ML engineers building safe prompt pipelines
  • Platform teams managing user-generated content
  • Compliance officers enforcing safety policies
  • Developers integrating Google Workspace AI safety tools

gws-modelarmor-sanitize-prompt FAQ

What's the difference between +sanitize-prompt and +sanitize-response?

+sanitize-prompt filters user-provided input before processing, while +sanitize-response filters model-generated output. Use +sanitize-prompt for inbound safety.

How do I provide the prompt text to sanitize?

You can pass text via --text flag, pipe it through stdin, or provide a full JSON request body with --json. If none are specified, the skill reads from stdin.

What format should the template resource name be in?

Use the full resource name format: projects/PROJECT/locations/LOCATION/templates/TEMPLATE. This identifies the specific Model Armor template to apply.

Do I need to set up authentication separately?

No, authentication is handled through gws. Ensure you've run gws auth and have access to the template resource in your Google Cloud project.

Full instructions (SKILL.md)

Source of truth, from googleworkspace/cli.


name: gws-modelarmor-sanitize-prompt description: "Google Model Armor: Sanitize a user prompt through a Model Armor template." metadata: version: 0.22.5 openclaw: category: "security" requires: bins: - gws cliHelp: "gws modelarmor +sanitize-prompt --help"

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