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.

The rest of this post is a practical guide to avoiding these patterns. It presents eight best practices for describing a topic precisely enough that the guardrail blocks what you mean and passes what you don’t.

The scenario: AnyCompany Bank’s customer assistant

To ground the following practices in something concrete, we use one running example throughout this post: a fictional bank we call AnyCompany Bank. AnyCompany Bank is two weeks from launching its first customer-facing AI assistant, and its first pass at the Denied Topics policy is blocking the wrong things.

Application: AnyCompany Bank’s chatbot is embedded in the AnyCompany Bank mobile and web app. It answers questions about accounts, statements, transfers, cards, and mortgages. It hands off to a human for account changes, dispute filings, and questions outside its scope.

Must-block list (from legal and compliance):

  1. Personalized investment recommendations (a regulatory line, because AnyCompany Bank isn’t registered as an investment adviser through this channel).
  2. Legal counsel or litigation guidance regarding disputes against AnyCompany Bank.
  3. Insider-trading advice (a specific slice of financial advice with its own regulatory weight).
  4. Descriptions of how to build weapons (universal safety, not domain-specific).
  5. Prompt injection or jailbreak attempts (a different kind of signal, because the request is trying to override the assistant’s own instructions).
  6. Repeating specific named competitor products in AnyCompany Bank’s outputs.

Must-pass list (the things the assistant exists to do):

  1. Account balance and statement questions.
  2. Transfer instructions, payoff quotes, escrow questions.
  3. Card management, fraud reports (routed to a human), lost-card replacement.
  4. Mortgage servicing operations, such as modifications, forbearance, and payment plans.
  5. General financial-literacy questions (“What is a certificate of deposit?”), phrased as education rather than personalized advice.

Against that target, AnyCompany Bank’s team first drafted four topics, all of them currently blocking legitimate queries:

Finance → blocks "When does my direct deposit clear?" Legal → blocks "Can you help me modify my mortgage?" Fraud → blocks "My card was skimmed at a gas station, what do I do?" Competitors → blocks any mention of a rival product, including customer questions comparing options

Every one of these topics names a subject domain the assistant works in, rather than the intention the bank needs to refuse. Fixing this is what the rest of the post is about. The next eight sections work through the practices, most of them closing with a “Back at AnyCompany Bank” subsection that shows the fix applied to this scenario. The post then closes with the one limitation to plan for regardless of how well you follow the practices: results are not fully deterministic.

Note: Denied Topic structure in Standard tier. A topic has three parts, a name, a definition, and up to five examples, and the guardrail evaluates all three together as a single unit, not the definition alone. The name can be up to 100 characters. The definition can be up to 1,000 characters, with 100–300 as the practical sweet spot. Each example can be up to 100 characters, and a guardrail can hold up to 30 topics.

Best practice 1: Frame the topic around the user’s intention, not the subject domain

This practice sets the general frame. Best practices 2 through 4 apply it to each part of a topic in turn: the name, the definition, and the examples.

A frequent reason a topic blocks legitimate queries is that the topic describes a subject domain rather than what the user wants from the exchange. Two queries in the same domain can carry different intentions. “When does my direct deposit clear?” and “How much does an L5 engineer earn?” both concern pay, but only the second is a salary comparison. A domain-framed topic collapses those distinctions and can block queries semantically near the domain. A topic framed around the user’s intention matches only queries where that intention is present.

Intention is the framing lens. To make it operational, name the topic after the specific action or content type that expresses the intention on the surface, such as a request, a claim, or a piece of generated content. Intention tells you what to catch, and action gives you a concrete shape the guardrail can evaluate.

The guardrail evaluates both the topic name and its definition together. When either component names a domain, the topic matches too broadly. When both name an action that expresses a specific intention, the topic is precise.

Guidelines

  • Identify the intention. State briefly, in your own words, what the user is trying to get from the assistant that you want to refuse, such as a personalized recommendation, a legal opinion, private contact details, or a partisan endorsement. This is the diagnostic step, and it doesn’t appear verbatim in the topic.
  • Name the topic after the action that expresses that intention. Use a phrase that describes a specific action or behavior, not a broad subject area. The phrase can be an action-derived noun (Investment Recommendations, Salary Comparisons), a specific behavior noun phrase (Colleague Arguments, Passport and Visa Renewal), or a verb-ing form (Suing for Damages). See Best practice 2 for details.
  • If your topic name is a category noun (Banking, Compensation, Security, Legal, Finance), the topic is domain-framed. Rename it after the action that expresses the intention you actually want to block.
  • Rewrite your definition to begin with the action. Openers such as “Asking for X”, “Requests for Y”, “Statements that describe Z”, or “Generating W” express the intention through a specific action. Avoid subject-area openers such as “Related to X”, “Content about Y”, or “Anything mentioning Z”.

The next few best practices apply this idea to AnyCompany Bank’s own topics, with concrete examples. Best practice 2 renames them, and Best practice 3 tightens their definitions to match.

Best practice 2: Choose an actionable topic name

The topic name has a meaningful effect on what is matched, often greater than expected. A broad category name (Finance, Security, Legal) can lead the guardrail to associate the topic with vocabulary in that category, even when the definition attempts to narrow the scope. A specific action name (Investment Recommendations, Hacking Instructions, Suing for Damages) helps narrow the scope before the definition is read.

Guidelines

  • Prefer a specific action or behavior phrase (2–5 words). Avoid single-word category labels.
  • The following forms can work, as long as the phrase describes a specific action or behavior rather than a broad subject area:
    • Action-noun form: an activity-derived noun as the head, such as Investment Recommendations, Hacking Instructions, or Election Fraud Claims.
    • Specific behavior noun phrase: a noun phrase that names a specific behavior, such as Colleague Arguments, Passport and Visa Renewal, or Underage Self-Statement.
    • Verb-ing form: an -ing verb followed by an object, such as Suing for Damages or Requesting Contact Details for Named Individuals. This form is useful when the action requires a verb to be clear.
  • Read the name aloud and ask whether it describes something the user is doing or only a subject area the user’s query is near. If the name only names a subject area, rename it.
  • Avoid names that include broad institutional labels (Government, Company, Insurance) unless the action is specifically about that institution. Institutional labels can produce unintended matches. For example, a topic named Government Documents might match queries that mention a country name plus a document, even if the query is about internal company policy.

Back at AnyCompany Bank

One of AnyCompany Bank’s first-draft topics was named Legal:

Name: Legal

This is why “Can you help me modify my mortgage?” got blocked. Mortgages are legal instruments, so queries about them live in the semantic neighborhood of legal. Renaming solves half the problem before we even touch the definition:

Name: Litigation and Non-Servicing Legal Advice

The new name uses a verb-derived noun (litigation), names a second specific behavior (non-servicing legal advice), and makes clear by contrast that servicing questions, such as modifications, forbearance, and escrow, are outside the topic. The name itself now carries some of the work the definition would otherwise do alone.

AnyCompany Bank applied the same logic to the Fraud topic, renaming it to Fraud Investigation Requests. The assistant should still let customers report fraud, which gets routed to a human, but must not attempt to investigate fraud claims itself.

After these three renames, AnyCompany Bank’s topic list is:

1. Investment Recommendations (was: Finance) 2. Litigation and Non-Servicing Legal Advice (was: Legal) 3. Fraud Investigation Requests (was: Fraud)

Best practice 3: Write action-scoped definitions

The definition should describe the user’s action on a specific object, rather than the general subject of that action.

Guidelines

  • Begin with the action or the content type. Open the definition with a phrase that names what the user is doing or producing. Common effective openers include:
    • “Asking for…”, “Requesting…”, “Requests for…”, “Requests to…”, “Seeking…”, “Recommending…”, when the topic covers user requests for a specific action.
    • “Statements that…”, “Providing…”, “Generating…”, “Content that includes…”, when the topic covers user-produced content, disclosures, or generated output.
    • “Using X to Y”, when the topic covers a specific technique or method.
  • Avoid opening with a subject-area phrase such as “Related to X”, “Content about Y”, or “Anything mentioning Z”, which is domain-framed rather than action-framed.
  • Specify the objects. State what the user is asking about, using concrete items rather than broad categories, for example, “individual stocks, bonds, ETFs, or cryptocurrencies” rather than “financial products”.
  • Add discriminating detail. If two topics share vocabulary (for example, both involve “customer”), give each definition a distinct feature so the guardrail can differentiate them. Definitions that share meaning cause the two topics to interfere with each other.
  • Keep the definition positive. Describe what is in scope. Short trailing exclusions can help disambiguate. See Best practice 8 for cases where exclusions are harmful.
  • Length isn’t the goal. Longer definitions are not necessarily better, and a longer definition can increase the topic’s sensitivity to the wording of neighboring topics.

Structural template

We recommend the following structure:
[Action or content-type opener] for [specific objects] by [qualifying constraint or purpose]. Includes [one or two sub-cases].

Back at AnyCompany Bank

AnyCompany Bank’s first-draft topic was named Finance, with a definition to match:

Name: Finance Definition: Anything related to money, banking, or financial products.

This is exactly why “Where can I find my payoff quote?” was blocked. Payoff is a financial term, quote concerns money, and the input is “related to” the finance domain, even though the customer’s intention, retrieving a servicing figure, has nothing to do with what AnyCompany Bank wanted to refuse.

Following Best practice 1, the team renamed the topic to Investment Recommendations and adjusted the definition’s vocabulary to match, without yet making it action-scoped:

Name: Investment Recommendations Definition: Anything related to investing, personal finance decisions, or securities trading.

This was still domain-framed even though the name had improved. General education (“Explain what a mutual fund is”), historical financial news (“Why did rates rise last quarter?”), and portfolio review (“Show me my holdings”) all matched. The assistant should answer all of them.

The team applied the structural template, with an action opener, specific objects, a qualifying constraint, and one or two sub-cases:

Name: Investment Recommendations Definition: Asking for a personalized recommendation to buy, sell, or hold specific stocks, bonds, mutual funds, ETFs, or cryptocurrencies for the user's own investment returns. Includes asking whether a specific security is a good investment, requesting portfolio allocation percentages, or asking when to enter or exit a specific position.

Every piece of the template serves a specific purpose. “Asking for a personalized recommendation to…” is the action opener. “Stocks, bonds, mutual funds, ETFs, or cryptocurrencies” are the specific objects. “For the user’s own investment returns” is the qualifying constraint that excludes educational and third-party discussion. The “Includes…” clause names two sub-cases: a specific-security question and an allocation-percentage question.

AnyCompany Bank applied the same template to the Litigation and Non-Servicing Legal Advice and Fraud Investigation Requests topics:

Name: Litigation and Non-Servicing Legal Advice Definition: Requests for legal counsel, discussions about filing lawsuits, or seeking litigation guidance against AnyCompany Bank or another named party. Includes requests to interpret legal rights, request formal legal opinions, or plan a claim outside of standard loan servicing. Name: Fraud Investigation Requests Definition: Asking the assistant to investigate, adjudicate, or resolve a suspected fraud, unauthorized-transaction, or identity-theft case. Fraud reports for routing to a human agent are not in scope.

The team now had three named topics with action-scoped definitions.

Best practice 4: Use boundary examples, not paraphrases

Examples teach the guardrail where the boundaries of your topic are. Not every example does this equally well. Five paraphrases of the same idea teach the guardrail nothing new, while five carefully chosen examples can draw the outline of the topic with much less definition text. The examples that carry the most weight are the ones sitting near the topic’s edge, close enough to a plausible non-match that they show the guardrail where to draw the line. We call these boundary examples. A good boundary example has three properties. First, it’s inside the topic’s scope. Second, it’s close to a plausible non-match, using vocabulary or structure that resembles inputs the topic should not match. Third, it differs from your other examples in sub-case, sentence shape, and vocabulary.

Guidelines

  • Use all five examples, because five varied examples are more effective than two obvious ones.
  • Cover different sub-cases. If the topic covers “buy” and “sell” advice, include examples of both.
  • Cover different sentence shapes. Include direct questions (What should I buy?), imperatives (Recommend a stock), and narrative statements (I’m considering putting money into…).
  • Include one example that is near the boundary of the topic but still inside, a borderline version of a match.
  • Don’t include country names, product names, competitor names, or company names in examples unless the topic is inherently about that specific entity. Named entities in examples create associations that cause the topic to match unrelated queries mentioning the same entity.

Back at AnyCompany Bank

The team’s first pass at examples for Investment Recommendations looked like this:

Examples: Should I buy stocks? What stock should I buy? Is this a good stock to purchase? Which stocks are good buys? Recommend some stocks

These are five ways of asking the same question. During testing, the assistant blocked “Should I buy stocks?” reliably. But it let through “Is it a good time to rotate my portfolio out of equities into bonds?”, which is exactly the kind of question the topic is supposed to catch. The paraphrases had crowded around one point in the topic, and other points were unguarded.

The rewrite spread the examples across sub-cases and sentence shapes:

Examples: Should I buy 100 shares of a specific stock before earnings? Is it a good time to move my portfolio into bonds? What percentage should I allocate to cryptocurrency? Should I sell my index fund now or hold? Recommend three growth stocks for a 5-year horizon

These are five different sub-cases (specific stock, asset-class shift, allocation, sell timing, growth screen) and five different sentence shapes, all inside the topic. Adjacent non-matches like “Explain what an ETF is” (educational) and “Show me my portfolio report” (data retrieval) are sufficiently different from the examples that the guardrail should not match them.

The team applied the same treatment to Litigation and Non-Servicing Legal Advice and Fraud Investigation Requests. The original Litigation examples were all variants of “Can I sue?” The rewritten set covered lawsuit filing, formal legal opinions, class-action inquiries, damages, and rights-interpretation. The original Fraud Investigation Requests examples were all variants of “Someone stole my money, what do I do?” The rewritten set covered unauthorized-charge investigation, card-fraud tracing, transaction reversal, identity-theft adjudication, and scammer tracing. Each rewritten set covers five different sub-cases inside one topic.

At this point, AnyCompany Bank’s three topics pass every test written so far. One more problem only shows up after the assistant runs against real traffic.

Best practice 5: Anchor definitions to a specific context when needed

Some concepts are inherently ambiguous, because the same words describe both a matching and non-matching action, depending on context. In these cases, add an explicit anchor that fixes the context: an institutional setting, a stated purpose, or a dual condition of the form “only applies when both X and Y are present”.

Guidelines

  • Add a physical or institutional context in which the action occurs. For a passport topic, anchor to “at an embassy or consulate” or “through an official government application process”.
  • Add a purpose qualifier. For an investment-recommendation topic, anchor to “for the user’s own investment returns” so that the topic excludes educational or third-party discussion.
  • Use dual conditions when a single anchor is insufficient: “Only applies when the request (1) explicitly mentions creating an advertising campaign AND (2) names personal identification data as the targeting criterion.”
  • Anchors should be positive (“at X”, “for Y”) rather than “except…” or “but not…”. Positive anchors describe what the topic IS.
  • Know when not to add an anchor. If the topic is already inherently narrow (a topic specifically about “insider trading”, because the phrase is unambiguous by itself), an additional anchor introduces noise. Also avoid anchoring to a proper noun that appears in many unrelated queries (“in India”, “at Amazon”). Anchor to categories (embassies, consulates) instead.
  • Check whether the topic’s own name repeats the ambiguous surface phrase. A benign, educational way of asking about the same concept often reuses that exact phrase. The guardrail reads the topic name as a signal independent of the definition (see Best practice 2). A dual-condition anchor can still lose to a name built from the term it’s trying to disambiguate.

Back at AnyCompany Bank

Adding an insider-trading topic exposed the ambiguity issue. The compliance team wanted Insider Trading Advice as a distinct topic, narrower and more serious than the general Investment Recommendations catch. The first draft:

Definition: Asking whether to buy or sell a specific security based on inside information.

This matched the expected case: a customer asking for a trade based on private information. It also matched something the team didn’t expect: educational queries about what insider trading is, phrased as questions. “How does the SEC define insider trading?” was getting blocked, because it “asks about insider trading”.

The team added a dual anchor:

Name: Insider Trading Advice Definition: Asking whether to buy or sell a specific security based on non-public material information about the issuing company, or seeking a recommendation to trade ahead of a known upcoming public announcement. Applies only when the request (1) names a specific security AND (2) describes a specific piece of non-public information the user claims to possess.

Both conditions should rule out educational queries: they fail condition 2, because they don’t describe non-public information the user personally holds. When the team tested “How does the SEC define insider trading?” against this definition, it still got blocked some of the time. The anchor was not the problem. The topic’s name was: it repeats the exact phrase the query uses. The guardrail weighs the name as a signal independent of the definition, the same effect Best practice 2 describes elsewhere. A dual-condition anchor can specify the right conditions and still lose to a name built from the term that it’s trying to disambiguate.

The team kept the anchor and renamed the topic instead:

Name: Trading on Non-Public Information

With the rename, the educational query passed reliably, and the real examples, the ones naming a specific security and a specific piece of non-public information, still blocked.

The definition is longer than the 100–300 character target from Best practice 3, and that is deliberate. The ambiguity here justifies the extra text. The topic itself is inherently subtle, so the definition has to carry more work.

Best practice 6: Manage topic overlap and topic count

A guardrail evaluates its topics together, not one at a time. When two topics have similar meanings, they interfere with each other. It becomes difficult to predict which topic the guardrail reports as the match, and the combined effect can block legitimate inputs that neither topic alone would block. Overlap between topics is often the reason a well-written topic produces incorrect results. The problem isn’t that topic, but a neighboring topic.

Guidelines

  • Review the whole topic set for overlap before deployment. Two topics with similar definitions cause interference even if neither is broken individually. For each new topic, ask whether the definition shares vocabulary or objects with an existing topic.
  • Be aware that topic count influences interference. As the number of topics in a single guardrail grows, the chance of interference between topics also grows, especially when several topics share vocabulary or cover related areas. If you observe topics interfering with each other and the definitions themselves look correct, consider reducing overlap between topics or distributing topics across more than one guardrail.
  • Prefer semantic diversity within a guardrail. If you have several topics on related themes (for example, three finance-adjacent topics), consider whether they belong in the same guardrail or should be separated.
  • When two topics overlap, prefer to consolidate rather than split. Merging two topics whose definitions share objects and actions is safer than attempting to draw a narrow boundary between them.
  • When a new use case appears, prefer to extend an existing topic’s examples rather than add a new near-duplicate topic. Adding a new topic changes how the guardrail interprets the entire topic set, but extending a topic’s examples doesn’t.
  • Place semantically-similar topics apart in the list. When two topics with similar wording appear next to each other, the guardrail is more likely to attribute an input to whichever it saw most recently. Interleave the list, separating related topics with an unrelated one in between.

Back at AnyCompany Bank

Suppose, late in the process, AnyCompany Bank’s compliance team proposed adding a broader Financial Advice topic alongside the already-defined Investment Recommendations. The intuition was that the broader topic would catch requests the specific one missed. Both topics were drafted with their own definitions:

Topic A: Name: Financial Advice Definition: Requests for advice about money, investing, or personal finance decisions. Topic B: Name: Investment Recommendations Definition: Asking for a personalized recommendation to buy, sell, or hold specific securities...

The overlap became visible when the team tested “Should I put more into my 401(k)?”. Depending on how the caller ordered the topics in the API request, either Topic A, Topic B, or both would report the match, and on some orderings the guardrail blocked the input.

AnyCompany Bank consolidated. Financial Advice was removed, and Investment Recommendations was left to carry the specific action. After the consolidation, the ordering-dependent variance disappeared. The same input produced the same verdict regardless of where topics sat in the API call, which is the primary win from removing the overlap.

The 401(k) query itself, however, was not fully resolved by consolidation alone. Because “Should I put more into my 401(k)?” shares its “Should I put more…” frame with a real trading recommendation, Investment Recommendations still matches it on the surface. This is a residual boundary case that consolidation can’t fix by itself. It’s exactly the kind of structurally-similar match that Best practice 8 warns a trailing exclusion can’t reliably override.

The team also reordered the remaining topics. The original order was:

1. Investment Recommendations 2. Trading on Non-Public Information 3. Litigation and Non-Servicing Legal Advice 4. Fraud Investigation Requests

Topics 1 and 2 both discuss securities and cover related financial actions, so adjacent placement invited attribution ambiguity for borderline inputs. The team interleaved them:

1. Investment Recommendations 2. Litigation and Non-Servicing Legal Advice 3. Trading on Non-Public Information 4. Fraud Investigation Requests

Litigation and Non-Servicing Legal Advice now sits between the two securities-adjacent topics. Borderline questions like “Should I trade my Example Corp shares based on rumor?” now attribute more consistently to Trading on Non-Public Information rather than flipping between Trading on Non-Public Information and Investment Recommendations.

Best practice 7: Use the right policy for the job

Denied Topics is the right tool when the rule you need to enforce is specific to your business and expressible as a short description of the content. Think of a regulatory line, a policy commitment, a legal risk, or a scope boundary, rather than a universal safety category or a fixed list of words. Guardrails offers several policies that share the same goal of blocking specific content, but each is designed for a different kind of signal. Using Denied Topics for a category that another policy handles natively tends to block too much or too little, complicates your configuration, and produces worse results. A carefully written topic for a category that Content Filter already covers is usually less effective than Content Filter for that category.

Note that enabling more than one policy in the same guardrail incurs additional cost, because each enabled policy is evaluated on every request. When you compose Denied Topics with Content Filter or Prompt Attack, plan for the combined cost.

When to use each policy

What you are trying to catch Right policy Common mistake
Broad safety categories (hate, insults, violence, sexual, misconduct) Content Filter A Denied Topics topic named Hate Speech or Violence
Prompt injection, jailbreak attempts Prompt Attack A Denied Topics topic named Jailbreak or Instruction Override
Specific words, phrases, or product names to consistently block Word Filter A Denied Topics topic named Blocked Terms or Competitor Names
Personal identifiers (names, phone numbers, SSN, credit cards) Sensitive Information filter A Denied Topics topic named PII Detection
Custom content categories specific to your business or policy Denied Topics (this is the correct use)
Custom content categories that also require Content Filter-like coverage Compose Denied Topics with Content Filter Attempting to reproduce Content Filter functionality in Denied Topics alone

Back at AnyCompany Bank

Looking back at AnyCompany Bank’s must-block list (from the scenario at the start of the post), three of the six items are not really Denied Topics at all. They belong to policies that Guardrails already provides natively.

  • “Descriptions of how to build weapons” is a universal safety category, not a bank-specific policy. It moves to Content Filter → VIOLENCE at HIGH strength.
  • “Repeating specific named competitor products” is exact-string blocking, not semantic matching. It moves to Word Filter with the competitor names as literal entries. (AnyCompany Bank’s first-draft topic list did include a topic called Competitors for this purpose. That topic is deleted, because Denied Topics evaluates meaning and would match ordinary mentions of the competitor’s name while missing rephrasings.)
  • “Prompt injection or jailbreak attempts” is a different signal entirely. The user is trying to override the assistant’s own instructions, not asking about a domain. It moves to Prompt Attack.

After this cleanup, AnyCompany Bank’s guardrail configuration composes multiple policies:

Content Filter: HATE strength: HIGH INSULTS strength: HIGH SEXUAL strength: HIGH VIOLENCE strength: HIGH MISCONDUCT strength: HIGH Prompt Attack: enabled Word Filter: Custom words: [list of competitor product names] Denied Topics: 1. Investment Recommendations 2. Litigation and Non-Servicing Legal Advice 3. Trading on Non-Public Information 4. Fraud Investigation Requests

Denied Topics carries only the four bank-specific rules that no other policy can express.

Best practice 8: Avoid these anti-patterns

The following patterns cause topics to block the wrong inputs even when the rest of the definition is otherwise well written. Avoid them. Most are a specific case of guidance already given in earlier best practices, so each line that follows points back to where the full reasoning lives.

  • Writing the definition as an instruction to the guardrail (“Block all content related to…”) instead of a description of the topic. See Best practice 3.
  • Framing the definition mostly by what it excludes (“All content except…”) instead of what it is. See Best practice 3.
  • Listing trigger words (“Questions containing words like…”) instead of describing the concept. See Best practice 1 and Best practice 3.
  • Using Denied Topics to block a specific word, phrase, or entity type, such as a competitor name or a person’s name. Use Word Filter or the Sensitive Information filter instead. See Best practice 7.
  • Naming countries, products, competitors, or companies in examples, unless the topic is inherently about that entity. See Best practice 4.
  • Writing examples that paraphrase the definition instead of marking its boundary. See Best practice 4.
  • Writing a vague definition and relying on the examples to carry the meaning. See Best practice 3 and Best practice 4.

Trailing exclusions: A caveat and a general guide

A short trailing exclusion isn’t a general-purpose fix for every false refusal. It reliably rules out queries that are categorically different from the topic, such as a different intent, a different asker, or a different type of content. It’s less reliable when a benign query is worded almost exactly like the definition’s positive language, only about a different object. In that case, the exclusion competes against wording it closely resembles, and the match often wins.

For that structurally-similar case, prefer one of these three alternatives instead:

  • A dual-condition anchor that names the confusable case directly as part of the definition (see Best practice 5).
  • A rename that promotes the discriminator into the topic name itself, so the gate is visible before the definition is read (see Best practice 2).
  • An upstream intent-routing step that hands the ambiguous case to a specialized flow before Guardrails sees it.

A trailing exclusion remains the right first move for every other case. Reach for one of these three only when testing shows the exclusion is losing to a near-identical match.

Limitation: Results are not fully deterministic

Even a guardrail that follows every practice in this post won’t produce fully deterministic results across every possible input. Denied Topics reads meaning with a language model, and language-model evaluations carry some inherent variance. There are two forms of this variance you should plan for.

Variance when repeating the exact same request. Sending the identical input to the identical guardrail configuration two times in a row can, in rare cases, produce different results. The same characters go in, the same topic list applies, everything is the same, and yet one call blocks and the next passes. For most inputs, and for topics that follow the preceding guidance, this doesn’t happen, and the result is stable across repeated calls. The exceptions are borderline inputs, whose meaning sits close to the semantic edge of a topic. Those are the ones prone to flipping on repeat. The more precisely a topic is defined (action-scoped, specific objects, clear anchor, boundary examples), the fewer of your inputs fall in that borderline zone.

Variance when the topic list changes. The guardrail evaluates all topics together with the input on every request. Changes to the topic list, such as adding a topic, removing one, or reordering the same topics, can shift results for previously-tested inputs. An input that was blocked with one topic list might pass with a different one. This effect happens more when two topics share meaning or when a topic definition is broad. It happens less when every topic in the list has a specific, action-scoped definition and clear boundary examples. Applying the practices in this post meaningfully reduces both forms of variance.

How to plan for it

  • Don’t treat a single evaluation as proof of correctness. For an input that matters, test it multiple times, and test it as part of a small representative evaluation set rather than in isolation.
  • Keep an evaluation set that includes borderline cases. These are the inputs most likely to shift when you change something. Include a mix of clear-match, clear-non-match, and near-boundary cases.
  • Retest after changes to the topic set. Adding a topic, renaming one, tuning a definition, or reordering the list can shift results on inputs that previously behaved as expected.
  • For inputs where correctness is critical, don’t rely on Denied Topics alone. Compose it with other policies (Content Filter, Prompt Attack, Sensitive Information filter) so that no single policy is the sole line of defense on a high-stakes decision.
  • Design your product so that a wrong block is recoverable. Route blocked inputs to a human when the topic is high-stakes, give the user a way to rephrase, and log blocks with reason codes so you can audit and improve the topic set over time.

Note: Every pass-or-fail claim in this post was tested end-to-end against Amazon Bedrock Guardrails (Standard tier), each query repeated multiple times to confirm the result was stable.

Key takeaways

To recap, the practices in this post come down to eight points:

  1. Frame every topic around the user’s intention, expressed as a specific action. Diagnose what the user is trying to get, then name the topic after the action that expresses that intention, not the subject area the query is near. Use “Investment Recommendations”, not “Finance”.
  2. Write the definition to describe what the topic is. Use an action or content-type opener, name the concrete objects, add a qualifying constraint, and include one or two sub-cases.
  3. Use up to five boundary examples. Cover different sub-cases and sentence shapes. Don’t paraphrase the definition, and avoid country, product, and competitor names.
  4. Anchor ambiguous topics with a context or purpose. Use institutional settings (“at an embassy”) or purpose qualifiers (“for the user’s own investment returns”). Use dual conditions when a single anchor isn’t enough.
  5. Manage overlap and topic count. Consolidate topics that share vocabulary, keep semantically-similar topics apart in the list, and retest after changes.
  6. Use the right policy for the job. Denied Topics is for custom, business-specific topics. Content Filter, Word Filter, Sensitive Information, and Prompt Attack cover the categories they were designed for.
  7. Avoid the seven anti-patterns. Instructions in place of descriptions, negative-only framing, keyword lists, entity capture, named entities in examples, paraphrase-only examples, and placeholder definitions all produce topics that block the wrong inputs.
  8. Plan for the fact that results are not fully deterministic. Keep a borderline evaluation set, retest after every change, and design the product so a wrong block is recoverable.

Conclusion

Denied Topics is a powerful policy. With it, you can describe a bespoke content category in a short natural-language definition, without training a classifier or hand-crafting regular expressions. That power depends on describing the category the way the guardrail reads it: as the user’s intention, expressed as a specific action on a specific object, not as a subject domain. Get the framing right and the rest of the practices in this post, such as naming, definition, examples, anchors, overlap management, and policy selection, fall into place naturally.

To apply this in your own application:

  1. Audit your existing topics. For each topic, ask whether the name describes an action or a subject area. Rename the ones that describe a subject area.
  2. Rewrite each definition against the template: [Action or content-type opener] for [specific objects] by [qualifying constraint or purpose]. Includes [one or two sub-cases].
  3. Move every non-topic signal to the right policy. Send universal safety to Content Filter, specific strings to Word Filter, identifiers to the Sensitive Information filter, and jailbreak attempts to Prompt Attack.
  4. Build a small evaluation set that includes both obvious matches and near-boundary non-matches drawn from your real traffic. Retest after every change to the guardrail.

To get started, visit the Amazon Bedrock Guardrails console and the Amazon Bedrock Guardrails documentation for the full policy reference and API details, including CreateGuardrail and ApplyGuardrail.


About the authors

Jian Zhang

Jian Zhang

Jian is a Senior Applied Scientist who applies machine learning to help customers solve problems in fraud detection, image generation, and more. He has built graph neural network solutions for customers across China, the US, and Singapore, and has given public presentations on GraphStorm, DGL, and Amazon Neptune. More recently, Jian has extended his focus to Amazon Bedrock Guardrails, helping customers author Denied Topics and evaluate guardrail behavior in production.

Zheng Qi

Zheng Qi

Zheng is a Senior Applied Scientist at Amazon Web Services, developing techniques that help customers build safe and responsible generative AI applications. He is passionate about trustworthy AI, foundation model post-training, and self-evolving agents.

Cindy Tang

Cindy Tang

Cindy is a Senior Product Manager with the Amazon Bedrock team, where she is the primary product manager for Amazon Bedrock Guardrails denied topic policies. She is passionate about helping customers apply safety controls to their generative AI applications.