gws-modelarmor-create-template
它能做什么
这个工具用来创建一个安全模板,以保护你的数据。你可以把它理解为一组规则,确保你使用的信息是安全的。
适用场景
- ✓当你需要为数据定义新的安全规则时。
- ✓当你在搭建新系统,想增加一层保护时。
- ✓当你已经在使用安全模型,还想为某个特定任务新建一个时。
技能链接
https://github.com/googleworkspace/cli/blob/main/skills/gws-modelarmor-create-template/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在项目“my-project”的“us-central1”位置创建一个名为“my-secure-model”的安全模板。”
每周 5 个新技能,1 分钟读完。
工作原理
你需要提供项目名称、位置,以及模板的唯一标识符。你也可以选择使用预设模板(比如“jailbreak”),或者用 JSON 格式提供自定义配置。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
modelarmor +create-template
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
Usage
gws modelarmor +create-template --project <PROJECT> --location <LOCATION> --template-id <ID>
Flags
| 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) |
Examples
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 '{...}'
Tips
- Defaults to the jailbreak preset if neither --preset nor --json is given.
- Use the resulting template name with +sanitize-prompt and +sanitize-response.
[!CAUTION] This is a write command — confirm with the user before executing.
See Also
- gws-shared — Global flags and auth
- gws-modelarmor — All filter user-generated content for safety commands
常见问题
什么是“预设”?
“预设”就是现成的安全模板,可以直接使用。文档里的例子“jailbreak”就是一种安全配置。
“--json”参数是做什么用的?
它让你可以提供详细的自定义指令来创建安全模板,而不是使用现成的预设。
为什么要记住创建好的模板名称?
其他工具会用这个名称来应用你定义的安全规则,比如“sanitize-prompt”和“sanitize-response”。
详情
热度
- GitHub 星标
- 32k
- 排名
- #9177
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/6
评论
- …