Home › AWS › AWS data services › Comprehend

AWS data services · ML and AI · about 10 min read

Amazon Comprehend (incl. PII detection)

Ready-made text analysis on AWS: finds personal data, entities, key phrases, language and sentiment in free text, with no model to train.

RoleML and AI
StatusGenerally available. Topic modeling, event detection and prompt safety classification are closed to new customers (announced 31 Mar 2026; AWS suggests Bedrock models and Guardrails instead). Other features, including PII detection, are unaffected. PII detection supports English and Spanish only.
Verdict on this sitePursue with care
AzureAzure AI Language (PII detection, entities, sentiment)
Google CloudCloud Natural Language and Sensitive Data Protection
Databricksai_mask, ai_extract and ai_classify SQL functions, and data classification in Unity Catalog
Open sourceMicrosoft Presidio with spaCy models
Verdict: Pursue with care. A candidate personal-data detector for free text such as warranty notes, behind a port. It covers English and Spanish only, so German or other EU text needs another detector, such as Presidio, and stays out of bronze until one is confirmed.

In plain words

What it is

Free text is any field where people type what they like: a warranty note, a service ticket, a store manager's comment, a call-centre summary. It is useful, and also risky, because people type names, phone numbers, email addresses and account numbers into it. Structured columns can be checked by name; free text has to be read.

Amazon Comprehend is an AWS service that reads text with models AWS has already trained. You send text and get back what it found. The feature this platform cares about is PII detection. PII means personally identifiable information. Comprehend returns each piece of personal data it found, such as a name, address, phone number, email or bank account, with its type, position in the text and a confidence score. It can also return a copy of the text with those pieces masked. Other features find general entities, key phrases, the language of the text and sentiment, and you can train custom classifiers and custom entity recognisers.

A concrete example: a dealer writes, 'Customer Anna Silva, phone 555 0182, reports sidewall bulge after 3,000 km on the left front tyre.' Before that note enters bronze, the lander sends it to Comprehend. Comprehend returns a NAME at characters 9 to 19 and a PHONE at 27 to 35, each with a confidence above 0.99. The lander swaps both for tokens. Bronze stores, 'Customer [NAME_7f3a], phone [PHONE_91c2], reports sidewall bulge after 3,000 km on the left front tyre.' The real values go only to the separate token vault.

Comprehend has limits that matter. PII detection works in English and Spanish only. Synchronous calls accept up to 100 KB of text, and batch jobs up to 1 MB per document. Some older features are closed to new customers.

A trained proofreader at the door who underlines every name and phone number in a letter before it is filed, but who reads only English and Spanish.

Big picture

Where it fits

SourcesMove inStreamStoreProcessServeUseAcross everything: catalog · security · orchestration · observability and cost · infrastructure as codegets data fromhands data toTransfer FamilyAppFlowLander reading free-text fields from landingComprehendML and AIBronze tables with tokenised textToken vault (real values only)Macie

The lit lane is where Comprehend works. Boxes on the left feed it; boxes on the right use what it produces.

Comprehend sits at the very start of the data path, inside the lander that moves files from landing to bronze, although its group on this site is ML. The platform's privacy rule is 'tokenise at the door'. The lander swaps names, phone numbers and emails for tokens before bronze, so bronze, silver and gold never hold real personal values. Structured columns are tokenised by their declared PII tags. Free-text fields, such as warranty notes, go through a personal-data detector behind a port.

The port is the key design choice. The lander calls an internal interface, 'find personal data in this text in this language', and an adapter does the work. Comprehend is one adapter. Because the plants and dealers write in English and German, the platform design says the detector must handle both. Comprehend covers English and Spanish, so a second adapter, such as Presidio with German models, is needed for German text. Until that is confirmed, EU free text is held out of bronze.

Downstream, Macie scans the landing buckets weekly for personal data in the wrong place, as a safety net. Unity Catalog's data classification and column masks protect structured columns. Comprehend is the targeted tool for the one place structured rules cannot reach: the inside of free text.

How it works

The ideas you need

IdeaWhat it means
PII entityA piece of personal data found in text, such as NAME, ADDRESS, PHONE, EMAIL or BANK_ACCOUNT_NUMBER, with its position and a confidence score.
DetectPiiEntitiesThe synchronous call that returns the PII entities found in one document of up to 100 KB.
ContainsPiiEntitiesA cheaper synchronous call that says only which PII types appear, without positions.
Redaction jobAn asynchronous PII job over files in S3 that writes masked copies of the text back to S3.
Confidence scoreA number from 0 to 1 for how sure the model is; you pick a threshold above which you mask.
Synchronous and asynchronousSynchronous calls answer one request at once; asynchronous jobs process many files in S3 and finish later.
Custom classifier and custom entity recogniserModels you train on your own labelled examples, for example to tag warranty notes by failure type.
Port and adapterAn internal interface the platform calls, with Comprehend as one replaceable implementation behind it.

Choosing

When to use it, and when not

Use it when

  • You must find personal data inside English or Spanish free text before it enters the lakehouse.
  • You want a managed detector with no model to host, called from a Lambda or a lander job inside the AWS account.
  • You have large backlogs of text files in S3 to mask once, where an asynchronous redaction job fits.
  • You need key phrases, entities or language detection on support tickets or reviews, and a general model is good enough.
  • You want a custom classifier for a fixed set of labels, such as failure categories, trained on a few thousand examples.

Avoid it when

  • The text is in German, French, Italian or another language Comprehend's PII detection does not support.
  • You are a new customer who needs topic modeling, event detection or prompt safety classification; those are closed to new customers.
  • Personal data is in structured columns with known names; tag and tokenise those directly, which is cheaper and certain.
  • You need open-ended extraction such as 'which part failed and why'; an LLM through the model port does it better.

Production grade

What goes wrong in production

ProblemWhat breaksWhat to do
Language gapsGerman dealer notes go to Comprehend, which supports only English and Spanish PII detection, and names pass through unmasked.Detect language first, route each language to an adapter that supports it, and hold any text with no supported adapter out of bronze.
Missed personal dataA detector misses a name spelled oddly or a phone number in a local format, so real data reaches bronze.Set a low confidence threshold for masking, add pattern rules for local formats, and let Macie scan landing as a second check.
Over-maskingTyre model names or plant names are tagged as person names and masked, so engineers lose useful words.Keep an allow list of product, plant and part names, and review a sample of masked notes each month with the data owner.
Size limitsA long service report exceeds 100 KB and the synchronous call fails.Split text into chunks on sentence boundaries, or use an asynchronous job, which accepts up to 1 MB per document.
Throttling at peakA big backlog of notes arrives after a holiday, and synchronous calls are throttled.Use asynchronous jobs for backlogs, add retries with backoff in the lander, and alarm on throttled requests.
Features closed to new customersA design that relies on Comprehend topic modeling or event detection cannot be built in a new account.Use a Bedrock model or a Databricks AI function for topics and events, behind the same port.

Alternatives

What to compare it with

AlternativePick the alternative whenPick Comprehend when
Microsoft Presidio (open source)You need German or other languages, custom recognisers, and full control, running in your own jobs.You do not want to run and tune models and pattern rules yourself.
Databricks AI functions such as ai_maskText is already in a governed table and you want masking in SQL, with the model choice made in Databricks.Text must be masked before it is ever written to a table.
Amazon Bedrock with Guardrails' PII filterYou already call an LLM on the text and want masking in the same step, or need more languages.You want a cheap, deterministic-like detector at high volume.
Amazon MacieYou want to scan S3 buckets on a schedule to find personal data in the wrong place.You need to mask text inline before it lands in bronze.
Azure AI Language PII detectionYou are on Azure, or need its wider language list.You need everything inside the AWS account.
Google Sensitive Data ProtectionYou are on Google Cloud.You are on AWS.

Cost

How you pay

Comprehend charges per unit of 100 characters of text processed, with a minimum charge of three units per request, and different prices for each feature. ContainsPiiEntities is priced lower than DetectPiiEntities. Asynchronous jobs are charged on the same text units. Custom models also charge for training time, model storage and, for real-time use, endpoints billed per inference unit per second. Check the Comprehend pricing page for current prices in your region.

What drives the bill

  • Total characters of free text sent each month.
  • Number of requests, because of the per-request minimum on short notes.
  • Which features run on each text, since each is billed separately.
  • Custom classifier endpoints left running.

Cost traps

  • Sending every short field one call at a time pays the minimum charge again and again.
  • Running PII detection on text that has already been masked upstream.
  • Custom classifier endpoints bill per second even when idle.
  • Running both ContainsPiiEntities and DetectPiiEntities on every note when one call is enough.

Prices change; check the AWS pricing page for your region before deciding.

Security and governance

Keeping it safe

  • Call Comprehend through a VPC interface endpoint from the lander's private subnet so text does not cross the internet.
  • Grant the lander role only the PII calls it needs, and give asynchronous jobs a data access role limited to the landing and output prefixes.
  • Encrypt asynchronous job input, output and custom model volumes with customer managed KMS keys.
  • Do not log the raw text or the detected values; log only counts, types and a record id.
  • Delete landing files with personal data one day after the lander reads them, as the platform's privacy rules require.
  • CloudTrail records Comprehend API calls; include the lander's role in the quarterly access review.

Operating it

What to watch, and the limits

WatchWhy
SuccessfulRequestCountCalls that worked, per operation; should track the volume of free-text records.
ThrottledCountThrottled synchronous calls; rising values mean the lander needs backoff or batching.
ClientErrorCount and ServerErrorCountFailed calls, such as oversized documents or unsupported languages.
Records held out of bronzeNotes held because their language has no supported detector; this should fall to zero once a second adapter is live.
PII found per 1,000 notesFrom the lander's run log; a sudden drop may mean the detector stopped working.
Macie findings in landingPersonal data that the detector missed, found by the weekly Macie scan.
LimitValue and notes
PII detection languagesEnglish and Spanish only
Synchronous document size100 KB of UTF-8 text for entities and PII detection
Asynchronous document size1 MB per document; up to 5 GB per job
Asynchronous jobsUp to 10 active jobs per operation
Closed featuresTopic modeling, event detection and prompt safety classification closed to new customers

Limits and quotas checked 2026-11-11; many can be raised through Service Quotas.

Decisions

Situations and verdicts

SituationChoiceVerdict
English warranty notes from UK and US dealersComprehend DetectPiiEntities in the lander behind the detector port, tokens before bronzePursue with care: fits well; keep a low threshold and a Macie safety net.
German warranty notes from EU dealersPresidio with German models as a second adapter, or hold the text out of bronze until one is confirmedDrop Comprehend for this text: it does not support German PII detection.
Group ten thousand notes into topicsA Bedrock model or Databricks ai_classify over tokenised silver textDrop Comprehend topic modeling: closed to new customers.
Mask a one-off backlog of old service reports in S3Comprehend asynchronous PII redaction job to a new prefix, then delete the originalsPursue: simple and cheap for English text.

FAQ

Questions people ask

Which languages does Amazon Comprehend PII detection support?

English and Spanish. Other Comprehend features, such as general entity detection, support more languages, but PII detection and redaction do not. Route other languages to another detector.

Is Amazon Comprehend being discontinued?

No. Three features, topic modeling, event detection and prompt safety classification, are closed to new customers, and AWS suggests Bedrock models and Guardrails for them. PII detection, entities, key phrases, sentiment and custom models remain available.

Comprehend or Macie for finding personal data?

Macie scans S3 buckets on a schedule and reports where personal data sits. Comprehend reads text you send it, at once, so you can mask before storing. This platform uses both: Comprehend in the lander, Macie as the weekly check on landing.

Can Comprehend mask PII automatically?

Yes. An asynchronous PII job can write redacted copies of text files to S3, replacing each found entity with its type or a mask character. For inline tokenising, call DetectPiiEntities and replace the spans yourself.

How accurate is Comprehend PII detection?

It is good on common English formats, but no detector is perfect. Measure it on a labelled sample of your own notes, choose a low threshold for masking, and keep a second check downstream.

Sources

Checked against

Checked 2026-11-11.

Related

Where it connects

AWS and Databricks reference platform · Ingestion design · Amazon Macie · Amazon Bedrock · Medallion architecture · All AWS data services

← Bedrock · SageMaker AI →