Full prompt-and-completion capture is the single most useful debugging artifact you can have on an agent. When a user reports that the agent did something wrong, the trace of exactly what the model saw — the system prompt, the retrieved context, the tool calls it issued and their results, the final completion — is usually the only thing that lets you tell whether the model reasoned badly, the retrieval fed it the wrong context, or a tool returned bad data. Metrics and aggregate dashboards tell you *that* something is wrong; the raw payload is what tells you *why*.
That same payload is also the largest data-protection liability in your system. Users type real names, real email addresses, order numbers, sometimes card digits or health details, straight into a chat box, and an agent's tool calls routinely pull that same data out of a CRM or order system and echo it back into the completion. Unlike a structured database column that a DBA can point to and say "that's the sensitive one," a prompt is free text — sensitive data can appear anywhere in it, in any shape, with no schema to warn you it's there.
This lesson treats that as an honest tension rather than a problem with a single clean fix: you cannot get the debugging value of full capture and pretend the liability isn't there, and you cannot eliminate the liability by refusing to log anything without also losing the ability to debug the agent at all. The engineering job is to keep as much of the debugging value as you can while shrinking the liability — through redaction at write time, structured field policies, the right choice between reversible and irreversible transforms, bounded retention, sampling, and access control on whatever you do keep. None of this is a compliance checklist to satisfy a named regulation; specific legal obligations vary by jurisdiction and sector, and confirming them is a job for counsel, not for this lesson. What follows is the engineering discipline that makes a system defensible regardless of which rules end up applying to it.