From a53edbe011e664ee81256ab5be5501ba25f6cc85 Mon Sep 17 00:00:00 2001 From: asteier2026 Date: Thu, 2 Jul 2026 08:46:05 -0700 Subject: [PATCH] feat: enhance augment prompt to handle disguised identifiers Adds an 'Additional extraction requirements' block covering verbatim span extraction and detection of identifiers written as digit words (phone/SSN/credit card numbers) or letter-by-letter name spellings. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: asteier2026 --- .../engine/detection/detection_workflow.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/anonymizer/engine/detection/detection_workflow.py b/src/anonymizer/engine/detection/detection_workflow.py index c01ff781..17122c5c 100644 --- a/src/anonymizer/engine/detection/detection_workflow.py +++ b/src/anonymizer/engine/detection/detection_workflow.py @@ -670,6 +670,24 @@ def _get_augment_prompt(*, data_summary: str | None, labels: list[str], strict_l <> +Additional extraction requirements: +- The "value" field must be the EXACT verbatim span from the input text. + Copy the text character-for-character exactly as it appears. + Do NOT normalize, correct spelling, expand abbreviations, decode encodings, + infer hidden values, translate text, reformat numbers, or otherwise modify + the extracted span. +- Extract only text that is explicitly present in the input. + Never reconstruct, guess, or generate a value that does not appear verbatim. +- Identifiers may be disguised, fragmented, hyphenated, misspelled, obfuscated, + spaced out, mixed with punctuation, or written in words instead of digits. + Detect the identifier and extract the exact text as written. + Examples of disguised identifiers to detect: + - Phone numbers, SSNs, and credit card numbers spoken as digit words, + including "o" or "oh" used in place of zero: + "nine o two, five five five, one two three four" + - Names spelled out letter by letter with hyphens or commas: + "J-O-H-N", "M, A, R, Y" + --- Input text: <> Already-detected entities: <>