Sub topic 3
Redaction and Pseudonymization Before You Prompt
Assume you know your workplace’s data classifications and approved AI tools. Redaction removes sensitive values, such as email addresses, before text leaves your system. Pseudonymization replaces identifying values with consistent tokens and keeps the mapping inside your organization.
Prepare the prompt
Send only the information needed for the task. Remove account numbers, contact details, and unrelated case history. Redaction is useful when the exact value does not matter. Pseudonymization is useful when the AI must refer to the same person more than once.
import re
EMAIL = re.compile(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")
PHONE = re.compile(r"\+?\d[\d\s().-]{7,}\d")
def redact(text: str) -> str:
text = EMAIL.sub("[EMAIL]", text)
return PHONE.sub("[PHONE]", text)
def pseudonymize(text: str, names: list[str]) -> tuple[str, dict[str, str]]:
mapping = {}
for number, name in enumerate(names, start=1):
token = f"CUSTOMER_{number}"
mapping[token] = name
text = text.replace(name, token)
return text, mapping
text = "Ana Diaz reported an error. Contact her at [email protected]."
masked, mapping = pseudonymize(text, ["Ana Diaz"])
print(redact(masked))
# CUSTOMER_1 reported an error. Contact her at [EMAIL].Agents, connectors, and output
An AI agent may read files, query a customer system, or send messages. A plugin or connector can expand that access beyond the chat window. Check which data each integration can read and which actions it can take. Use the smallest permission set available.
Treat output as untrusted. Check it for copied customer details, invented facts, and hidden identifiers before saving or sending it. Store approved output only in systems with the required access controls and retention period.
If data is exposed
Stop sharing the conversation or file. Do not delete evidence unless your incident process tells you to. Record what was sent, when, to which tool, and who could access it. Notify your security, privacy, or incident-response contact immediately. Follow their instructions for containment and customer notification.
Build a team habit
Before prompting, ask:
- Is this customer data?
- What is the minimum needed?
- Is the tool approved for this classification?
- Are retention, training use, sharing, and connector permissions acceptable?
- Did I review the output before storing or sending it?
Exercise
You need an AI tool to summarize a complaint containing a customer’s name, email, and order number. What should you do first?
Show answer
Remove or replace the identifiers, confirm the tool is approved for the remaining classification, and review the output for leakage before using it.