AivexaNewsSearch
AI news for builders and product teamsChecked every hour

Best practices for writing Denied Topics in Amazon Bedrock Guardrails

Collected Nov 16, 2026

An AWS Machine Learning Blog post lays out a practical method for authoring Denied Topics in Amazon Bedrock Guardrails, the feature that lets teams block a content category by describing it in plain language. Because the guardrail applies that description semantically rather than by keyword, a loosely framed topic can capture far more than its author intended; the post's running illustration is a topic called Finance, meant to keep an assistant away from investment advice, that also blocks a question about when a direct deposit clears. The guidance organizes the failure modes into four authoring patterns and answers them with eight best practices, worked through against a fictional bank chatbot.

Each topic in the Standard tier has three parts: a name, a definition and up to five examples. The guardrail evaluates all three together, not the definition alone. Names may run to 100 characters, definitions to 1,000 characters (with 100 to 300 described as the practical range), each example to 100 characters, and a single guardrail can hold up to 30 topics.

The four recurring failure patterns are topics that block legitimate queries, usually because they are framed around a subject domain such as Finance, Legal or Compensation and so match anything semantically nearby; topics built from keyword lists, which miss phrasings using other vocabulary while firing on unrelated inputs sharing those words; examples that teach the wrong lesson, whether five paraphrases of one idea or named countries, products or companies that pull those entities into the topic's context; and overlapping topics that compete for the same input, report matches inconsistently and can jointly block requests neither would block alone.

The worked scenario is AnyCompany Bank, two weeks from launching a customer-facing assistant that handles accounts, statements, transfers, cards and mortgages, and hands off to a human for account changes and disputes. Legal and compliance require it to refuse personalized investment recommendations, litigation guidance against the bank, insider-trading advice, weapon-building instructions, prompt injection or jailbreak attempts, and repetition of named competitor products. It must still answer balance and statement questions, transfer and escrow queries, card management and fraud reports, mortgage servicing tasks such as modifications and forbearance, and general financial-literacy questions.

The first draft of four topics failed on all counts. Finance blocked a direct-deposit question, Legal blocked a mortgage-modification request because mortgages are legal instruments, Fraud blocked a card-skimming report, and Competitors blocked customers comparing rival products.

The first best practice is to frame each topic around the user's intention rather than a subject area. Two queries can sit in one domain while carrying different intentions: a direct-deposit question and a salary comparison both concern pay, but only the latter is a salary comparison. The post advises stating the intention in your own words as a diagnostic, then naming the topic after the action that expresses it. Subject-area openers such as "Related to X" or "Anything mentioning Z" are to be avoided in favor of "Asking for X" or "Requests for Y". The guardrail reads name and definition together, so if either names a domain the match spreads too wide.

The second practice concerns the name, which the post says shapes matching more than authors expect. It favors a two-to-five-word action or behavior phrase, in one of three forms: an action-derived noun such as Investment Recommendations or Hacking Instructions, a specific behavior noun phrase such as Passport and Visa Renewal, or a verb-ing form such as Suing for Damages. Single-word category labels are discouraged, as are broad institutional labels like Government or Company, which can match a country name plus a document even when the question is about internal policy. At AnyCompany Bank, Legal became Litigation and Non-Servicing Legal Advice, a rename alone that disambiguates servicing questions, and Fraud became Fraud Investigation Requests so customers can still report fraud that is routed to a human.

The third practice is an action-scoped definition. The suggested template reads: action or content-type opener, for specific objects, by qualifying constraint or purpose, includes one or two sub-cases. Objects should be concrete, such as stocks, bonds, mutual funds, ETFs or cryptocurrencies rather than financial products. Topics that share vocabulary need a distinguishing feature to avoid interference, and definitions should stay positive with exclusions kept short. Length is not the goal; longer definitions can raise sensitivity to neighboring topics. Finance's original wording, covering anything related to money, banking or financial products, had blocked a payoff-quote request. Renaming it Investment Recommendations was not enough: a still-broad definition caught mutual-fund education, rate history and portfolio review. The revised definition asks for a personalized buy, sell or hold recommendation on named security types for the user's own returns, and includes whether a security is a good investment, allocation percentages, and entry or exit timing.

The fourth practice replaces paraphrased examples with boundary examples that sit near a plausible non-match. Good ones fall inside scope, resemble inputs the topic should not match, and differ from each other in sub-case, sentence shape and vocabulary. The post advises using all five slots, covering different sub-cases and mixing direct questions, imperatives and narrative statements, while leaving out country, product, competitor and company names. The bank's first five investment examples were five versions of one question; they reliably blocked "Should I buy stocks?" but let through a question about rotating a portfolio from equities into bonds. The rewrite spans a specific-stock purchase, an asset-class shift, a crypto allocation, sell timing and a growth screen.

The post closes by noting that results are not fully deterministic however carefully the topics are written. For developers and product teams, this suggests guardrail policies need the same review discipline as prompts: versioned wording, test suites of must-block and must-pass utterances drawn from real traffic, and monitoring for false positives after launch, since semantic matching trades keyword predictability for coverage. My reading is that the name and definition act as a compressed specification, and the close variants that slip through are the evidence for where it needs tightening.

Read at AWS Machine Learning Blog

Based on reporting from the original publisher. Visit the source for full context and later updates.

Publisher excerpt

With Denied Topics in Amazon Bedrock Guardrails, you block a content category by describing it in plain language, and the guardrail matches by meaning rather than keyword, which can block more than you intend. This post presents eight best practices for writing a topic precisely enough that the guardrail blocks what you mean and passes what you don't.