AWS发布Bedrock护栏拒绝主题编写指南
AWS Machine Learning Blog指南介绍,Amazon Bedrock Guardrails的Denied Topics会按语义而非关键词匹配,因此可能拦截超出预期的请求。指南归纳了领域定义过宽、关键词列表、示例误导和主题重叠四类问题,并建议以具体行为定义主题、添加上下文锚点、选择合适的护栏策略及持续测试。指南还指出策略结果并非完全确定,建议为错误拦截设置恢复机制。
这些方法可帮助开发者减少AI应用中自定义护栏的误拦截和漏拦截问题。
With Denied Topics in Amazon Bedrock Guardrails, you block a content category by describing it in plain language, and the guardrail applies that description to every request by meaning rather than by keyword. That same mechanism can also match more than you intend. A topic named Finance, meant to keep an assistant out of investment advice, also blocks “When does my direct deposit clear?”. Inputs close in meaning to the topic can get caught, not only the requests you intended.
When Denied Topics blocks too much or too little, the cause is usually one of four authoring patterns:
- Topics that block legitimate queries. A topic framed around a subject domain (Finance, Legal, Compensation) rather than the user’s intention can match queries semantically near that domain. This is a frequent failure mode.
- Topics that miss the requests they were written to catch. A definition built from keyword lists (“words like invest, portfolio, stock…”) misses phrasings that use other vocabulary and fires on unrelated inputs that happen to share those words.
- Examples that teach the wrong thing. Five paraphrases of one idea leave the topic’s boundaries unguarded, and examples that name specific countries, products, or companies pull those entities into the topic’s context.
- Topics that interfere with each other. Overlapping definitions compete for the same input, report matches inconsistently, and can together block inputs that neither would block alone.