Two-pass PII redaction with multi-country pattern packs
Pass 1: deterministic regex with Nordic/European/ECHR/Global packs covering fødselsnummer, Swedish personnummer, Danish/Finnish CPR, UK NI, French INSEE, IBAN, EU phones, ECHR application numbers, DOB, and national ID label patterns. Pass 2: LLM semantic scan (Azure OpenAI) finds names, orgs, places and identifying descriptions missed by regex. Runs on pre-redacted text so no raw PII reaches the LLM. Adds region selector (Nordic/European/ECHR/Global) to the Redact UI. Falls back gracefully when Azure is not yet configured. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-3
@@ -8,7 +8,9 @@ dbnToolsRequireAuth();
|
||||
$input = dbnToolsJsonInput(70000);
|
||||
|
||||
dbnToolsWithTelemetry('redact', '', function () use ($input): array {
|
||||
$text = dbnToolsString($input, 'text', 32000);
|
||||
$mode = (string)($input['mode'] ?? 'standard');
|
||||
return (new DbnLegalToolsService())->redact($text, $mode);
|
||||
$text = dbnToolsString($input, 'text', 32000);
|
||||
$mode = (string)($input['mode'] ?? 'standard');
|
||||
$region = dbnToolsNormalizeRegion($input['region'] ?? 'nordic');
|
||||
$language = dbnToolsNormalizeLanguage($input['language'] ?? 'en');
|
||||
return (new DbnLegalToolsService())->redact($text, $mode, $region, $language);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user