Google Model Armor: Sanitize a model response through a Model Armor template.
The `gws-modelarmor-sanitize-response` skill provides a secure mechanism to sanitize model outputs using predefined Model Armor templates. It addresses the challenge of ensuring that AI-generated content is safe and compliant before being shared with end-users, effectively mitigating risks such as unsafe, inappropriate, or sensitive content exposure. By leveraging structured templates, the skill enforces consistent content filtering and transformation, helping organizations maintain security and compliance standards when deploying AI models.
This skill supports key features including template-based response sanitization, flexible input options via plain text or JSON, and command-line integration through the `gws` CLI. Users can specify a Model Armor template to define the sanitization rules, while the tool automatically applies these rules to the model output. The skill allows for both simple text inputs and full JSON request bodies, providing adaptability to different workflows and data formats. Additionally, it integrates seamlessly with other Model Armor commands and the broader `gws` ecosystem, ensuring consistent security practices across AI interactions.
Typical use cases include sanitizing AI model outputs before presenting them to users, ensuring compliance with organizational content policies, and reducing the risk of unsafe content dissemination. Target users include AI engineers, security teams, and developers who work with generative models and need to enforce content safety standards. It is particularly valuable in applications where model outputs are exposed to external users or integrated into automated systems, offering an extra layer of content governance without requiring manual review.
You can run the command `gws modelarmor +sanitize-response --template <NAME>` and provide either the `--text` flag for plain text input or the `--json` flag for a full JSON request body.
Yes, specifying `--json` will override any content provided with the `--text` flag, allowing for more complex or structured input.
You must have authentication, global flags, and security rules configured as described in the `gws-shared` skill. If missing, you can generate them using `gws generate-skills`.
No, this skill is intended for outbound response sanitization. For filtering user input going into models, the `+sanitize-prompt` command should be used.
The skill requires the `gws` binary and is compatible with the configuration described under the security category in the skill metadata.
Quick Setup:
.claude/skills/Repository
googleworkspace/cli