gws-modelarmor-sanitize-response
googleworkspace/cli
Sanitize model responses through Google Model Armor templates for outbound safety.
What is gws-modelarmor-sanitize-response?
This skill applies Google Model Armor templates to sanitize model-generated responses before sending them to users. Use it when you need to filter or clean model outputs for safety compliance and content policy adherence.
- Applies Model Armor templates to sanitize model responses
- Accepts text input via --text flag or piped stdin
- Supports full JSON request body override with --json flag
- Processes outbound safety filtering (model to user)
- Requires template resource name in projects/PROJECT/locations/LOCATION/templates/TEMPLATE format
How to install gws-modelarmor-sanitize-response
npx skills add null --skill gws-modelarmor-sanitize-response- Google Workspace CLI (gws) installed and configured
- Valid Google Cloud authentication via gws-shared setup
- Access to a Model Armor template in your Google Cloud project
- Template resource name: projects/PROJECT/locations/LOCATION/templates/TEMPLATE
How to use gws-modelarmor-sanitize-response
- 1.Ensure you have a Model Armor template created in your Google Cloud project
- 2.Run the command with your template resource name: gws modelarmor +sanitize-response --template projects/PROJECT/locations/LOCATION/templates/TEMPLATE
- 3.Provide text to sanitize either via --text flag or pipe input from another command
- 4.Review the sanitized output returned by the template
Use cases
- Filter model-generated content before displaying to end users
- Ensure compliance with content policies on model outputs
- Sanitize responses in multi-turn conversations before delivery
- Remove sensitive or harmful content from AI-generated text
- Apply organization-specific safety rules to model responses
- AI application developers
- Content safety engineers
- Teams deploying LLM applications
- Organizations with content moderation requirements
gws-modelarmor-sanitize-response FAQ
sanitize-response filters model outputs (outbound safety, model to user), while sanitize-prompt filters user inputs (inbound safety, user to model).
No, a valid template resource name is required. You must create a template in your Google Cloud project first.
Use the --text flag for direct text input, pipe content from another command, or use --json to provide a full JSON request body.
Use the full format: projects/PROJECT/locations/LOCATION/templates/TEMPLATE where PROJECT, LOCATION, and TEMPLATE are your actual values.
Full instructions (SKILL.md)
Source of truth, from googleworkspace/cli.
name: gws-modelarmor-sanitize-response description: "Google Model Armor: Sanitize a model response through a Model Armor template." metadata: version: 0.22.5 openclaw: category: "security" requires: bins: - gws cliHelp: "gws modelarmor +sanitize-response --help"
modelarmor +sanitize-response
PREREQUISITE: Read
../gws-shared/SKILL.mdfor auth, global flags, and security rules. If missing, rungws generate-skillsto create it.
Sanitize a model response through a Model Armor template
Usage
gws modelarmor +sanitize-response --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-response --template projects/P/locations/L/templates/T --text 'model output'
model_cmd | gws modelarmor +sanitize-response --template ...
Tips
- Use for outbound safety (model -> user).
- For inbound safety (user -> model), use +sanitize-prompt.
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.