bedrock pii redaction · sensitive-information filters · 2026

Bedrock PII redaction — detect, block, and mask sensitive data.

A focused, neutral reference for the one Amazon Bedrock Guardrails control that regulated teams care about most: the sensitive-information filter. How it detects PII in prompts and responses, the difference between blocking the request and masking/redacting the value, the built-in entity types, custom regex for your own identifiers, applying it on Converse/InvokeModel, to Agents and Knowledge Bases, and standalone over any model via the ApplyGuardrail API — plus how it maps to HIPAA, PCI DSS, and GDPR, how it combines with model-invocation logging and encryption, how to test it, the real limitations, and a reference architecture for regulated workloads.

entity types
built-in + custom regex
directions screened
prompt + response
actions
block or mask
cost to build
$0 with credits
TL;DR
  • Bedrock PII redaction is the sensitive-information policy inside Amazon Bedrock Guardrails. It detects personally identifiable information — names, emails, phone numbers, addresses, national-ID and credit-card numbers, and more — in both the user prompt and the model response, and per entity type you choose to either block the interaction or anonymize it (mask/redact the value with a placeholder like {EMAIL} so the conversation can continue).
  • You are not limited to the built-in entity list. Custom regular-expression patterns let you detect organization-specific identifiers — medical-record numbers, policy IDs, internal account numbers, claim references — and apply the same block-or-mask action. The same guardrail enforces the policy on direct model calls, on Bedrock Agents and Knowledge Bases, and — via the ApplyGuardrail API — on models that do not run on Bedrock at all, which makes the redaction layer portable across your whole stack.
  • Redaction is a technical control, not a compliance certificate: it supports HIPAA, PCI DSS, and GDPR obligations (data minimization, preventing PHI/cardholder data from being stored or returned) but must be paired with encryption, IAM least-privilege, and careful logging — and it is AWS-credit-eligible, so CloudRoute routes you to the credit pool plus a vetted partner who builds the regulated workload, and it costs $0 to build.
the concept

IWhat Bedrock PII redaction is — and where it sits

A foundation model will happily echo a Social Security number a user pasted into a prompt, or surface a phone number it retrieved from a document. PII redaction is the Bedrock Guardrails control that stops sensitive values from flowing where they should not — in either direction — without you writing detection code.

Bedrock PII redaction is the behavior of the sensitive-information filter, one of the policy types inside an Amazon Bedrock Guardrail. A guardrail is a named, model-independent policy object that Bedrock evaluates against every interaction; the sensitive-information policy is the part of it that finds personally identifiable information and acts on it. Like every guardrail policy, it runs on both directions — the user input (someone pasting a customer's card number into a chat) and the model output (the model emitting an email address it read from a retrieved file).

The word "redaction" is doing specific work here. When the filter detects a sensitive value it can do one of two things: block the entire interaction (the request never reaches the model, or the response is withheld, and the user sees a message you configured), or anonymize it — what most people mean by "redaction" or "masking" — where the value is replaced in place with a placeholder token such as {EMAIL}, {PHONE}, or {SSN}, and the rest of the interaction proceeds. Anonymizing is what lets a support assistant keep helping a user who happened to include their phone number, while ensuring that number is never stored, logged, or returned verbatim.

Because the guardrail is a separate object from the model, the redaction policy is portable and auditable: it is defined in one place, it is the same no matter which foundation model the request hits, and it can be versioned and shown to a reviewer. This page is a deep dive on this single policy. For the full survey of every guardrail filter type — content filters, denied topics, word filters, contextual grounding — see the amazon-bedrock-guardrails sibling; this page assumes that context and goes deep on PII specifically.

the one-line definition

Bedrock PII redaction is the sensitive-information policy in a Bedrock Guardrail: it detects PII (built-in entity types plus your own regex) in both the prompt and the response, and per type either blocks the interaction or masks the value in place with a placeholder — so sensitive data never reaches the model, the logs, or the user.

what it detects

IIBuilt-in PII entity types — and custom regex for your own identifiers

Detection is only as good as the things you tell it to look for. Bedrock ships a managed list of common PII entity types and lets you extend it with regular expressions for the identifiers that are specific to your business.

The sensitive-information filter recognizes two kinds of things: a managed set of built-in PII entity types, and any custom regular-expression patterns you define. You enable the entity types relevant to your workload and pick an action for each; you do not have to take the whole list.

Built-in PII entity types

Bedrock maintains detectors for the categories of PII that show up across most applications. These broadly fall into a few groups: general personal identifiers (name, email address, phone number, physical/mailing address, age); government and national IDs (US Social Security number, passport number, driver's-license number, and country-specific national identifiers); financial data (credit/debit-card number, card expiry and CVV, bank-account and routing numbers, SWIFT/IBAN); and technical identifiers (IP address, MAC address, URL, AWS access keys, and similar). The exact set evolves and varies by region, so treat any list as representative and confirm the currently supported entity types and regional coverage in the AWS Bedrock Guardrails documentation.

Each enabled entity type gets its own action — you can block on credit-card numbers (you never want one in the system at all) while choosing to mask names and emails (so conversations keep flowing). That per-type granularity is the point: the right policy is rarely "block everything" or "mask everything," it is a deliberate matrix of which identifiers are intolerable versus which are acceptable once anonymized.

Custom regex — your organization-specific identifiers

The built-in list covers common PII, but every regulated business has identifiers that are private and specific to it: medical-record numbers (MRNs), insurance policy or claim IDs, internal customer/account numbers, case references, member IDs. For these you define a custom regular-expression pattern in the guardrail, give it a name and an action (block or mask, with your own placeholder), and the filter applies it exactly like a built-in type — on both input and output. This is how you close the gap between "PII the world recognizes" and "the sensitive identifiers that exist only in your domain."

A custom regex is deterministic literal-pattern matching, which makes it predictable and cheap but only as good as the pattern. An MRN format like an 8-digit number is easy; something with looser formatting needs care to avoid both misses (a real MRN that does not match) and false hits (an unrelated number that does). The disciplined approach is to write the pattern from the actual format spec, then validate it against a corpus of real and decoy values during testing (covered in section VI).

bedrock sensitive-information detection · built-in vs custom · 2026
Detector kindExamplesHow it decidesActions availableBest forLimitation
General identifiersName, email, phone, address, ageManaged detectionBlock or maskEveryday PII in chat/formsNames are context-dependent
Government / national IDsSSN, passport, driver's licenseManaged detectionBlock or maskKYC, healthcare, gov workloadsRegional coverage varies
Financial dataCard number, CVV, IBAN, routing #Managed detectionBlock or maskPCI-scoped flowsBlock is usually safer than mask
Technical identifiersIP, MAC, URL, access keysManaged detectionBlock or maskLogs, secrets hygieneIPs can be legitimately needed
Custom regexMRN, policy ID, account #, claim refYour regular expressionBlock or mask (your placeholder)Org-specific identifiersOnly as good as the pattern
Enable only the entity types your workload needs and set a per-type action. Built-in detectors handle common PII (set evolves; confirm in AWS docs); custom regex handles identifiers unique to your domain. All run on both prompt and response.
the core decision

IIIBlock vs redact (mask) — what each does and when to choose it

The single most important configuration decision for this filter is, per entity type, whether to block the interaction or anonymize the value. They produce very different user experiences and very different risk profiles.

Both actions prevent the sensitive value from being exposed; they differ in what happens to the interaction around it.

Block — refuse the whole interaction

With the block action, detecting the entity stops the interaction: an offending prompt never reaches the model, and an offending response is withheld; the caller receives the blocked-message text you configured (you can set different messages for the input and output directions). Block is the right choice for data you never want in the system at all — for many teams, full credit-card numbers (PCI), or in some designs any national-ID number. The trade-off is user experience: a single stray value rejects the whole turn, which can frustrate legitimate users who included something innocuous-looking.

Redact / mask (anonymize) — keep the interaction, hide the value

With the anonymize action (mask/redact), the interaction proceeds but the detected value is replaced in place with a placeholder token — for example {EMAIL}, {PHONE}, {NAME}, or a custom tag for a custom regex. On the input side this means the model receives the prompt with PII already masked, so the raw value never reaches the model context at all; on the output side it means any PII the model produced (e.g., from retrieved content) is masked before it is returned. The conversation keeps flowing, which is why masking is the usual default for common identifiers like names, emails, and phone numbers in customer-facing assistants. The trade-off is that a masked value is, by design, gone — if downstream logic genuinely needed the real phone number, masking will have removed it, so masking belongs on the values you want to protect, not the ones the workflow depends on.

block vs redact (mask) · behavior and trade-offs
ActionWhat happens to the turnDoes the model see the value?User experienceChoose it for
BlockInteraction refused; configured message returnedNo — request never proceedsHard stop on the whole turnData that must never be present (e.g. card numbers / PCI)
Redact / maskInteraction continues; value replaced with placeholderNo — sees the placeholder, not the raw valueSeamless; conversation flowsCommon PII you want protected, not blocked (names, emails, phones)
Both actions stop exposure; block sacrifices the turn, mask preserves it. Input-side masking is notable for privacy: the raw PII is removed before it ever enters the model context. Mask only values you want to protect, never values the downstream workflow actually needs.
a practical default

Block the values that must never exist in the system (often full card numbers / PCI data); mask the everyday identifiers you want to protect but that should not kill a conversation (names, emails, phones, addresses). Set it per entity type — the right policy is a deliberate matrix, not one global switch. Remember masking on the input side means the model never even sees the raw value.

where it runs

IVApplying the redaction policy: model calls, Agents, RAG, and non-Bedrock models

A redaction policy is only useful if it covers every path data can take. Because the sensitive-information filter lives in a model-independent guardrail, the same policy reaches direct model calls, autonomous agents, retrieval pipelines, and even models outside Bedrock.

There are three ways the same PII policy gets enforced, and for regulated workloads you typically use more than one.

Inline on Converse / InvokeModel

The standard pattern: pass the guardrail ID and version on the Converse or InvokeModel call. Bedrock runs the sensitive-information policy on the input before the model sees it (masking or blocking PII in the prompt) and on the output before it returns to you (masking or blocking PII in the response). Because the guardrail is model-independent, the identical redaction policy applies whether the request goes to Claude, Amazon Nova, Llama, or Mistral — you can change models without re-implementing PII handling.

On Agents and Knowledge Bases (RAG)

Attach the guardrail to a Bedrock Agent and the redaction policy screens every step of the agent's loop — user input, and the model output at each turn — which matters because agents read tool outputs and retrieved documents that can contain PII the user never typed. The same logic applies to Knowledge Bases / RAG: retrieved passages may carry PII from your source corpus, so screening the output catches a model that would otherwise surface, say, a customer's address pulled verbatim from an indexed document. For PII specifically, RAG is a common leak vector precisely because the sensitive data enters via retrieval rather than via the user — see the rag-on-aws and amazon-bedrock-knowledge-bases siblings.

Standalone over any model — the ApplyGuardrail API

The ApplyGuardrail API evaluates a piece of text against the guardrail and returns the assessment — what was detected, what was masked, whether it was blocked — without invoking a model. For PII redaction this is powerful in two ways. First, you can sanitize text at any point in your own pipeline: scrub a document before it is indexed into a Knowledge Base, redact a record before it is written to a log or a ticket, validate user input at the edge. Second, it lets you put Bedrock's PII redaction in front of models that are not on Bedrock — a SageMaker endpoint, a self-hosted open-weight model, or a third-party API — by calling ApplyGuardrail on the text before and after the external call. The redaction policy becomes a portable privacy layer over your entire AI stack, not just the Bedrock-hosted parts.

regulatory mapping

VHow redaction maps to HIPAA, PCI DSS, and GDPR

PII redaction is frequently the control that makes a generative-AI feature shippable in a regulated context. The mapping to the major regimes is direct, but the boundary of what the control does and does not cover has to be stated honestly.

The sensitive-information filter speaks the language regulators care about: detect the protected data, and prevent it from being stored, logged, or returned. How that maps:

  • HIPAA — protected health information (PHI) — Detecting and redacting identifiers such as names, addresses, dates, national IDs, and — via custom regex — medical-record numbers supports data-minimization and helps keep PHI out of prompts, logs, and responses. Bedrock is offered with an AWS compliance posture that includes services in scope for HIPAA eligibility under a BAA (confirm current scope on AWS's compliance pages); the redaction policy is one technical control within that program, not the whole of HIPAA compliance.
  • PCI DSS — cardholder data — Built-in detection of card numbers, expiry, and CVV lets you block (the usual choice) or mask cardholder data so it is never placed in the model context, the conversation logs, or the output — directly supporting the PCI principle of minimizing where cardholder data lives. Redaction reduces scope; it does not by itself make a system PCI-compliant.
  • GDPR — personal data and data minimization — GDPR's data-minimization and storage-limitation principles map cleanly onto masking PII before it is processed or persisted. Redacting personal data on the input side means the model never processes the raw identifier, and masking on the output side keeps it out of what you store and show. It supports — but does not replace — lawful-basis, data-subject-rights, and DPA obligations.
  • SOC 2 — auditable change control — Because guardrails are versioned, you can evidence which redaction policy was in force at any time and demonstrate it was enforced on every interaction — the kind of change-control and control-operation evidence a SOC 2 assessor looks for.

The honest caveat, repeated because it matters: a guardrail is a technical control, not a certification. HIPAA, PCI DSS, and GDPR are organizational programs — BAAs and DPAs, scoping, access controls, encryption, logging, breach processes, audits — and PII redaction is one part. Treat it as defense-in-depth alongside the controls in the next section, not as something you can fully outsource the regulatory risk to.

what a reviewer actually wants to see

Three things the redaction policy provides: a single defined place the PII-handling rules live, evidence the rules ran on every input and output, and a version history proving which policy was in force when. PII redaction maps to HIPAA/PCI/GDPR data-minimization; versioning maps to SOC 2 change-control. It is a control, not a certificate.

logging + encryption + architecture

VICombining redaction with logging controls, encryption, and a reference architecture

Redaction does not exist in isolation. The two places teams most often undo their own redaction are logging and storage — and the fix is to think of redaction, logging, and encryption as one design.

The most common self-inflicted leak in a regulated GenAI build is logging the raw data before it was redacted. Bedrock can capture model-invocation logging (the inputs and outputs of model calls, sent to Amazon CloudWatch Logs and/or Amazon S3), which is invaluable for debugging and audit — but if you log the raw request and then redact, you have a copy of the unredacted PII sitting in your logs. Order and ownership matter.

  • 1 — Detect at the edge with ApplyGuardrail (optional but strong) — For the strictest designs, run user input and any to-be-indexed documents through ApplyGuardrail first, so PII is masked before it touches your application logic, your RAG index, or your logs.
  • 2 — Enforce inline on every model call — Attach the guardrail (with the sensitive-information policy) to every Converse/InvokeModel call and to every Agent, so both prompt and response are screened regardless of which model is used.
  • 3 — Screen retrieved content (RAG) — Because retrieval can surface PII from your corpus, rely on the output-side policy — and consider redacting the source documents at ingestion — so a Knowledge Base cannot leak indexed personal data.
  • 4 — Make logs redaction-aware — Persist the masked form, restrict and encrypt any log that could hold raw input, and scope retention. If using Bedrock model-invocation logging, lock down and encrypt the destination and confirm what it captures.
  • 5 — Encrypt and least-privilege everything around it — KMS encryption on storage that touches model I/O, IAM scoped to only the roles that need invoke/read, network controls as appropriate.
  • 6 — Version the guardrail in IaC — Define the redaction policy as code, publish numbered versions, reference a specific version at inference time — your auditable, roll-back-able PII policy artifact.

Make logging respect the redaction boundary

Design so that what gets persisted is the redacted form. With input-side masking, the value is already a placeholder by the time it enters the model context, which helps — but you still control your own application logs, and those are where raw user input most often lands. Treat any log that could contain pre-redaction text as in-scope sensitive data: restrict it with IAM least-privilege, encrypt it, set tight retention, and prefer logging the guardrail-processed (masked) text over the raw text. If you enable Bedrock model-invocation logging, lock down and encrypt the destination bucket/log group and scope retention deliberately — confirm exactly what the logs capture relative to your guardrail in the AWS docs.

Encrypt, scope access, and keep the guardrail as code

Redaction reduces what sensitive data exists, but the data that does exist still needs the standard controls: encryption at rest and in transit (including KMS-managed keys for the buckets/log groups that touch model I/O), IAM least-privilege so only the services and roles that must invoke the model and read the logs can, and VPC/network controls as appropriate. And because the guardrail is the place your PII policy lives, define it in infrastructure-as-code, publish numbered versions, and reference a specific version at inference time — so the redaction policy is reviewable, roll-back-able, and auditable rather than buried in a console.

the failure mode to design out

The classic mistake: redact for the user, but log the raw request for "debugging." Now the unredacted PII lives in CloudWatch/S3 and is in audit scope anyway. Persist the masked form, encrypt and lock down anything that could hold raw input, and confirm what Bedrock model-invocation logging captures relative to your guardrail.

testing the control

VIITesting the redaction layer — recall, precision, and a regression suite

A PII filter that is never tested is a liability dressed as a control. Both failure modes — letting real PII through, and over-redacting legitimate text — are real, and only testing tells you where you sit.

Before relying on the redaction policy, exercise it. The Bedrock console provides a test window where you submit sample inputs and responses against a draft guardrail and see exactly what is detected, what is masked, and what is blocked — without wiring it into your application. The discipline is to go beyond ad-hoc clicks and build a labelled test set you can run repeatedly (scriptable through the API, including ApplyGuardrail):

  • Positive cases (must be caught) — Real-format examples of every entity type you enabled — emails, phones, addresses, SSNs, card numbers — and decoy-laden text for each custom regex (real MRNs, policy IDs). These measure recall: does the filter catch what it must?
  • Negative cases (must NOT be caught) — Benign text that looks PII-adjacent — order numbers that resemble card numbers, dates that resemble IDs, common words that resemble names. These measure precision: how often does it over-redact and harm legitimate use?
  • Both directions — Test PII in the prompt (does input-side masking remove it before the model?) and PII in simulated responses / retrieved passages (does output-side screening catch model- or RAG-emitted PII?).
  • Custom-regex stress tests — Validate each pattern against the real format spec plus near-miss decoys, since a regex is exactly as good as it is written — this is where misses and false hits concentrate.
  • Keep it as a regression suite — Re-run the set every time you change the policy, add an entity type, or bump the guardrail version, so a tuning change does not silently open a hole. Pair it with monitoring of real traffic for over-redaction complaints.

The goal is the right balance: high enough recall that real PII does not slip through, high enough precision that you are not masking order confirmations into uselessness. You will not hit perfect on either — so for high-stakes flows keep a human escalation path and layer redaction with the storage/logging controls above rather than treating it as the only line of defense.

the honest edges

VIIILimitations — what PII redaction does not do

The sensitive-information filter is strong and worth defaulting to for anything that touches personal data, but it is bounded. Deploying it well means knowing the edges.

  • Detection is not perfect — misses and over-redaction both happen — Managed detectors can miss unusually formatted or obfuscated PII and can over-flag benign look-alikes; custom regex is exactly as good as the pattern. Tuning and testing narrow the gap but never close it — plan for both failure modes.
  • Context-dependent entities are hardest — Names in particular are inherently ambiguous (a name can be an everyday word), so name detection is less clear-cut than, say, a card number. Lean on custom regex and structured handling where the format is well-defined, and test names against your real content.
  • Language and region coverage varies — Coverage of PII types and quality of detection can differ across languages and regions, and national-ID support varies by country. Test with your actual languages and locales rather than assuming uniform coverage; confirm supported entities per region in AWS docs.
  • It does not encrypt or govern your data — Redaction reduces exposure in model interactions; it does not encrypt storage, manage IAM, control your logs, or run your audits. Those are separate controls — redaction is one layer of defense-in-depth, necessary for many regulated cases, sufficient for none on its own.
  • Masking is destructive by design — A masked value is gone. If a downstream step genuinely needs the real value, masking will have removed it — so mask only what you mean to protect, and architect any legitimate need for the raw value separately and securely.
  • It adds a little latency and cost per call — Screening input and output is extra work on every request. It is usually modest, but for ultra-low-latency or extreme-volume paths it is worth measuring. PII detection is typically one of the cheaper guardrail policies, but it is not free.
the bottom line on scope

PII redaction is the right default for any GenAI workload that touches personal or regulated data — but it is one technical control. Pair it with encryption, IAM least-privilege, redaction-aware logging, testing, and the rest of your compliance program. It makes regulated GenAI feasible; it does not make it automatically compliant.

side by side

Block vs redact (mask) vs custom regex — the decision matrix

A scannable summary of how the sensitive-information policy behaves under each action and detector kind: what happens to the turn, whether the model ever sees the raw value, and what to choose it for. Use it to set a per-entity-type policy rather than one global switch.

ConfigurationWhat it doesModel sees raw value?Conversation continues?Tunable?Best for
Built-in type → blockRefuses the interaction; returns your messageNoNo — turn stopsPer entity typeData that must never exist (cards / PCI)
Built-in type → maskReplaces value with a placeholder in placeNo — sees the placeholderYesPer entity typeCommon PII to protect (name, email, phone)
Custom regex → blockRefuses on your pattern matchNoNo — turn stopsYour pattern + actionIntolerable org IDs
Custom regex → maskMasks your pattern with your placeholderNo — sees the placeholderYesYour pattern + actionOrg IDs to protect (MRN, policy ID)
Input-direction policyScreens the prompt before the modelNo (if masked/blocked)Depends on actionYesStopping users leaking PII in
Output-direction policyScreens the response (incl. RAG content)n/aDepends on actionYesStopping the model emitting PII out
Both block and mask prevent exposure; block sacrifices the turn, mask preserves it and removes the raw value before the model. Set actions per entity type and per direction. Custom regex extends detection to identifiers unique to your domain — exactly as good as the pattern you write.
before you put PII near a model
Get AWS credits that cover Bedrock — and a partner who builds the redaction + compliance right (you pay $0)
Get matched in 24h →
a recent match

A PCI- and HIPAA-conscious claims assistant, built compliant on $0 — anonymized

inquiry · seed-stage insurtech, Austin
Seed-stage health-insurance startup, 16 people, building a member-facing claims assistant over policy and claims documents

Situation: The team wanted a member-facing assistant that could answer questions about claims and benefits from their own documents, but members routinely paste sensitive data into chat — card numbers when asking about a payment, Social Security numbers, and the company's own member IDs and medical-record numbers — and the retrieved policy/claims documents themselves contained PII. They were operating in a HIPAA- and PCI-conscious environment, could not let card numbers or PHI land in their logs or be echoed back, needed something they could show a security reviewer, and did not want to burn seed runway on inference while still pre-revenue.

What CloudRoute did: CloudRoute matched them in under 24 hours to an AWS partner with healthcare/fintech and Bedrock experience. The partner built the assistant on a Knowledge Base over the documents and put a single Bedrock Guardrail in front of it, configured around the sensitive-information policy: credit-card numbers, CVV, and SSN set to block (never tolerated); names, emails, phone numbers, and addresses set to mask on both input and output; and custom regex patterns for member IDs and medical-record numbers set to mask with dedicated placeholders. They ran ApplyGuardrail at ingestion to scrub the documents before indexing, made application logs persist only the masked form and encrypted the model-invocation-logging destination with a tight retention window, scoped IAM to least-privilege, built a labelled positive/negative test set (real values plus near-miss decoys) and tuned against it, then versioned the whole guardrail in infrastructure-as-code and referenced the version explicitly. The partner also filed a Bedrock POC credit application plus an Activate application to fund the build.

Outcome: Card numbers and SSNs were blocked outright, names/emails/phones/addresses and the custom member-ID and MRN patterns were masked in both directions, retrieved documents could not surface PII, and raw sensitive data never reached the logs — giving the team a single versioned redaction policy to put in front of their reviewer. Inference, the knowledge base, and Guardrails were fully covered by the approved AWS credits, so the build ran at $0 out of pocket. CloudRoute's commission was paid by the partner from AWS engagement funding, not by the customer.

PII policy: block cards/SSN · mask names/emails/phones + custom MRN & member-ID regex · scrubbed at ingestion · redaction-aware logging · versioned in IaC · credits: POC + Activate · out-of-pocket: $0

faq

Common questions

What is Bedrock PII redaction?
It is the behavior of the sensitive-information filter inside an Amazon Bedrock Guardrail. The filter detects personally identifiable information — names, emails, phone numbers, addresses, national-ID and credit-card numbers, and more — in both the user prompt and the model response, and per entity type it either blocks the interaction or redacts/masks the value in place with a placeholder (like {EMAIL}) so the conversation can continue. Because the guardrail is model-independent, the same redaction policy applies across any model on Bedrock, to Agents and Knowledge Bases, and — via ApplyGuardrail — to models outside Bedrock.
What is the difference between blocking and redacting (masking) PII?
Block refuses the whole interaction when PII is detected — the offending prompt never reaches the model, or the response is withheld, and the user sees a message you configured. Redact/mask (anonymize) keeps the interaction going but replaces the detected value in place with a placeholder token, so the conversation continues without exposing the data. Block is for values you never want in the system at all (often full credit-card numbers); mask is for common identifiers you want to protect without killing the conversation (names, emails, phones). You set the action per entity type. Notably, input-side masking means the model never even receives the raw value.
What PII types can Bedrock Guardrails detect?
A managed set of built-in entity types covering general identifiers (name, email, phone, address, age), government/national IDs (SSN, passport, driver's license, and country-specific IDs), financial data (card number, CVV, IBAN, bank/routing numbers), and technical identifiers (IP, MAC, URL, access keys). The exact list evolves and varies by region — confirm the currently supported types in the AWS Bedrock Guardrails documentation. You enable only the ones you need and set a per-type action.
Can I redact custom identifiers like medical-record numbers or account numbers?
Yes. Beyond the built-in types you can define custom regular-expression patterns for organization-specific identifiers — medical-record numbers, insurance policy or claim IDs, internal account/member numbers — give each a name, a placeholder, and an action (block or mask), and the filter applies them on both input and output exactly like a built-in type. A custom regex is deterministic literal matching, so it is only as good as the pattern; write it from the real format spec and validate it against real and decoy values when you test.
Does PII redaction work for RAG and for non-Bedrock models?
Yes to both. Attach the guardrail to a Bedrock Agent or use it alongside a Knowledge Base and the output-side policy screens PII that appears in retrieved content — a common leak vector, since the sensitive data enters via retrieval rather than the user. For models that are not on Bedrock (a SageMaker endpoint, a self-hosted model, or a third-party API), the ApplyGuardrail API evaluates and redacts a piece of text without invoking a model, so you can screen input and output around the external call. You can also use ApplyGuardrail to scrub documents before indexing them.
Does Bedrock PII redaction make me HIPAA, PCI, or GDPR compliant?
It supports those programs but does not by itself certify compliance. Detecting and redacting PHI and personal data supports HIPAA and GDPR data-minimization; detecting and blocking cardholder data supports PCI DSS scope reduction; and guardrail versioning provides SOC 2-style change-control evidence. But each regime is an organizational program — BAAs/DPAs, scoping, encryption, IAM, logging, breach processes, audits — of which redaction is one technical control. Bedrock is offered with an AWS compliance posture (including services in scope for HIPAA eligibility under a BAA and SOC reports — confirm current scope on AWS's compliance pages); you still architect and operate the rest.
How do I keep redacted data out of my logs?
Design logging to respect the redaction boundary. The most common self-inflicted leak is logging the raw request "for debugging" and then redacting — which leaves unredacted PII in your logs and in audit scope. Persist the masked form, restrict any log that could hold raw input with IAM least-privilege, encrypt it (KMS), and set tight retention. If you enable Bedrock model-invocation logging (to CloudWatch Logs and/or S3), lock down and encrypt the destination and confirm exactly what it captures relative to your guardrail. Input-side masking helps because the value is already a placeholder before it enters the model context.
How do I test that PII redaction actually works, and what does it cost?
Use the console test window to try inputs and responses against a draft guardrail, then build a labelled regression suite: positive cases (real-format PII of every enabled type plus custom-regex examples) to measure recall, negative cases (benign look-alikes) to measure precision, and cover both directions. Re-run it on every policy or version change, and monitor real traffic for over-redaction. On cost, the sensitive-information policy is billed on the text evaluated on top of model tokens and is typically one of the cheaper guardrail policies — usually a small fraction of total cost, though it scales with traffic. It is AWS-credit-eligible: CloudRoute routes you to the credit pool (Activate up to $100K, Bedrock/GenAI POC $10K–$50K, GenAI Accelerator up to $1M) and a vetted partner who builds the regulated workload, so it costs $0 to build. Confirm current rates on the AWS Bedrock pricing page.

Stop reading about PII redaction — get the compliant build funded

Whatever your PII-redacting, HIPAA/PCI/GDPR-conscious GenAI workload would cost on Bedrock, AWS credits can cover it. CloudRoute routes you to the right credit pool (Activate up to $100K, Bedrock POC $10K–$50K, GenAI Accelerator up to $1M) and a vetted AWS partner who builds it right — sensitive-information filters, custom regex, redaction-aware logging, encryption, the audit trail. Customer pays $0.

matched within< 24h
GenAI credit ceilingup to $1M
cost to you$0
Bedrock PII Redaction — detect, block & mask sensitive data · CloudRoute