Automated retention policy for AI conversation history
Why it matters
GDPR Article 5(1)(e) requires that personal data not be kept longer than necessary for the processing purpose — the storage limitation principle. CCPA §1798.100 creates parallel expectations. AI conversation history is one of the richest stores of personal data an application can accumulate: it contains exactly what users said, in their own words, about their problems, intentions, and circumstances. Without an automated retention policy, this data accumulates indefinitely, increasing the blast radius of any future breach and the scope of any regulatory discovery request. ISO/IEC 27001:2022 A.8.10 (Information Deletion) codifies this as a formal control requirement.
Severity rationale
High because indefinitely retained AI conversation data violates GDPR Art. 5(1)(e)'s storage limitation principle and ISO 27001 A.8.10, creating compounding regulatory and breach exposure with every day the data grows.
Remediation
Set up an automated cleanup on a 30–90 day cycle. For Supabase/PostgreSQL, pg_cron is the lowest-friction option:
-- Run in Supabase SQL editor after enabling pg_cron extension
SELECT cron.schedule(
'delete-old-conversations',
'0 2 * * 0',
$$DELETE FROM conversations WHERE created_at < NOW() - INTERVAL '90 days'$$
);
For Vercel deployments, use a cron route:
// app/api/cron/cleanup-conversations/route.ts
export async function GET(req: Request) {
if (req.headers.get('Authorization') !== `Bearer ${process.env.CRON_SECRET}`) {
return new Response('Unauthorized', { status: 401 })
}
const cutoff = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000)
await db.conversation.deleteMany({ where: { createdAt: { lt: cutoff } } })
return Response.json({ ok: true })
}
Document the retention period in your privacy policy. Choose a period appropriate to your product — 30 days for ephemeral support chats, 90 days for productivity tools where users reference past sessions.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the AI Data Privacy Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 5(1)(e) — Storage limitation
- ccpa · §1798.100 — Reasonable retention periods
- nist:rev5 · SI-12 — Information management and retention
- iso-27001:2022 · A.8.10 — Information deletion
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-data-privacy·automated