
Creates Google Cloud Model Armor templates for filtering AI model inputs and outputs against security threats like jailbreak attempts. You'll use this when setting up content safety guardrails for production AI applications that need to block prompt injection, harmful content, or other model abuse patterns. Ships with a jailbreak detection preset, but you can pass custom JSON configurations for specific filtering rules. The resulting templates integrate with Google's AI services to sanitize prompts before they hit your models and responses before they reach users. Essential for any customer-facing AI feature where you can't manually review every interaction.
$ npx -y skills add googleworkspace/cli --skill gws-modelarmor-create-template --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.
Create a new Model Armor template
gws modelarmor +create-template --project <PROJECT> --location <LOCATION> --template-id <ID>
| Flag | Required | Default | Description |
|---|---|---|---|
--project | ✓ | — | GCP project ID |
--location | ✓ | — | GCP location (e.g. us-central1) |
--template-id | ✓ | — | Template ID to create |
--preset | — | — | Use a preset template: jailbreak |
--json | — | — | JSON body for the template configuration (overrides --preset) |
gws modelarmor +create-template --project P --location us-central1 --template-id my-tmpl --preset jailbreak
gws modelarmor +create-template --project P --location us-central1 --template-id my-tmpl --json '{...}'
[!CAUTION] This is a write command — confirm with the user before executing.
Sponsors