gws-modelarmor-sanitize-prompt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

modelarmor +sanitize-prompt

modelarmor +sanitize-prompt

PREREQUISITE: Read
../gws-shared/SKILL.md
for auth, global flags, and security rules. If missing, run
gws generate-skills
to create it.
Sanitize a user prompt through a Model Armor template
前提条件: 请阅读
../gws-shared/SKILL.md
了解认证、全局标志和安全规则。如果该文件缺失,请运行
gws generate-skills
命令生成它。
通过Model Armor模板清理用户提示词

Usage

使用方法

bash
gws modelarmor +sanitize-prompt --template <NAME>
bash
gws modelarmor +sanitize-prompt --template <NAME>

Flags

标志

FlagRequiredDefaultDescription
--template
Full template resource name (projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
--text
Text content to sanitize
--json
Full JSON request body (overrides --text)
标志是否必填默认值描述
--template
完整的模板资源名称(格式为projects/PROJECT/locations/LOCATION/templates/TEMPLATE)
--text
需要清理的文本内容
--json
完整的JSON请求体(会覆盖--text参数)

Examples

示例

bash
gws modelarmor +sanitize-prompt --template projects/P/locations/L/templates/T --text 'user input'
echo 'prompt' | gws modelarmor +sanitize-prompt --template ...
bash
gws modelarmor +sanitize-prompt --template projects/P/locations/L/templates/T --text 'user input'
echo 'prompt' | gws modelarmor +sanitize-prompt --template ...

Tips

提示

  • If neither --text nor --json is given, reads from stdin.
  • For outbound safety, use +sanitize-response instead.
  • 如果未指定--text或--json参数,则从标准输入读取内容。
  • 若要保障输出安全,请改用+sanitize-response命令。

See Also

另请参阅

  • gws-shared — Global flags and auth
  • gws-modelarmor — All filter user-generated content for safety commands
  • gws-shared — 全局标志与认证
  • gws-modelarmor — 所有用于过滤用户生成内容以保障安全的命令