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- 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
How to use gws-modelarmor-sanitize-prompt
- 1.Install the skill via npx skills add null --skill gws-modelarmor-sanitize-prompt
- 2.Authenticate with Google Workspace using gws auth
- 3.Identify your Model Armor template resource name (projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
- 4.Call the skill with --template flag and your prompt text via --text flag, stdin, or --json
- 5.Process the returned sanitized prompt for downstream use
Use cases
- 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
- 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
+sanitize-prompt filters user-provided input before processing, while +sanitize-response filters model-generated output. Use +sanitize-prompt for inbound safety.
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.
Use the full resource name format: projects/PROJECT/locations/LOCATION/templates/TEMPLATE. This identifies the specific Model Armor template to apply.
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.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Sanitize a user prompt through a Model Armor template
Usage
gws modelarmor +sanitize-prompt --template <NAME>
Flags
| Flag | Required | Default | Description |
|---|---|---|---|
--template | ✓ | — | Full template resource name (projects/PROJECT/locations/LOCATION/templates/TEMPLATE) |
--text | — | — | Text content to sanitize |
--json | — | — | Full 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
More from googleworkspace/cli and the wider catalog.
gws-gmail
Send, read, and manage Gmail emails via Google Workspace CLI.
gws-drive
Manage Google Drive files, folders, and shared drives via CLI.
gws-docs
Read and write Google Docs via command line.
gws-calendar
Manage Google Calendar events, calendars, and access control via CLI.
gws-sheets
Read and write Google Sheets spreadsheets via CLI.
gws-gmail-send
Send emails via Gmail with attachments, CC/BCC, HTML support, and draft options.