Treat attachments as untrusted input: allowlist types, size-cap, scan, store outside the web root and never execute them on the bot host.
Checklist
- Allowlist extensions + magic bytes
- Scan in an isolated worker
- Signed short-lived download URLs
- Log verdicts, not file contents
When to choose what
Write the decision down with a revisit date. Re-evaluate when latency, cost or ops load changes.
Related
Frequently asked questions
Is this exhaustive?
No. It is a practical starting point; verify details in official docs before production.