
The gws-modelarmor-sanitize-prompt skill sanitizes user-generated prompts through Google Model Armor templates to detect and filter potentially unsafe content before it reaches AI models. It's designed for Google Workspace CLI users who need to implement inbound safety measures for user inputs, supporting both direct text input and stdin piping. The skill solves the problem of identifying and mitigating prompt injection attacks and harmful content in user submissions by leveraging pre-configured Model Armor templates.
$ npx -y skills add googleworkspace/cli --skill gws-modelarmor-sanitize-prompt --agent claude-codeInstalls into .claude/skills of the current project.
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
gws modelarmor +sanitize-prompt --template <NAME>
| 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) |
gws modelarmor +sanitize-prompt --template projects/P/locations/L/templates/T --text 'user input'
echo 'prompt' | gws modelarmor +sanitize-prompt --template ...
Sponsors