StoryboardAI Engineering

Masking private data

Swapping sensitive details for placeholders before text reaches the model or the logs.

What is masking private data?

Messages from real people contain card numbers, addresses and phone numbers. Every system the message passes through, the model provider, the logs, a saved conversation, is another place that detail could leak from.

So before the text goes anywhere, the app finds sensitive details and replaces each with a placeholder such as [CARD_1], keeping the real value in a locked table of its own. The model works perfectly well with the placeholder.

On the way back, the app can restore just enough for the reply to make sense, such as the last four digits. The rule behind it is simple: the model should receive what it needs to do the job, and nothing more.

Sensitive values are replaced before they travel.Step 1: A message with a card number. Step 2: Code replaces it with a placeholder. Step 3: The masked text goes to the model. Step 4: Logs hold the placeholder only.1A message with acard number2Code replaces itwith a placeholder3The masked textgoes to the model4Logs hold theplaceholder only
Sensitive values are replaced before they travel.

Why does masking private data matter?

People type card numbers, addresses and health details into chat boxes without thinking. Once that text is sent to a model provider or written to a log, it has spread to places it should never be. Masking sensitive values before they travel keeps private data from leaking through your own system.

How does masking private data work?

  1. Before text leaves your server, code scans it for sensitive patterns: card numbers, emails, phone numbers.
  2. Each match is replaced by a placeholder, such as [CARD].
  3. The masked text is what goes to the model and into logs.
  4. If the real value is needed later, it is kept in a secure store and reinserted only at the last step.

When should you use masking private data?

Use it when

  • People can type anything into your product
  • Conversations are logged or reviewed by staff
  • Rules or contracts limit where personal data may go

Think twice when

  • The model genuinely needs the value to do the task. Then limit where it goes afterwards instead

Where does masking private data sit in a real system?

Masking runs on your own server, on the way in before the model call and again before anything is written to a log or shown to a reviewer.

What goes wrong with masking private data?

  • Masking what goes to the model and forgetting the logs.
  • Relying on a model to spot private data when a pattern would be exact.
  • Masking so aggressively that order numbers disappear too.

What does masking private data look like in practice?

A customer pastes a card number into a chat. The server replaces it with [CARD] before the message is sent to the model or logged. The model replies that card details are not needed in chat. The number never left the shop's server.

Watch it happen

These stories show masking private data at work, one step at a time.