Skip to main content
command

gws-modelarmor-sanitize-prompt — Claude Code command: setup and use

Run a user prompt through a Google Model Armor template. Use this command to check text before passing it along in a workflow.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command google-workspace/gws-modelarmor-sanitize-prompt
Open on GitHub

What gws-modelarmor-sanitize-prompt does

The command runs gws modelarmor +sanitize-prompt with a template. Pass prompt text with --text, or provide the full request body with --json. If neither option is set, input comes from stdin. The command description points to +sanitize-response for checking outbound responses.

You need Google Workspace CLI (gws) installed and authentication configured; check the latter with gws auth status. The instructions also require ../gws-shared/SKILL.md for authentication and security rules. If that file is missing, they direct you to create it with gws generate-skills. A full template resource name, such as projects/PROJECT/locations/LOCATION/templates/TEMPLATE, is required to run the check.

What it helps with

  • check a user prompt with a Model Armor template
  • read prompt text from stdin for sanitization
  • submit a full JSON request body instead of text

Example prompts for the agent

  • Check this prompt with the projects/PROJECT/locations/LOCATION/templates/TEMPLATE template.
  • Read the prompt from stdin and run it through the specified template.
  • Send the request body as JSON and run the Model Armor check.

How to install gws-modelarmor-sanitize-prompt

1claude-code-templates

npx claude-code-templates@latest --command google-workspace/gws-modelarmor-sanitize-prompt

2Manually: put the files in place

.claude/commands/gws-modelarmor-sanitize-prompt.md

Call it with /gws-modelarmor-sanitize-prompt. For all projects use ~/.claude/commands/

Questions about gws-modelarmor-sanitize-prompt

How do I install gws-modelarmor-sanitize-prompt in Claude Code?

Run npx claude-code-templates@latest --command google-workspace/gws-modelarmor-sanitize-prompt. The command file is placed at .claude/commands/gws-modelarmor-sanitize-prompt.md.

What does gws-modelarmor-sanitize-prompt do?

It sends user text or a JSON request body through a Google Model Armor template. If neither is provided, it reads input from stdin.

What is required to run the command?

Install Google Workspace CLI (gws) and configure authentication. The command also needs ../gws-shared/SKILL.md and the full Model Armor template resource name.

Source text

gws-modelarmor-sanitize-prompt.md · MIT
---
allowed-tools: Bash, Read, Write, Edit
argument-hint: "[resource] [method] [flags]"
description: "Google Model Armor: Sanitize a user prompt through a Model Armor template."
---

# Google Workspace Modelarmor Sanitize Prompt

Execute Google Workspace Modelarmor Sanitize Prompt operations: $ARGUMENTS

## Prerequisites

- Google Workspace CLI (`gws`) must be installed
- Authentication configured: Run `gws auth status` to verify
- Review `gws modelarmor-sanitize-prompt --help` for all available commands

## Available Resources and Methods

# 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

```bash
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

```bash
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](../gws-shared/SKILL.md) — Global flags and auth
- [gws-modelarmor](../gws-modelarmor/SKILL.md) — All filter user-generated content for safety commands

## Usage

```bash
# List available resources and methods
gws modelarmor-sanitize-prompt --help

# Inspect method schema before calling
gws schema modelarmor-sanitize-prompt.<resource>.<method>

# Execute command with arguments
gws modelarmor-sanitize-prompt $ARGUMENTS
```

## Task

Execute the requested Modelarmor Sanitize Prompt operation: $ARGUMENTS

1. **Verify Prerequisites**
   - Check `gws` is installed: `gws --version`
   - Verify authentication: `gws auth status`
   - Review available commands: `gws modelarmor-sanitize-prompt --help`

2. **Inspect Method Schema**
   - Before calling any method, inspect its parameters
   - Use `gws schema` to understand required fields
   - Review parameter types and constraints

3. **Execute Operation**
   - Build command with appropriate flags
   - Use `--params` for query/path parameters
   - Use `--json` for request body
   - Handle pagination with `--max-results` or `--page-token`

4. **Error Handling**
   - Check command output for errors
   - Review API quotas and rate limits
   - Handle authentication issues
   - Retry transient failures

---

**License**: Apache License 2.0
**Source**: [Google Workspace CLI](https://github.com/googleworkspace/cli)
**Original Skill**: `gws-modelarmor-sanitize-prompt`

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Security →

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor