Concept · Builds on AIF-C01
Masking, redaction and anonymization
Find personal data with Comprehend and Macie, and mask, hash or generalize it before use.
You know from AI Practitioner
- Macie finds sensitive data in S3.
- Guardrails can filter sensitive information in live traffic.
- Training data should not leak personal information into a model.
Comprehend
- Works on
- Text files and strings
- What it does
- Detects and redacts PII
Macie
- Works on
- S3 buckets
- What it does
- Finds sensitive data
DataBrew, Glue
- Works on
- Columns in a pipeline
- What it does
- Masks, hashes, encrypts
Bedrock Guardrails
- Works on
- Live prompts and replies
- What it does
- Masks or blocks PII
| Tool | Works on | What it does |
|---|---|---|
| Comprehend | Text files and strings | Detects and redacts PII |
| Macie | S3 buckets | Finds sensitive data |
| DataBrew, Glue | Columns in a pipeline | Masks, hashes, encrypts |
| Bedrock Guardrails | Live prompts and replies | Masks or blocks PII |
Redaction
- Result
- Removed or masked
- Reversible
- no
Hashing
- Result
- One-way digest
- Reversible
- no
Tokenization
- Result
- Token, mapping in a vault
- Reversible
- yes
Generalization
- Result
- Less precise value
- Reversible
- no
| Method | Result | Reversible |
|---|---|---|
| Redaction | Removed or masked | no |
| Hashing | One-way digest | no |
| Tokenization | Token, mapping in a vault | yes |
| Generalization | Less precise value | no |
1 / 2
Redaction
- Result
- Removed or masked
- Reversible
- no
Hashing
- Result
- One-way digest
- Reversible
- no
Tokenization
- Result
- Token, mapping in a vault
- Reversible
- yes
| Method | Result | Reversible |
|---|---|---|
| Redaction | Removed or masked | no |
| Hashing | One-way digest | no |
| Tokenization | Token, mapping in a vault | yes |
2 / 2
Generalization
- Result
- Less precise value
- Reversible
- no
| Method | Result | Reversible |
|---|---|---|
| Generalization | Less precise value | no |
What it is
Finding comes first. Amazon Comprehend detects PII entities in text, such as names, addresses and card numbers, with DetectPiiEntities for one text or an asynchronous job for many files. The job can also redact: it replaces each entity with a mask character or with its entity type. Amazon Macie scans S3 buckets for sensitive data and reports findings, but it does not change the data. DataBrew PII transforms and the Glue Detect PII transform find and mask columns inside a pipeline. Bedrock Guardrails sensitive information filters mask or block PII in prompts and responses at runtime.
What it is
Then choose how to protect the value. Redaction removes it or replaces it with a fixed mask. Hashing replaces it with a one-way digest, so equal values stay equal and joins still work. Tokenization swaps the value for a random token and keeps the mapping in a secure vault, so authorized users can reverse it. Generalization makes a value less precise, such as age 34 to 30 to 39, or a full postal code to its first digits. Anonymization means a person can no longer be identified, even with other data. Hashing and tokenization are pseudonymization, because the link can come back.
What it is
Mask early, in the curated zone, before data goes to training or to shared notebooks, and keep the raw zone locked down.
Remember
- Comprehend: detect and redact PII in text, in real time or in jobs.
- Macie: finds sensitive data in S3. It reports and does not change data.
- DataBrew and Glue transforms mask columns inside pipelines.
- Guardrails sensitive information filters protect live prompts and responses.
Remember
- Hash keeps joins. Tokenization is reversible. Generalization reduces precision.
On the exam
- “Replace names and card numbers in a large set of text files” points to a Comprehend PII redaction job.
- “Which S3 buckets contain personal data” points to Amazon Macie.
- “Keep joins working but hide the email value” points to hashing.
In this task · 1.2
Glue ETL
DataBrew
EMR
Data Wrangler
SageMaker Processing
Athena
Feature Store
- Transforming streaming data
- Feature engineering techniques
- Embedding models for text and image
- Text pre-processing and tokenization
- Preparing documents for RAG
- Masking, redaction and anonymization
- Data for fine-tuning, continued pre-training and distillation