Study guide
7.3 Sensitive Information Filters & PII Redaction/Masking
AWS Certified Generative AI Developer - Professional AIP-C01
Track your progress as you read
Finished sections get a check mark.
1 Chapter 1: Exam Overview & Foundation Model Fundamentals
1.1 AIP-C01 Exam Structure, Logistics & Passing Strategy 1.2 AIP-C01 Scoring & Professional Decision Strategy 1.3 Foundation Model Landscape & Model Selection on Amazon Bedrock 1.4 Model Abstraction, Controlled Switching & Resilience 1.5 Customization Spectrum: Prompting vs RAG vs Fine-Tuning vs Continued Pre-training 1.6 Custom Model Deployment & Lifecycle Management
2 Chapter 2: Bedrock Knowledge Bases & RAG Architectures
2.1 Managed RAG Architecture with Bedrock Knowledge Bases 2.2 Knowledge Source Integration, Synchronization & Freshness 2.3 Data Ingestion, Parsing & Chunking Strategies 2.4 Embedding Models & Vector Representations 2.5 Vector Index Scale, Migration & Retrieval Evaluation 2.6 Vector Database Selection: OpenSearch Serverless vs Aurora pgvector vs Managed Stores 2.7 Vector Store Security, Multi-Tenancy & Connectivity
3 Chapter 3: Advanced Vector Search, Indexing & Data Compliance
3.1 Hybrid Search, Metadata Filtering & Semantic Reranking 3.2 Metadata Filtering, Reranking & Query Transformation 3.3 Fine-Tuning & Continued Pre-Training Data Pipeline Engineering 3.4 Data Validation, Multimodal Processing & Model Formatting 3.5 Data Privacy, Data Residency & Compliance Governance 3.6 Privacy Preservation, Source Lineage & Audit Evidence
4 Chapter 4: Prompt Engineering & Bedrock Runtime APIs
4.1 Advanced Prompt Engineering Techniques & Inference Parameters 4.2 Inference Parameters, Prompt Governance & Regression 4.3 Converse API vs InvokeModel API & Message Formatting 4.4 Tool Calling, FM API Resilience & Model Routing 4.5 Streaming Architectures & Asynchronous Event Processing 4.6 Resilient Streaming, Deployment & Asynchronous Processing
5 Chapter 5: Amazon Bedrock Agents & Tool Integration
5.1 Agentic Architecture, ReAct Reasoning Loops & Orchestration 5.2 Agent Frameworks, MCP & Lifecycle Management 5.3 Action Groups, OpenAPI Schemas & AWS Lambda Integration 5.4 Agent Memory, Session State & Multi-Agent Collaboration Patterns 5.5 Persistent State & Multi-Agent Coordination 5.6 Advanced Agent Prompt Templates & Flow Customization 5.7 Agent Safeguards, Tool Reliability & Cost Control
6 Chapter 6: Workflow Orchestration & Application Integration
6.1 Amazon Bedrock Prompt Flows & Visual Orchestration 6.2 Step Functions Orchestration & Human-in-the-Loop Workflows 6.3 Enterprise Integration: API Gateway, AppSync, and EventBridge 6.4 Hybrid Integration, GenAI Gateways & CI/CD Tooling
7 Chapter 7: AI Safety & Guardrails for Amazon Bedrock
7.1 Guardrails Architecture, Denied Topics & Content Filters 7.2 Content Safety, Defense in Depth & Threat Detection 7.3 Sensitive Information Filters & PII Redaction/Masking 7.4 Contextual Grounding Checks & Hallucination Prevention
8 Chapter 8: Security, Access Control & Network Architecture
8.1 IAM Least Privilege & Resource Policies for Bedrock 8.2 PrivateLink VPC Endpoints & Network Isolation 8.3 Encryption with AWS KMS & Cross-Account Access Patterns
9 Chapter 9: Governance, Auditing & Operational Logging
9.1 SageMaker Model Cards & AI Governance Frameworks 9.2 Lineage, Fairness, Transparency & Continuous Governance 9.3 Invocation Logging, CloudTrail Auditing & Observability 9.4 Responsible AI, Bias Mitigation & Red Teaming Methodologies
10 Chapter 10: Performance, Throughput & Cost Optimization
10.1 On-Demand vs Provisioned Throughput & Capacity Planning 10.2 Capacity Measurement, Scaling Patterns & Resilience 10.3 Batch Inference & Bedrock Intelligent Prompt Routing 10.4 Intelligent Prompt Routing & Application Eligibility 10.5 Prompt Caching, Token Optimization & Latency Reduction
11 Chapter 11: Testing, Evaluation & Troubleshooting GenAI Solutions
11.1 Amazon Bedrock Model Evaluation (Automatic & Human Workflows) 11.2 Human, RAG & Continuous Evaluation 11.3 Evaluation Metrics & RAG Quality Benchmarking (Ragas, ROUGE, BLEU) 11.4 RAG and Agent Performance Evaluation 11.5 CloudWatch Metrics, Throttling & Operational Observability 11.6 Quota Diagnosis, Retry Control & Operational Troubleshooting 11.7 Troubleshooting Common GenAI Failure Modes & Agent Traces 11.8 Prompt Maintenance, Content Handling & Deployment Validation
7.3 Sensitive Information Filters & PII Redaction/Masking
Key Takeaways Explain This Topic AI
Sensitive Information Filters in Amazon Bedrock Guardrails detect personally identifiable information (PII) using over 30 AWS-managed entity types or custom regular expressions (regex).
Guardrails provides two mutually exclusive enforcement actions for detected sensitive entities: BLOCK (terminates inference and returns a standardized blocked message) and ANONYMIZE (replaces sensitive data with typed mask tags such as [NAME] or [SSN] while allowing processing to proceed).
Word Filters enforce lexical boundaries through managed profanity filters and custom word lists (supporting exact string matching and wildcards), enabling organizations to block offensive slang, competitors' brand names, or unapproved terms.
The standalone ApplyGuardrail API enables evaluation of arbitrary text payloads against guardrails outside of model generation, allowing organizations to sanitize legacy databases, evaluate multi-modal OCR outputs, or govern non-Bedrock models.
In conversational applications using the Converse or InvokeModel APIs, developers pass guardrailIdentifier and guardrailVersion directly in the request payload, triggering automated input sanitization, model execution, and output redaction in a single managed round-trip.
Last updated: September 2026
7.3 Sensitive Information Filters & PII Redaction/Masking
This independent study guide by ExamFinch helps candidates prepare for the AWS Certified Generative AI Developer - Professional (AIP-C01) examination. Enterprise generative AI applications regularly process customer communications, support transcripts, billing documents, and medical intakes. Inadvertently exposing Personally Identifiable Information (PII) or Protected Health Information (PHI) to foundation model providers, downstream logging systems, or unauthorized users violates global compliance frameworks including GDPR (General Data Protection Regulation), HIPAA (Health Insurance Portability and Accountability Act), and PCI-DSS (Payment Card Industry Data Security Standard).
Amazon Bedrock Guardrails provides Sensitive Information Filters and Word Filters to intercept, redact, or mask sensitive entities in real time. By decoupling sensitive data handling from foundation model logic, developers achieve verifiable compliance without maintaining brittle, bespoke sanitization scripts.
Predefined PII Types vs. Custom Regular Expressions
Bedrock Sensitive Information Filters operate via two complementary mechanisms: AWS-managed entity models and user-defined regular expressions.
1. Managed Predefined PII Types
Amazon Bedrock includes pre-trained entity recognition models covering over 30 standard PII categories across international jurisdictions. Key supported entity types include:
Government Identifiers: US Social Security Number ( US_SOCIAL_SECURITY_NUMBER ), US Individual Taxpayer Identification Number ( US_ITIN ), UK National Insurance Number ( UK_NINO ), US Driver's License ( US_DRIVERS_LICENSE ), Passport Number ( PASSPORT_NUMBER ).
Financial Records: Credit/Debit Card Number ( CREDIT_DEBIT_CARD_NUMBER ), Credit Card CVV ( CREDIT_DEBIT_CARD_CVV ), US Bank Account Number ( US_BANK_ACCOUNT_NUMBER ), US Bank Routing Number ( US_BANK_ROUTING_NUMBER ).
Personal Contact Details: Email Address ( EMAIL ), Phone Number ( PHONE ), Name ( NAME ), Mailing Address ( ADDRESS ).
Digital Identifiers: IP Address ( IP_ADDRESS ), MAC Address ( MAC_ADDRESS ), AWS Access Keys ( AWS_ACCESS_KEY ), AWS Secret Keys ( AWS_SECRET_KEY ).
2. Custom Regular Expressions (Regex)
Managed PII models detect standardized patterns, but enterprise systems frequently utilize proprietary identifier formats. Developers can define custom regex filters within the Guardrail configuration:
Pattern Syntax: Standard Perl-Compatible Regular Expressions (PCRE).
Parameters: Each regex entity requires a unique name, a natural language description explaining what the pattern matches, the regex pattern itself, and the configured action ( BLOCK or ANONYMIZE ).
Common Exam Scenarios:
- Proprietary Employee IDs: ^EMP-[0-9]{6}[A-Z]$
- Medical Record Numbers (MRN): ^MRN-[A-Z]{3}-[0-9]{8}$
- Enterprise Account Numbers: ^ACCT-(?:PREM|STD)-[0-9]{10}$
- Enforcement Actions: BLOCK vs. ANONYMIZE
When a sensitive entity or custom regex is detected in user input or model output, Guardrails executes one of two mutually exclusive enforcement actions:
Dimension BLOCK Action ANONYMIZE Action
Execution Impact Terminates processing immediately; the model is not invoked (on input) or output is completely discarded. Allows processing to proceed; substitutes detected sensitive tokens with entity placeholders.
Return Payload Returns an HTTP 200 response with stopReason: guardrail_intervened and configured blockedMessaging . Returns the sanitized text containing typed mask tags (e.g., [NAME] , [PHONE] , [US_SOCIAL_SECURITY_NUMBER] ).
Model Context Window Zero context exposure. Request is halted. Model receives anonymized placeholders; can still perform reasoning and grammar synthesis.
Primary Compliance Use Case Zero-tolerance scenarios: credit card CVVs, raw passwords, or prohibited health records in non-HIPAA workloads. High-utility workflows: customer support ticket summarization, redaction of chat logs, or sentiment analysis.
Mechanics of the ANONYMIZE Action
When ANONYMIZE is configured on input prompts, Guardrails detects sensitive entities, strips the raw values, and replaces them with standardized bracketed tokens before passing the payload to the foundation model: Raw User Input:
"My name is Alice Smith, my phone number is 555-0199, and my account ID is ACCT-PREM-1234567890. Please summarize my recent bill."
- │
- ▼ (Guardrail Anonymization Engine)
Anonymized Payload Passed to FM:
"My name is [NAME], my phone number is [PHONE], and my account ID is [ACCOUNT_ID]. Please summarize my recent bill."
Because the foundation model operates on the anonymized tokens, raw customer PII is never stored in model cache windows, never reflected in third-party model inference logs, and never logged in downstream analytics.
Word Filters: Managed Profanity & Custom Word Lists
In addition to entity-based PII filtering, Bedrock Guardrails provides lexical controls through Word Filters :
Managed Profanity Filter: A continuously updated, multi-lingual profanity blocklist maintained by AWS. Enabling this single toggle automatically identifies and blocks common vulgarities, offensive slang, and obscene phrases across multiple languages.
Custom Word and Phrase Lists: Organizations can define custom blocklists containing up to 10,000 words or phrases per guardrail. Words can be entered individually or uploaded as a CSV file.
Exact Matching: Blocks literal terms (e.g., internal code names like ProjectZeus ).
Wildcard Matching: Supports trailing wildcards (e.g., competitor* blocks competitor , competitors , competitorapp ).
Use Cases: Blocking competitor brand names, preventing internal project leaks, or suppressing unapproved technical jargon in customer-facing applications.
Runtime API Integration Patterns: Converse vs. ApplyGuardrail
Understanding how to invoke Guardrails programmatically is a core AIP-C01 exam requirement. AWS provides two distinct integration patterns:
Pattern 1: Inline Invocation with the Converse API
When invoking models natively in Amazon Bedrock, developers pass the Guardrail configuration directly in the converse or converse_stream API call. Bedrock automatically orchestrates input evaluation, model invocation, and output evaluation within a single round-trip: import boto3
bedrock_client = boto3.client('bedrock-runtime', region_name='us-east-1')
- response = bedrock_client.converse(
- modelId='anthropic.claude-3-5-sonnet-20240620-v1:0',
- messages=[
- {
- 'role': 'user',
- 'content': [{'text': 'Contact John Doe at john.doe@example.com regarding loan #98765.'}]
- }
- ],
- guardrailConfig={
- 'guardrailIdentifier': 'gr-abc123xyz789',
- 'guardrailVersion': '2', # Production: Always use immutable version
- 'trace': 'enabled' # Captures detailed intervention assessment in response
- }
- )
# Inspect response
if response['stopReason'] == 'guardrail_intervened':
print("Guardrail Block Triggered:", response['output']['message']['content'][0]['text'])
else:
- # If ANONYMIZE was configured, content displays with redacted placeholders
- print("Model Output:", response['output']['message']['content'][0]['text'])
- Pattern 2: Standalone Evaluation with the ApplyGuardrail API
The ApplyGuardrail API provides standalone policy evaluation without invoking a foundation model . It accepts an arbitrary string of text, evaluates it against the specified Guardrail version, and returns the assessment along with redacted or blocked output. response = bedrock_client.apply_guardrail(
- guardrailIdentifier='gr-abc123xyz789',
- guardrailVersion='2',
- source='INPUT', # Specifies whether to evaluate 'INPUT' or 'OUTPUT' policies
- content=[
- {
- 'text': {
- 'text': 'Customer SSN is 000-12-3456 and email is customer@corp.com.'
- }
- }
- ]
- )
- print("Action Taken:", response['action']) # 'NONE' or 'GUARDRAIL_INTERVENED'
- print("Evaluated Output:", response['outputs'][0]['text'])
- # If Anonymize is configured: 'Customer SSN is [US_SOCIAL_SECURITY_NUMBER] and email is [EMAIL].'
- Architectural Use Cases for ApplyGuardrail
Pre-Ingestion RAG Scrubbing: Sanitizing documents in Amazon S3 prior to chunking and embedding into OpenSearch Serverless.
External / Multi-Cloud Model Governance: Applying centralized enterprise AWS safety guardrails to models running on Amazon SageMaker, external REST APIs, or on-premises servers.
Agent Tool Input/Output Validation: Inspecting parameters passed to AWS Lambda functions before executing database updates.
Guardrail Tracing & Observability
When trace: 'enabled' is specified in the runtime configuration, Bedrock returns a comprehensive assessment trace in the API response:
action : Indicates whether the transaction resulted in NONE or GUARDRAIL_INTERVENED .
sensitiveInformationPolicy : Details detected entities, match types, confidence scores, and whether the entity was masked or blocked.
wordPolicy : Details detected profanities or custom blocked terms.
CloudWatch Metrics: Guardrails automatically publishes operational metrics to Amazon CloudWatch under the AWS/Bedrock namespace, including Invocations , InvocationLatency , SensitiveInformationBlocked , SensitiveInformationAnonymized , and WordPolicyBlocked .
Common Exam Traps & High-Stakes Scenarios
Trap: Conflating BLOCK and ANONYMIZE. If an exam scenario states that customer service representatives need to read and respond to emails containing customer phone numbers without exposing the numbers to the foundation model, selecting BLOCK is wrong because it halts the conversation. The correct solution is ANONYMIZE .
Trap: Believing ApplyGuardrail Calls a Model. ApplyGuardrail runs exclusively through the Guardrails policy evaluation engine. It incurs zero foundation model token generation charges and can be used as a standalone data sanitation service.
Trap: Using Custom Word Filters for Entity Detection. Attempting to block employee IDs or SSNs by adding hundreds of patterns to a Custom Word Filter is an antipattern. Custom word filters are for exact phrases and simple wildcards. Complex pattern matching requires Custom Regex under Sensitive Information Filters.
Trap: Logging Unredacted PII in CloudWatch. When Bedrock Invocation Logging is enabled, sensitive data evaluated by Guardrails with the ANONYMIZE action is sanitized before being written to CloudWatch Logs or Amazon S3, preventing compliance violations in operational logging.