Part 8 — Production Observability
Privacy and trace retention
Everything this part told you to log — prompts, responses, user inputs — is often exactly the data you have a duty to protect. This chapter resolves the tension between observability and privacy: capture what debugging needs while redacting, limiting retention, and controlling access, so your trace store doesn't become your biggest liability.
This part has spent five chapters urging you to log more — full traces, assembled prompts and raw responses, user behaviour. Now the reckoning: that data is often the most sensitive your company holds — real user inputs and model outputs, frequently containing personal, confidential, or regulated information. Observability and privacy pull in opposite directions, and resolving that tension responsibly — capturing what debugging needs without hoarding a liability — is a required part of running an LLM system, not an afterthought.
What you will understand by the end
- Why observability data is uniquely sensitive, and the tension it creates.
- The main controls: redaction, retention limits, access control, and consent.
- How to keep debugging value while shrinking privacy risk.
- Why this is a design decision made with the tracing, not bolted on later.
The tension: the data you need is the data you must protect
The cruel overlap: the prompt and response you most need for debugging is the user's actual input and the model's actual output. A support system's traces contain customer details; a medical assistant's contain health data; a coding assistant's contain proprietary source. So "log everything for observability" directly conflicts with "minimise the sensitive data you hold." Both are real obligations, and you can't simply pick one — you engineer the overlap.
Observability data is your most valuable debugging asset and your largest privacy liability at the same time, because it's the same data. The goal is not to log less indiscriminately — that blinds you — but to capture what debugging needs while governing it: redact what you don't need in the clear, keep it only as long as useful, and let only the right people see it.
The controls
Four levers turn "log everything" into "log responsibly":
- Redaction / minimisation. Strip or mask sensitive fields (names, emails, card numbers, health identifiers) before they hit the trace store — automatically, at capture time. Log the structure of a failure without the sensitive content where you can.
- Retention limits. Keep detailed traces only as long as they're useful for debugging, then delete or aggregate. A shorter retention window shrinks the blast radius of a breach and often satisfies regulation.
- Access control. Restrict who can read raw prompts/responses, log access, and treat the trace store as the sensitive system it is — not a dashboard everyone can browse.
- Consent and compliance. Honour what users agreed to and what law requires (GDPR, HIPAA, and peers) — including data-residency and deletion rights, which may constrain where traces live and whether you can retain them at all.
An unsecured, long-retained trace store full of raw prompts and responses is one of the easiest ways to turn an observability win into a serious data-breach or compliance incident. "We log everything forever, everyone can query it" is convenient for debugging and a liability waiting to happen. Redact at capture, cap retention, and lock down access before the store fills with sensitive data — retrofitting after is far harder.
Keep the debugging value
The trap to avoid on the other side is logging so little you can't debug. The art is targeted:
- Redact the sensitive content while keeping the structural signal — you often don't need the actual customer name to diagnose a boundary confusion, just the shape of the input.
- Keep short-retention detailed traces for active debugging and longer-retention aggregates (metrics, redacted patterns) for trends.
- Sample full detail on a slice rather than everything, if that covers your debugging needs at lower risk.
Done well, you keep almost all the diagnostic power at a fraction of the risk — which is the whole point of treating this as a design problem rather than a binary.
This project sidesteps the tension because its data is synthetic, non-sensitive business questions authored for evaluation — there's no personal data in "Revenue by region last quarter," so its trials can be fully open and inspectable. That's a deliberate luxury of an offline benchmark; a production system on real customer queries would need exactly the redaction, retention, and access controls this chapter describes before it could safely retain the same rich traces. The open trials show what full observability looks like when the data is safe to keep. Fully-open traces — because the data is non-sensitive →
Mental model
The data observability needs most — prompts, responses, user inputs — is the data you're most obligated to protect, because it's the same data. Don't resolve it by logging blindly less (that blinds you) but by governing: redact sensitive content at capture, cap retention, control access, and honour consent and law. Keep the structural debugging signal, shed the sensitive content and the long tail of risk.
Common mistakes
- Logging raw prompts/responses with no redaction or limits. Your most sensitive data, hoarded — a breach and compliance liability.
- Unrestricted access to the trace store. Raw user data browsable by anyone turns observability into exposure.
- Indefinite retention. Keeping detailed traces forever maximises blast radius for no added debugging value.
- Logging so little you can't debug. The opposite failure — redact content, but keep the structural signal.
Practical guidance
- Redact/minimise at capture — mask sensitive fields automatically before they reach the store, keeping structure over sensitive content.
- Set retention limits: short windows for detailed traces, longer for redacted aggregates; delete on schedule and on request.
- Control access to raw prompts/responses and treat the trace store as a sensitive system, with auditing.
- Build privacy into the tracing design from day one, honouring consent and regulation (residency, deletion) — not as a later retrofit.
Summary
- Observability data is both the most valuable debugging asset and the largest privacy liability — the same prompts, responses, and inputs.
- Govern it with redaction, retention limits, access control, and consent/compliance rather than logging blindly less.
- Keep the structural debugging signal while shedding sensitive content and long-tail retention risk.
- Design privacy into the tracing from the start — this project avoids the tension only because its data is synthetic and non-sensitive.
Knowledge check
A team logs full raw prompts and responses indefinitely, queryable by any engineer, "for observability." Name two serious risks and the controls that address them.
Risks: (1) a data breach — an indefinitely-retained store of raw user inputs and model outputs is a huge, high-value target, and every extra day of retention and every extra person with access enlarges the blast radius; (2) a compliance violation — retaining personal/regulated data without limits, consent, or deletion support can breach GDPR/HIPAA and data-residency rules. Controls: redact/minimise sensitive content at capture (keep structure, drop identifiers), cap retention (short windows for detailed traces, delete on schedule and on user request), restrict access to raw prompts/responses with auditing, and honour consent and residency requirements — all designed in from the start rather than retrofitted.
Why is "just log much less" the wrong way to resolve the observability-vs-privacy tension?
Because logging less indiscriminately blinds your observability — you lose the assembled prompts, raw responses, and stage traces that make novel failures diagnosable, recreating the "can't investigate what you didn't log" problem this whole part warned against. The tension isn't resolved by capturing less signal; it's resolved by governing the signal: redact sensitive content while keeping the structural information needed to debug, cap how long you keep detail, and control who can see raw data. Done well you retain nearly all the debugging value at a fraction of the privacy risk — a design trade, not a volume dial.
Related chapters
- Prompt and response tracing — the most sensitive data this chapter governs
- Request logging and traces — the trace store retention and access apply to
- Hosted versus self-hosted systems — where data residency shapes the hosting choice
- Dashboards, alerts and incident investigation — accessing traces responsibly during an incident