gws-modelarmor

Filters user-generated content for safety using Google Model Armor templates.

Updated Nov 9, 2023
One-click install
npx skills add https://github.com/oresttokovenko/dot-files --skill gws-modelarmor-oresttokovenko
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gws-modelarmor
Source: https://github.com/oresttokovenko/dot-files/tree/main/chezmoi/dot_agents/skills/gws-modelarmor
Command: npx skills add https://github.com/oresttokovenko/dot-files --skill gws-modelarmor-oresttokovenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? User-generated prompts and model responses can contain unsafe, sensitive, or policy-violating content. This Skill lets you sanitize prompts and responses through Google Model Armor templates before they reach users or downstream systems. ## Core Features & Use Cases - Prompt Sanitization: Screen user prompts against a Model Armor template before sending them to a model. - Response Sanitization: Filter model outputs for safety policy violations before displaying them. - Template Management: Create new Model Armor templates defining your own safety filters. - Use Case: A support chatbot pipes every incoming customer message through gws modelarmor sanitization to block prompt injection attempts and sensitive data leaks. ## Quick Start Ask the assistant to sanitize a user prompt through a Model Armor template using the gws modelarmor sanitize-prompt helper command.

Frequently Asked Questions about gws-modelarmor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sanitize a user prompt with Google Model Armor?▼

Use the gws-modelarmor-sanitize-prompt helper command, which runs the prompt through a Model Armor template via the gws CLI. Inspect the method first with gws schema modelarmor.<resource>.<method> to build the correct parameters.

How do I create a Model Armor template with gws?▼

Use the gws-modelarmor-create-template helper command to define a new template with your safety filters. Run gws modelarmor --help to browse available resources and methods before calling the API.

What prerequisites does the gws modelarmor skill need?▼

It requires the gws binary installed on the system and the gws-shared skill for authentication, global flags, and security rules. If gws-shared is missing, run gws generate-skills to create it.

Can Model Armor filter model responses as well as prompts?▼

Yes, the gws-modelarmor-sanitize-response helper screens model outputs through a Model Armor template. This catches policy violations and sensitive content before responses reach end users.

Why does a gws modelarmor API call fail with parameter errors?▼

Failures usually come from incorrect or missing method parameters. Run gws schema modelarmor.<resource>.<method> to inspect required params, types, and defaults, then build your --params and --json flags accordingly.