An Amazon Bedrock guardrail only protects what it is configured to see, and many of the settings that decide that, such as input tags, tier, streaming mode and the Detect action, are easy to leave at a value that quietly lets content through. This guide works through each Bedrock Guardrails policy at configuration level: content filters and the prompt attack filter, denied topics, word filters, sensitive information filters, contextual grounding checks and Automated Reasoning checks, plus tiers, versions, streaming, the ApplyGuardrail API and account and organisation enforcement. It gives the field names, limits and actions, how to tune and test them, and how to roll changes out and back. It is for AI platform engineers, application security teams and cloud security architects running generative AI on Bedrock. IAM, logging and model access for Bedrock as a whole are covered in the Amazon Bedrock Security Guide; this page does not repeat them.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.
Key takeaways
- Configure each policy for input and output separately. Most policies have their own inputEnabled, inputAction, outputEnabled and outputAction fields, and the prompt attack filter evaluates input only.
- Tag user input or the prompt attack filter sees nothing. With InvokeModel and InvokeModelWithResponseStream, only content inside guardContent tags is evaluated for prompt attacks; untagged input is not filtered.
- Choose the tier deliberately. The Standard tier adds prompt leakage detection, code-aware filtering, longer denied topic definitions and wider language support, but it requires cross-Region inference, which matters for data residency.
- Start in Detect, then Block. The NONE action returns detection information without changing content, so you can measure false positives on real traffic before you enforce.
- Guardrails do not inspect tool calls or redact logs. Content filters and PII filters skip toolUse, toolResult and toolSpec, and model invocation logs and traces keep the original PII.
How a guardrail is built
A guardrail is a named resource with a working draft and numbered versions. You edit the draft, test it in the console test window or with ApplyGuardrail, then create a version for production. Each policy sits in its own block of the CreateGuardrail request, and every policy that blocks content returns your configured blockedInputMessaging or blockedOutputsMessaging text in place of the content.
| Policy | API block | What it evaluates | Actions | Key limits |
|---|---|---|---|---|
| Content filters | contentPolicyConfig.filtersConfig | HATE, INSULTS, SEXUAL, VIOLENCE, MISCONDUCT in prompts and responses; text and image | BLOCK or NONE; strength NONE, LOW, MEDIUM, HIGH per direction | Different strengths allowed for input and output |
| Prompt attack filter | contentPolicyConfig.filtersConfig, type PROMPT_ATTACK | Jailbreaks, prompt injection and, in the Standard tier, prompt leakage, in tagged user input | BLOCK or NONE; inputStrength only | Input only; TEXT and IMAGE modalities |
| Denied topics | topicPolicyConfig.topicsConfig, type DENY | Topics you define by a short definition and optional sample phrases | BLOCK or NONE per direction | Up to 30 topics; definition 200 characters (Classic) or 1,000 (Standard); up to 5 examples of 100 characters |
| Word filters | wordPolicyConfig (managedWordListsConfig, wordsConfig) | Managed PROFANITY list and custom words or phrases | BLOCK or NONE per direction | Up to 10,000 items, each up to three words; case-insensitive whole-word match |
| Sensitive information filters | sensitiveInformationPolicyConfig (piiEntitiesConfig, regexesConfig) | Built-in PII types and custom regular expressions | BLOCK, ANONYMIZE (mask) or NONE per direction | Regex pattern up to 500 characters; no lookahead or lookbehind |
| Contextual grounding checks | contextualGroundingPolicyConfig, types GROUNDING and RELEVANCE | Model output against a tagged grounding source and query | BLOCK or NONE; threshold 0 to 0.99 | Source 100,000, query 1,000, response 5,000 characters |
| Automated Reasoning checks | Automated Reasoning policy attached to the guardrail | Responses against formal rules extracted from your policy document | Detect only; findings such as VALID, INVALID, TRANSLATION_AMBIGUOUS, TOO_COMPLEX | Source document 5 MB and 50,000 characters; English (US) |
Content filters and the prompt attack filter
- Categories: Hate covers attacks on identity groups; Insults covers demeaning and bullying language; Sexual covers sexual interest or activity; Violence covers glorification or threats of harm; Misconduct covers seeking or giving information about criminal activity or about harming or defrauding others.
- Strength: the strength sets how much is filtered per category. Higher strength blocks more, including more legitimate content, so set it per use case: a customer support bot can run HIGH on Insults on input, while a security research assistant may need MEDIUM on Misconduct to stay useful.
- Images: select the Image modality as well as Text where users can upload images, otherwise image content is not checked by that filter.
- Prompt attack filter: the PROMPT_ATTACK type takes inputStrength, inputAction, inputEnabled and inputModalities only. It detects jailbreaks (attempts to bypass model safety), prompt injection (attempts to override developer instructions) and, on the Standard tier, prompt leakage (attempts to extract the system prompt).
- Input tagging: with InvokeModel and InvokeModelWithResponseStream, wrap user-supplied text in amazon-bedrock-guardrails-guardContent tags with a tagSuffix; NHI Mgmt Group recommends a value generated per request so users cannot close the tag themselves. The developer's system prompt outside the tags is not evaluated, which prevents the filter flagging your own instructions; any user input left outside the tags is not checked at all. With Converse, put user content in guardContent blocks.
- Tool use: content filters do not evaluate toolResult, toolSpec or toolUse.input, so text returned by a tool or retrieved from a document reaches the model unchecked unless you pass it through ApplyGuardrail yourself. This is the main path for indirect prompt injection; see the AML.T0051 LLM Prompt Injection guide.
Denied topics and word filters
Writing denied topics that work
- Name: a noun or short phrase, such as "Investment Advice". Do not describe the topic in the name.
- Definition: one crisp sentence describing the subject, such as questions or information about investing in, selling or acquiring cryptocurrencies. AWS warns against instructions ("Block all content about...") and against negative definitions or exceptions ("All content except medical information").
- Examples: up to five realistic user phrasings. Use phrasing from your own logs, including indirect forms.
- Order: AWS notes that topic order can change outcomes, so keep a regression test set and rerun it whenever topics are added or reordered.
- Not for entities: do not use topics to catch names, competitors or identifiers; use word filters or sensitive information filters.
Word filters
Turn on the managed PROFANITY list for public-facing applications. Custom words match whole words and phrases case-insensitively, so "competitor" does not match "competitors": add plural and variant forms explicitly. A useful pattern from the AWS documentation is to BLOCK a term on input but set NONE on output, which flags rather than blocks responses while you assess impact.
Sensitive information filters
| Group | Built-in types (examples) | Suggested input action | Suggested output action |
|---|---|---|---|
| General | NAME, EMAIL, PHONE, ADDRESS, AGE, USERNAME, PASSWORD, DRIVER_ID, LICENSE_PLATE | ANONYMIZE where the model does not need the value | ANONYMIZE; BLOCK for PASSWORD |
| Finance | CREDIT_DEBIT_CARD_NUMBER, CREDIT_DEBIT_CARD_CVV, CREDIT_DEBIT_CARD_EXPIRY, PIN, INTERNATIONAL_BANK_ACCOUNT_NUMBER, SWIFT_CODE | BLOCK card data and PIN | BLOCK |
| IT | IP_ADDRESS, MAC_ADDRESS, URL, AWS_ACCESS_KEY, AWS_SECRET_KEY | BLOCK AWS keys; NONE for URL until tuned | BLOCK AWS keys |
| Country specific | US_SOCIAL_SECURITY_NUMBER, US_PASSPORT_NUMBER, CA_SOCIAL_INSURANCE_NUMBER, UK_NATIONAL_INSURANCE_NUMBER, UK_NATIONAL_HEALTH_SERVICE_NUMBER | ANONYMIZE or BLOCK by data classification | BLOCK |
| Custom regex | Internal IDs such as booking references, employee numbers or internal token formats | ANONYMIZE | BLOCK for secrets formats |
The suggested actions are NHI Mgmt Group starting points, not AWS defaults. Three documented behaviours shape the design:
- Detection is probabilistic and context-dependent: short fragments are less reliable, so test with full realistic messages.
- Masking applies only to model traffic: model invocation logs keep the original input, and the match field in the guardrail trace contains the original PII by design. Use CloudWatch Logs data protection on the log group and restrict who can read traces.
- Tool payloads are skipped: PII in toolUse.input, toolResult and toolSpec is neither blocked nor masked.
The AWS_ACCESS_KEY and AWS_SECRET_KEY types, plus custom regex for your own API key and token formats, make the filter a last line of defence against an assistant echoing credentials pasted into a chat or retrieved from documents. It does not replace secret scanning at the source; see the Secrets Management Guide.
Contextual grounding checks for RAG
Grounding checks score a response twice: grounding (is every claim supported by the source?) and relevance (does it answer the query?). A response below either threshold is filtered. Thresholds run from 0 to 0.99, and AWS suggests 0.7 for both as a starting point on the Standard tier for conversational or reasoning use cases.
- Tag the inputs: with Invoke APIs use amazon-bedrock-guardrails-groundingSource and amazon-bedrock-guardrails-query tags with a tagSuffix; with Converse and ApplyGuardrail use the grounding_source and query qualifiers. Content qualified only as grounding_source or query is not evaluated by other policies, so add guard_content to the qualifier list if retrieved text should also pass content filters.
- Output only: grounding runs on the response, never on the prompt.
- Tier matters: Classic checks strict grounding in English, French and Spanish and does not support conversational use cases; Standard handles paraphrase and reasoning, needs cross-Region inference and is available in a subset of Regions. Scores differ between tiers, so retest thresholds after a change.
- Streaming caveat: relevance is checked per chunk, so an irrelevant answer may already be on screen before the full response is marked irrelevant.
- Tuning: raise thresholds for high-consequence answers (policy, pricing, medical or legal content) and accept more refusals; lower them for brainstorming tools. Record the threshold per application in your change log.
For Bedrock Knowledge Bases specifics see the Amazon Bedrock Knowledge Bases Security Guide, and for business impact the AI Hallucination Business Risk Guide.
Automated Reasoning checks
Automated Reasoning checks translate a policy document, such as an HR leave policy or a product eligibility rulebook, into formal rules and variables, then test responses against them. They return findings rather than blocking: VALID (consistent with the policy for the content captured by policy variables), INVALID (contradicts the policy), TRANSLATION_AMBIGUOUS and TOO_COMPLEX. Your application decides whether to serve, rewrite or ask the user to clarify.
- Use alongside, not instead of, other policies: AWS states they do not protect against prompt injection, do not detect off-topic content, do not support streaming and may not evaluate encoded input such as Base64.
- Keep policies narrow: one domain per policy; latency grows with the number of variables.
- Availability: as of November 2026 the AWS documentation lists English (US) and seven Regions, with cross-Region inference within the US, EU or Australia geography. Automated Reasoning is not supported in enforced guardrails, so keep it in application-level guardrails.
Tiers, versions, streaming and ApplyGuardrail
| Setting | Options | Choose |
|---|---|---|
| tierConfig.tierName | CLASSIC or STANDARD (grounding defaults to Classic if omitted) | Standard for multilingual applications, code assistants, prompt leakage detection and conversational RAG; Classic where content is English, French or Spanish and data must stay in one Region |
| crossRegionConfig.guardrailProfileIdentifier | Guardrail profile ID | Required for Standard; check that the profile's Regions meet your residency rules |
| guardrailVersion | DRAFT or a numbered version | Numbered versions in production; DRAFT only in test |
| streamProcessingMode | Synchronous (default) or ASYNCHRONOUS | Synchronous for anything user-facing with PII masking; asynchronous only where latency matters more and masking is not needed, since masking is not supported in asynchronous mode |
| ApplyGuardrail source | INPUT or OUTPUT; outputScope FULL for debugging | Use to check retrieved documents, tool results and output from models called outside Bedrock inference APIs |
- UpdateGuardrail replaces the whole policy: include tierConfig every time you update a Standard guardrail, or the tier resets to Classic. Manage guardrails as code (CloudFormation or Terraform) so every field is always sent.
- Selective evaluation: input tags let you skip system instructions and history. They are SDK-only and do not work in the console or playground, so test them in code.
- Reasoning content: reasoning blocks in model responses are excluded from evaluation; do not show raw reasoning to users unchecked.
Making guardrails mandatory
A guardrail named only in application code is advisory. The Amazon Bedrock Security Guide covers the bedrock:GuardrailIdentifier IAM condition key. Enforced guardrails add two further layers:
- Account level: create a numbered version in each Region, then add it under Account-level enforcement configurations or with PutEnforcedGuardrailConfiguration, and confirm with ListEnforcedGuardrailsConfiguration.
- Organisation level: from the management account, create the guardrail and a numbered version, attach a resource-based policy granting bedrock:ApplyGuardrail to member accounts, enable the BEDROCK_POLICY policy type, attach a Bedrock policy to the root, OUs or accounts, and verify with DescribeEffectivePolicy.
- Scope: enforcement covers InvokeModel, InvokeModelWithResponseStream, Converse and ConverseStream, on input and output. selective_content_guarding sets system and messages to selective or comprehensive (both default to comprehensive); model_enforcement lists included and excluded models, for example embedding models.
- Stacking: request, account and organisation guardrails all run and the most restrictive result wins, so an application team can add stricter policies but cannot weaken the central one.
- Cautions: configure every Region you use; a wrong ARN stops inference for affected models; DeleteGuardrail fails by default for an enforced guardrail; usage is billed per enforced guardrail and counts against the calling account's quotas.
Agents need their own handling: associate the guardrail with the agent, as described in the Amazon Bedrock Agents Security Guide.
Implementation: phased rollout
- Define the policy per application: list blocked categories, topics, PII types and grounding needs from the use case and data classification. One guardrail per application class is easier to tune than one for everything.
- Build in code: create the guardrail with every policy set to NONE (detect) on input and output, the blocked messages written, and tierConfig and crossRegionConfig set explicitly.
- Build a test set: 200 or more prompts from real logs, plus known jailbreak and injection samples, PII samples in context and RAG question and answer pairs with expected outcomes. Run it with ApplyGuardrail and outputScope FULL.
- Shadow production traffic: attach the detect-only version to a pilot application, review trace assessments for two to four weeks and record false positive and false negative rates per policy.
- Enforce in stages: switch BLOCK on for prompt attack, PII and the highest-risk categories first, create a numbered version and roll out to one application, then the rest.
- Centralise: once stable, set a baseline guardrail through account or organisation enforcement and leave stricter policies to application guardrails.
- Roll back: point the application back to the previous numbered version (versions are immutable), or switch the failing policy's action to NONE in a new version while you retune. For an enforced guardrail, change the policy to the previous version ARN and confirm with DescribeEffectivePolicy.
Detection and measurement
- What to collect: enable the guardrail trace in inference calls and keep assessments (policy, type, action) per request in a restricted log store; CloudTrail records guardrail configuration changes and, as data events, ApplyGuardrail calls.
- Alert on: UpdateGuardrail, DeleteGuardrail, CreateGuardrailVersion and enforcement configuration changes outside the pipeline; spikes in PROMPT_ATTACK interventions from one principal or session; any AWS_SECRET_KEY detection.
| Metric | Target | Source |
|---|---|---|
| Production inference calls covered by a numbered guardrail version (request or enforced) | 100% | Trace data, enforcement configuration |
| False positive rate per policy on the regression set | Agreed per application, for example under 2% | ApplyGuardrail test runs |
| Known jailbreak and injection samples blocked | Trending up release on release | Regression set |
| Grounding interventions per 1,000 RAG answers | Stable; sudden rises signal index or prompt drift | Trace assessments |
| Guardrail changes made outside the pipeline | Zero | CloudTrail |
Framework mapping
| Guardrail control | Threat or risk | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | OWASP and ATLAS |
|---|---|---|---|---|
| Prompt attack filter with input tagging | Direct and indirect prompt injection, jailbreak | SI-10 Information Input Validation | DE.CM-09 | LLM01:2025 Prompt Injection; AML.T0051, AML.T0054 |
| Prompt leakage detection (Standard) | System prompt extraction | SI-15 Information Output Filtering | DE.CM-09 | LLM07:2025 System Prompt Leakage; AML.T0056 |
| Sensitive information filters | PII and credential disclosure | SI-15 | DE.CM-09 | LLM02:2025 Sensitive Information Disclosure; AML.T0057 |
| Contextual grounding and Automated Reasoning checks | Hallucinated or policy-inconsistent answers | SI-15 | DE.CM-09 | LLM09:2025 Misinformation |
| Versions, guardrails as code, enforcement | Silent weakening of controls | CM-3 Configuration Change Control; AU-12 Audit Record Generation | PR.PS-01 | Supports all of the above |
Common failure patterns
- Untagged user input: an InvokeModel integration sends the whole prompt without guardContent tags, so the prompt attack filter never evaluates the user's text.
- Retrieved and tool content never checked: RAG chunks and tool results bypass content and PII filters; pass them through ApplyGuardrail or tag them with guard_content.
- Tier reset on update: a script calls UpdateGuardrail without tierConfig and the guardrail drops to Classic, losing prompt leakage detection and code coverage.
- Detect left on: policies tuned in NONE mode are never switched to BLOCK, and the dashboards look healthy because nothing is ever blocked.
- PII in logs: masking works for the user, but invocation logs and traces keep the original values and are readable by a wide group.
- Asynchronous streaming with masking: a team switches to ASYNCHRONOUS for latency and masking stops applying.
Practitioner checklist
- Every production application uses a numbered guardrail version, and a baseline guardrail is enforced at account or organisation level in every Region in use.
- User input is wrapped in guardContent tags with a suffix generated per request, and the prompt attack filter is on at a tested strength.
- Retrieved content and tool results are checked with ApplyGuardrail or guard_content qualifiers.
- The tier is set explicitly in code, Standard tier cross-Region routing has been checked against data residency, and every update sends tierConfig.
- Sensitive information filters cover the organisation's PII types, AWS keys and custom regex for internal token formats, with log data protection on invocation logs.
- Grounding thresholds are set and recorded per RAG application and retested after any tier or model change.
- A regression test set runs in the pipeline before every new guardrail version, with false positive and block rates recorded.
- Guardrail changes outside the pipeline and prompt attack spikes raise alerts.
Standards and references
- AWS: Detect and filter harmful content by using Amazon Bedrock Guardrails
- AWS: Block harmful words and conversations with content filters
- AWS: Detect prompt attacks with Amazon Bedrock Guardrails
- AWS: Remove PII from conversations by using sensitive information filters
- AWS: Use contextual grounding check to filter hallucinations in responses
- AWS: Safeguard tiers for guardrails policies
- AWS: Apply cross-account safeguards with Amazon Bedrock Guardrails enforcements
- OWASP: Top 10 for LLM Applications 2025
Related NHI Mgmt Group resources: Amazon Bedrock Security Guide · Amazon Bedrock Agents Security Guide · Amazon Bedrock Knowledge Bases Security Guide · AML.T0051 LLM Prompt Injection