Skip to content
mentoor

Topic 2 of 5 · 4 min read

Personal data in logs, traces and eval sets

Goal: Find the personal data and secrets in an LLM trace and say where it is stored and who can read it.

Every prompt and answer you log is a copy of your users' data, and each copy has its own readers, its own lifetime and its own risk.

Check yourself · 1 of 3

Why can an LLM trace store be a privacy risk even if the chat app is secure?

Choose one answer

Why it matters

Teams add AI observability tools so they can debug bad answers. These tools, such as Langfuse, LangSmith or plain application logs, often save the full prompt, the full answer and the tool calls. That is useful for engineers. It also means a customer's medical question, an address, a pasted contract or an API key now sits in a second system. The chat window looked private. The trace is not.

Copies also spread. A trace may be exported to a spreadsheet, added to an evaluation set to test future models, or sent to a third-party vendor. The OWASP guidance on logging says to avoid recording sensitive data and to protect and limit the lifetime of what you keep.

How to inspect a trace

Take one real trace and ask five questions.

  1. What is in it? Names, emails, phone numbers, account numbers, health or money details, secrets such as tokens that a user pasted.
  2. Where is it stored? Your database, a vendor's cloud, a developer's laptop, a shared drive.
  3. Who can read it? Everyone in engineering? Contractors? The vendor's staff?
  4. How long does it live? Days, a year, forever by default.
  5. Where did it get copied? Eval sets, bug tickets, chat messages, screenshots.

Write the answers down. The gaps are your risks.

Before and after

Before: A trace store keeps every prompt for ever, all 40 engineers can open it, and a failing case was pasted into a public bug ticket with the customer's full address.

After: Traces keep 30 days, only the on-call team can open them, emails and phone numbers are masked on the way in, and bug tickets link to a trace id instead of copying the text.

What goes wrong

  • Secrets in logs. A user pastes a password into a chat. It lands in the trace, then in a backup.
  • Eval sets with real people. A set built from production chats is shared with a contractor, and it holds real names.
  • Vendor copies. The tracing vendor stores data in another country or keeps it longer than your policy says.
  • Debug mode left on. Verbose logging added during an incident is never turned off.

A short code branch for engineers shows the shape of a trace:

{
  "trace_id": "t_8841",
  "input": "My card 4111 1111 1111 1111 was charged twice, I am Dana Lee",
  "output": "Sorry Dana, I can see two charges of 49.00",
  "retention_days": null
}

This one trace holds a card number, a full name and no expiry date for the record.

Examples

The pasted password

A user wrote 'my Wi-Fi password is hunter2, can you help me set up my router' to a bot. The full message was kept for a year in a trace tool open to the whole team. Fix: mask known secret patterns before storage and keep traces for 30 days.

The eval set that travelled

An engineer exported 500 real chats to test a new model and shared the file with an outside agency. It held names and order numbers. Fix: build eval sets from redacted or synthetic chats and track who has them.

Key points

  • A trace store is a second copy of user data and needs its own owner, access list and retention period.
  • Check each trace for personal data, pasted secrets, storage place, readers, lifetime and copies.
  • Eval sets built from real chats carry real people's data into every place the set is shared.
  • Vendor tracing tools add another party that holds your users' text.
  • Debug logging turned on during an incident must be turned off again.

Common mistakes

  • Logging full prompts and answers by default because it is the easiest setting.
  • Assuming only the chat window holds user data and forgetting the trace store.
  • Copying failing traces into tickets and chat messages with real names in them.
  • Never asking how long the vendor keeps the data.

Check yourself · 2 of 3

A failing support chat is pasted into a public bug ticket with the customer's address. What is the better practice?

Choose one answer

Check yourself · 3 of 3

Which question is NOT part of inspecting a trace for data risk?

Choose one answer

Practice items, not counted towards your mastery.

Start here