用途:通过 Model Armor 模板净化模型响应,面向出站安全场景(模型→用户)。若需入站安全(用户→模型),应改用 +sanitize-prompt。
前置条件:需先阅读 ../gws-shared/SKILL.md 了解认证、全局标志与安全规则;若该文件缺失,运行 gws generate-skills 生成。
用法:gws modelarmor +sanitize-response --template <NAME>
参数:--template 为必填,填写完整模板资源名 projects/PROJECT/locations/LOCATION/templates/TEMPLATE;--text 为可选,填写待净化文本;--json 为可选,填写完整 JSON 请求体,会覆盖 --text。
示例:gws modelarmor +sanitize-response --template projects/P/locations/L/templates/T --text 'model output';也支持管道输入,如 model_cmd | gws modelarmor +sanitize-response --template ...。
相关:gws-shared 提供全局标志与认证;gws-modelarmor 提供全部过滤用户生成内容的安全命令。
限制:资料未提供具体过滤规则、返回格式、错误码、配额与计费信息,暂未提供。