Own Weights

PII and third-party AI: redact or run your own model?

PII redaction LLM vs running your own model: what masking catches, what it misses, and which option fits your data, risk and accuracy needs today.

Updated

PII redaction for an LLM masks personal data, such as names, emails and account numbers, before a prompt goes to a third-party API. Running your own model keeps the raw text inside your environment, so there is nothing to mask on the way out.

Redaction is quick to add. It is still a filter, and filters miss things, so the right choice depends on your data and the accuracy you need. For a closer look at detection, see PII redaction before an LLM.

Can I send customer data to an AI API?

Only if your contract, the vendor’s terms and your own data policy allow it for that data type. Vendors publish their own rules on retention, logging and training, and those rules differ by plan. A term that lets a vendor keep prompts for debugging is a different risk from one that does not, so check the rule for the plan you actually use, in writing.

Redaction can reduce what leaves your environment. It does not turn a prohibited transfer into an allowed one.

What does PII redaction catch, and what does it miss?

Most redaction tools are good at patterns. They find email addresses, phone numbers, card numbers and national ID formats, and many named people and places.

They are weaker on context. A diagnosis written in plain words, a party described only by role, or a customer you can identify from a job title, a city and a purchase date can all pass through untouched. Treat redaction as a reduction step, not a guarantee, and sample its output on your own documents before you trust it.

How does redaction change what the model sees, and what it gets right?

A typical flow detects personal data, swaps each item for a placeholder, sends the text to the model, then maps the placeholders back in the answer. The model sees less identifying text, which can help. It also loses information. A model asked to match two contracts by party name loses the names it needs once both have become [PERSON_1] and [PERSON_2].

Hypothetical, with round numbers: a 10-page agreement has 40 party references. Redaction turns all 40 into placeholders. If the detector misses 2 of them, those names go to the vendor in clear text, and the answer still has to be mapped back to the right party.

Masking also removes signal that some tasks depend on. Contract review needs party names to track obligations. Conflict checks need names to match. Medical coding needs the wording of the diagnosis. When a masked field is needed for the answer, accuracy drops, and the drop is quiet, because the output still reads fluently. Measure accuracy with masking on and off, using a test set built from your own records.

Redaction vs running your own model

Option Does raw text leave your environment? Main risk Main cost
Redact, then call a vendor API Yes, with personal data masked Missed identifiers and lower accuracy Vendor usage fees, plus masking work
Send raw text under a vendor contract Yes Contract terms and vendor retention Vendor usage fees
Run an owned model in your cloud account or on-prem No You own the evals, updates and upkeep Training, plus running capacity

Running your own model is not automatically safer. It moves the data boundary, but access control, logs and storage rules still have to be set and checked. Redaction, by contrast, needs no training run, which is why it is the usual first step.

To test redaction on your own records, have someone mark every personal detail by hand on a sample, including details described in context rather than by pattern, and count what the tool missed by type, since a missed card number and a missed diagnosis are different failures. Then run the task on raw and masked text from the same records, and if masking costs more accuracy than the business can accept, redaction alone is not the answer for that task. The full method is in how to build a test set.

When redaction is the right choice

Redaction is a reasonable first step when the vendor is already approved for the data, when only a few fields are sensitive, and when accuracy does not depend on those fields. It is the wrong place to stop when the text is full of context-heavy personal data, or when a customer or regulator expects raw records to stay in your environment.

Owning a model is the wrong choice for a small, rare task. Evals and upkeep may cost more than the calls it replaces. For how the data question plays out across the whole stack, read LLM data privacy: where your prompts go and private LLMs for companies that can’t send data out.

Start by listing every call that carries personal data. The free AI cost audit reads your code on your own machine, makes no network calls while it reads, uploads nothing, and lists the AI calls it finds, which is the starting point for working out where data goes. To talk through which tasks should stay in-house, book a call through the Own Weights site.

Questions

Can I send customer data to an AI API?

Only if your contract, the vendor's terms and your own data policy allow it for that data type. Read the vendor's current rules on retention, logging and training for the plan you use. Get sign-off from your legal and security team before any customer records leave your environment, redacted or not.

What does PII redaction before an LLM call catch?

It catches patterned data such as email addresses, phone numbers and card numbers, and many named people and places. It misses personal details described in context, like a diagnosis in plain words. Test it on a sample of your own documents before you rely on it.

Is redaction safer than a self-hosted LLM?

They solve different problems. Redaction limits what a third party sees, while a self-hosted model keeps the raw text inside your environment under your own controls. Redaction is faster to start, but it still sends masked text to someone else.

How do you handle sensitive data and LLMs together?

Decide which tasks need raw text, route those to a model you run in your own environment, and mask the rest. Keep a log of which calls carry personal data, and test both paths on a sample of your own records before you decide.

Does masking PII hurt LLM accuracy?

It can. Placeholders remove the names and identifiers a model may need for matching, and they change how the text reads. Measure accuracy with and without masking on your own test set before you commit to either path.