How to Redact PII Before Sending Text to an LLM
A deterministic preprocessing workflow for removing common personal identifiers and credentials before text is sent to an LLM or external agent service.
Short answer
Run text through a deterministic redaction step before the model call, inspect the redaction report, and send only the transformed text downstream. Keep the original text inside the system that is already authorized to hold it.
The failure this prevents
Support tickets, CRM notes, logs, and retrieved documents can contain email addresses, IP addresses, payment-card-shaped values, credentials, or other identifiers. Sending the entire record to a model expands the number of systems that receive it.
Recommended workflow
- Decide which data is necessary for the model’s task.
- Redact common sensitive patterns before the outbound model request.
- Review the finding counts and preserve only the minimum mapping needed by your application.
- Send the redacted text—not the original—to the LLM.
- Apply application-specific rules for identifiers that a general pattern detector cannot recognize.
Working starting point
curl https://api.scrubmytext.com/v1/redact \
-H "Authorization: Bearer smt_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Customer EMAIL_ADDRESS reported an issue from IP_ADDRESS."}'Relevant product: RedactMyText · Browser + REST + MCP
Decision rule
Use the transformed text only after confirming that the task can still be completed without the removed values. Pattern redaction is a first line, not a claim of comprehensive data-loss prevention.
Good fit
- Text is leaving the system that originally collected it.
- The model does not need direct identifiers to perform the task.
- You want a consistent, testable preprocessing step rather than asking the model to hide data itself.
Use another approach when
- The workflow legally and operationally requires the exact identifier downstream.
- You need entity-aware de-identification for domain-specific records; add a specialized DLP or review process.
- You have not mapped where the original and transformed text are retained.
Options compared
| Option | Strength | Important limitation | Best fit |
|---|---|---|---|
| Ask the LLM to redact | Flexible | Sensitive text already reached the model | Not suitable as the pre-transmission control |
| Regex in each application | Customizable | Rules drift across services | Small, stable internal formats |
| Enterprise DLP | Broad policy and discovery capabilities | More setup and cost | Regulated or organization-wide programs |
| RedactMyText | Deterministic browser, REST, and MCP path | Pattern-based and intentionally bounded | Fast preprocessing for common patterns |
Implementation cautions
- Unusual or domain-specific identifiers may be missed.
- False positives can remove text the task needs.
- Do not log the original text merely to debug the redaction step.
Frequently asked questions
Does ScrubMyText train on submitted text?
The product is designed as a deterministic utility rather than an LLM training workflow; review the current privacy page for the exact processing terms.
Can I run it without sending text to the API?
Yes. The browser tool performs its supported redaction workflow locally on the device.
Does redaction make any LLM use compliant?
No. Compliance depends on your data, purpose, contracts, jurisdiction, retention, and the full system design.
Related decisions
Next step
Use the product page for exact limitations and access requirements, then copy the corresponding REST or MCP workflow.