Skip to main content

Function: redactForAi()

redactForAi(text): string

Defined in: src/lib/recruiting/parse.ts:57

Replace direct identifiers in text with stable placeholder tokens, so the model never receives raw email/phone/PRC numbers. Returns the redacted text. Idempotent for already-redacted tokens.

NOTE: this redacts what a regex can find (email/phone/PRC#). It does NOT remove names — those require the structured extraction step and a human/privacy review. Do not treat redaction alone as sufficient for cross-border processing.

Parameters

text

string | null | undefined

Returns

string