Personally identifiable information (PII) detection is the process of finding values or passages that identify a person or can reasonably be linked to one. An email address or government identifier may identify someone directly. A date of birth and postal code might identify someone only when combined with other data. Define which identifiers and combinations matter for each dataset, jurisdiction, and destination. PII detection is one part of sensitive-content detection: a secret API key is sensitive even if it does not identify a person, and text containing PII can be neutral in tone and raise no content-safety concerns.
Detectors use patterns, checksums, dictionaries, field metadata, or language models that interpret surrounding text. A pattern might flag a string with the shape of a phone number, while context helps distinguish a phone number from an order reference. Structured data can often be inspected using column names and value profiles; free text usually needs contextual analysis. Scanned documents may need optical character recognition first, and extraction errors can cause misses. A text detector commonly returns an entity category and a character span, sometimes with a confidence score. When applying spans to redact text, use the same text representation and offset convention as the detector so that Unicode characters or normalization changes do not shift the replacement.
Place detection at boundaries where a finding can change what happens next. A support application might scan ticket text before sending it to a model or analytics pipeline, replace email addresses with placeholders, and keep the original ticket in a restricted system. If the application also scans generated responses, that second check can catch identifiers introduced from retrieved records or tools; it does not undo a disclosure that already occurred when constructing the prompt. Scheduled scans of stored data serve a different purpose: they can uncover personal data in old exports, logs, and overlooked storage locations. Avoid copying raw matches into alerts or scan logs, and verify where submitted data is processed and whether the detector retains it.
Choose categories, supported languages and locales, and thresholds based on the destination and the cost of mistakes. A workflow that publishes text externally may favor higher recall and send uncertain matches for review; aggressive redaction in an internal search index can remove useful information. A confidence score is not a guarantee or necessarily a calibrated probability. Measure precision and recall by category and language on representative labeled data, including ambiguous values and extraction errors. Sampling can reduce scan cost, but a clean sample does not establish that an entire dataset is free of PII. For inline checks, decide explicitly whether a timeout blocks the transfer, queues it for review, or permits it under a documented policy.
Detection produces findings; it does not by itself redact, delete, or secure the data. A separate policy determines whether to mask a match, block a transfer, restrict access, or route a record for review. Even correctly masking direct identifiers does not necessarily anonymize a record: remaining attributes may still identify someone, and reversible tokens can preserve a link to the original. Treat a scan as one control alongside data minimization, access restrictions, and retention limits, not as proof that a dataset is safe to share.