Best practices for writing Denied Topics in Amazon Bedrock Guardrails
In one sentence
AWS shares best practices for writing Denied Topics in Amazon Bedrock Guardrails to accurately block unwanted content without affecting legitimate queries.
Key points
- Denied Topics match requests by meaning rather than keywords, so broad definitions can easily block legitimate queries.
- Using a fictional bank assistant as an example, the post identifies four common authoring patterns that cause over-blocking, misses, or interference.
- It recommends framing topics around specific user intentions rather than broad subject domains, using actionable names and definitions.
- Even when following best practices, developers must plan for the limitation that guardrail results are not fully deterministic.
In depth
An AI-written overview of the original article, not the article itself.
An AWS Machine Learning Blog post explains how to write precise Denied Topics in Amazon Bedrock Guardrails. Because the feature blocks requests by meaning rather than keywords, poorly framed topics can block legitimate queries, which the post illustrates using a fictional AnyCompany Bank assistant.
Common pitfalls in semantic matching
According to the post, a Denied Topic evaluates its name, definition, and up to five examples as a single unit. Four authoring patterns usually cause issues: domain-framed topics that block legitimate queries, keyword lists that miss phrasings, poor examples, and overlapping definitions that interfere with each other.
At AnyCompany Bank, initial topics named Finance and Legal blocked customers asking normal servicing questions, such as modifying a mortgage or finding a payoff quote.
Frame around intention and action
The post recommends framing topics around user intention rather than subject domains. Queries in the same domain can have different intentions, such as asking when a direct deposit clears versus asking for salary comparisons.
Topic names should use 2 to 5 word action phrases instead of single-word labels. Renaming Legal to Litigation and Non-Servicing Legal Advice and Fraud to Fraud Investigation Requests helps narrow the scope before the definition is even read.
Write action-scoped definitions
For definitions, the post advises starting with an action opener like Asking for, listing concrete objects, and adding a qualifying constraint. Defining Investment Recommendations as personalized advice on stocks, bonds, or crypto for the user's own returns ensures general financial education still passes.
This summary was generated by AI from the original article and may contain errors; the original is authoritative. Copyright belongs to the original author.