Skip to main content
command

gws-modelarmor — Claude Code command: what it does, how to install

Connects Claude Code to the Google Workspace CLI to run Model Armor operations. It inspects API schemas and sanitizes user prompts and model responses for safety.

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

What gws-modelarmor does

This command equips Claude Code to manage Google Model Armor through the gws command-line tool. It guides the assistant to inspect method schemas via gws schema modelarmor.<resource>.<method>, construct --params or --json payloads, and handle pagination flags like --max-results and --page-token.

The command will fail immediately if the gws CLI is not installed or if authentication via gws auth status has not been completed. It relies directly on local shell execution with Bash, Read, Write, and Edit tools to run operations and handle API errors.

What it helps with

  • sanitize user prompts against Model Armor safety templates
  • filter model responses before displaying them
  • inspect required API parameters using gws schema
  • manage Model Armor templates through the gws CLI

Example prompts for the agent

  • /gws-modelarmor --help
  • /gws-modelarmor templates list --params "pageSize=5"
  • Inspect the schema and run Model Armor sanitization for this input

How to install gws-modelarmor

1claude-code-templates

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

2Manually: put the files in place

.claude/commands/gws-modelarmor.md

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

Questions about gws-modelarmor

How to install gws-modelarmor in Claude Code?

Run npx claude-code-templates@latest --command google-workspace/gws-modelarmor or copy the definition into .claude/commands/gws-modelarmor.md.

What does gws-modelarmor do?

It allows Claude Code to execute Model Armor API operations via the gws tool to inspect schemas and sanitize AI content.

What are the prerequisites for gws-modelarmor?

You need the gws CLI installed and verified with gws auth status. If ../gws-shared/SKILL.md is missing, create it by running gws generate-skills.

Source text

gws-modelarmor.md · MIT
---
allowed-tools: Bash, Read, Write, Edit
argument-hint: "[resource] [method] [flags]"
description: "Google Model Armor: Filter user-generated content for safety."
---

# Google Workspace Modelarmor

Execute Google Workspace Modelarmor operations: $ARGUMENTS

## Prerequisites

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

## Available Resources and Methods

# modelarmor (v1)

> **PREREQUISITE:** Read `../gws-shared/SKILL.md` for auth, global flags, and security rules. If missing, run `gws generate-skills` to create it.

```bash
gws modelarmor <resource> <method> [flags]
```

## Helper Commands

| Command | Description |
|---------|-------------|
| [`+sanitize-prompt`](../gws-modelarmor-sanitize-prompt/SKILL.md) | Sanitize a user prompt through a Model Armor template |
| [`+sanitize-response`](../gws-modelarmor-sanitize-response/SKILL.md) | Sanitize a model response through a Model Armor template |
| [`+create-template`](../gws-modelarmor-create-template/SKILL.md) | Create a new Model Armor template |

## Discovering Commands

Before calling any API method, inspect it:

```bash
# Browse resources and methods
gws modelarmor --help

# Inspect a method's required params, types, and defaults
gws schema modelarmor.<resource>.<method>
```

Use `gws schema` output to build your `--params` and `--json` flags.

## Usage

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

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

# Execute command with arguments
gws modelarmor $ARGUMENTS
```

## Task

Execute the requested Modelarmor operation: $ARGUMENTS

1. **Verify Prerequisites**
   - Check `gws` is installed: `gws --version`
   - Verify authentication: `gws auth status`
   - Review available commands: `gws modelarmor --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`

© 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