Slack Bot Message Retention and Deletion Compliance Prompt
Design a retention and tombstone-deletion pipeline for bot-posted messages to meet data-lifecycle and compliance requirements
- Target user
- platform and compliance engineers operating Slack apps
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps and owns the data-retention lifecycle for messages your bot posts. I will provide: - The categories of bot-posted content (e.g. alerts, approvals, incident summaries) and their required retention periods - The regulatory or internal policy driving deletion, and any legal-hold exceptions - My app's scopes, posting volume, and where message references are stored Your job: 1. **Inventory and classification** — map each content category to a retention period and a deletion vs tombstone-replace policy. 2. **Reference ledger** — design how the app records `channel` + `ts` (and metadata) for every posted message so it can be acted on later, decoupled from Slack search. 3. **Deletion mechanism** — choose between `chat.delete`, `chat.update` to a tombstone, and workspace-level message retention, and explain the tradeoffs and what each can/cannot remove (threads, files, edits). 4. **Legal hold and exceptions** — design a hold flag that suppresses deletion and an audit record of every suppressed item. 5. **Scheduled enforcement** — build the sweep job (batching, rate-limit backoff, resumable checkpoints) that enforces retention without hammering the API. 6. **Audit trail** — record what was deleted/tombstoned, when, by which policy, in a tamper-evident log. 7. **Verification** — define reconciliation proving expired content is gone and held content remains. Output as: a retention policy table (category -> period -> action), the sweep-job pseudocode with checkpointing, and an audit-record schema. Deletion is irreversible and may conflict with legal hold; require an explicit hold check and dry-run before any sweep deletes content.