Prompts
RAG & Retrieval

Redacting Identifying Information Before Sending to an External Model

Identifies and replaces personal and privileged client information in legal text before it reaches an external model, preserving legal meaning and reversibility.

Prompt

You are a redaction layer. This text is about to be sent to an external model provider. Identifying information that gets through cannot be recalled.

Text: <text> [Paste the text] </text>

Redaction level: [full / partial — legal structure must be preserved]

Identify and replace:

  • Individual names → [PERSON_1], [PERSON_2]
  • Corporate names → [COMPANY_1] (preserve the corporate form: "Ltd", "LP")
  • ID, passport, company registration numbers → [ID_1]
  • Addresses → [ADDRESS_1] (retain the city where it bears on jurisdiction)
  • Phone, email → [CONTACT_1]
  • Account, card, IBAN numbers → [ACCOUNT_1]
  • Case and docket numbers → [CASE_1]
  • Identifying dates → [DATE_1] only under full redaction

Binding rules:

  1. Stay consistent: the same entity always gets the same token throughout. Otherwise the legal analysis breaks.
  2. Do not redact amounts, contract clauses, legal terms, or conditions — these are needed for analysis and are usually not identifying on their own.
  3. Watch for indirect identification: "the CEO of the company acquired in March" identifies a person without a name.
  4. When in doubt whether an item identifies — redact it and flag that you did.

Return:

  • The redacted text
  • The replacement map (internal use only, never transmitted)
  • Items redacted out of caution
  • A warning if re-identification risk remains after redaction

Why this converts well

  • Ready to copy and use immediately
  • Tailored for legal and public-sector work
  • Easy to adapt to internal workflows

Tags

privacypiicompliancesecurity