AWS Launches Serverless PII Redaction Using Bedrock Data Automation
New architecture combines foundation models with Step Functions to automate document redaction at scale, achieving 95% recall on handwritten medical forms.
AWS unveils production-ready PII redaction pipeline
AWS has published a detailed architecture for automating personally identifiable information redaction from scanned documents using Amazon Bedrock Data Automation, addressing a persistent compliance challenge for organizations processing medical forms, insurance claims, and financial records at scale.
The solution centers on custom blueprints—structured schemas that define which fields to redact using natural language instructions rather than pattern matching or custom machine learning models. In testing on Attending Physician Statements, the approach achieved 96.5% precision and 95.2% recall across six document quality levels, from clean typed forms to degraded 100-DPI scans with handwritten annotations.
Why it matters
Traditional redaction approaches struggle with the precision problem: distinguishing a patient's date of birth from appointment dates on the same form, or separating patient names from physician signatures in narrative text. Foundation models can interpret document context holistically, understanding field labels and layout without character-level OCR. This matters for regulated industries where manual redaction doesn't scale and compliance exposure from missed PII carries material risk.
Architecture handles 25,000 pages nightly
The serverless pipeline orchestrates five Lambda functions through Step Functions, using nested distributed maps to parallelize processing at both document and page levels. Documents enter through an S3 prefix, get converted to per-page PNG images, then flow through Bedrock Data Automation for detection before black-box redaction is applied at pixel coordinates.
A key design choice improves recall: each API call returns both custom blueprint output and standard word-level extraction. A token-matching step catches repeated PII instances in free-text paragraphs that the blueprint alone might miss, lifting recall from 89.3% to 95.2% with minimal precision trade-off.
Blueprint design requires four scoping questions
Creating an effective redaction blueprint starts with defining what is sensitive (patient name, date of birth), what is not (physician name, examination dates), where it appears on the page, and how to remove it. The example blueprint for medical statements defines 37 fields across 9 field groups, each with explicit inference type and natural-language instructions.
For the patient date of birth field, the instruction specifies "the patient's date of birth in any format" to distinguish it from appointment and signature dates. This scoping allows the foundation model to handle multiple date formats on the same page without over-redacting.
Concurrency settings must align with account-level service quotas for the InvokeDataAutomationAsync API. The architecture supports workloads processing approximately 25,000 pages per night, with Step Functions native redrive capability handling throttle failures.
Redaction overwrites pixel data
Unlike annotation-based approaches where original text remains recoverable beneath an overlay, this pipeline converts normalized bounding box coordinates to pixels, expands each box slightly for variance, and draws filled black rectangles directly over the image data. The covered content is not present in the output file.
The complete architecture details, including Lambda function implementations and Step Functions state machine configuration, were first reported by AWS in a Machine Learning blog post authored by Samantha Stuart and Linda Wang.
This is an original analysis by the Omega editorial team. Source reporting: Automation Watch.
Want systems like this working for your business?
Book a Call