You need the data; you can't keep all of it
Logs are necessary for debugging, eval mining, and compliance. Logs of raw user input are also a liability — PII, regulated content, secrets users pasted by mistake. The discipline is logging enough to investigate without keeping more than policy allows.
What to log
- Prompt version, model, sampler params (always).
- Token usage per category (always).
- User input — redacted if sensitive, retained per policy (1–90 days typical).
- Tool calls and returns — same redaction rules.
- Model output — same redaction rules.
- Any verifier / filter flags on the output (always).
How to redact
- Pre-log: regex / classifier strips emails, phone numbers, SSNs, credit cards.
- Aggregation: keep counts and category labels long-term; raw text short-term.
- Retention: tier the logs — full text 7 days, redacted 30 days, aggregated indefinitely.