An AI that reads your inbox and drafts replies in your voice, and never sends a thing
Every morning: a one-page digest of what came in and what needs you, plus replies already drafted in the way you actually write, waiting in your Drafts folder for a final read. One Python script, a local model, rules before AI, and a review step that's yours alone. It opens your inbox read-only, so it can't send, delete or even mark anything as read.
- A review queue: approved drafts land in your Drafts folder, and you press send yourself
- Prompt-injection protection: emails are treated as data, and "ignore your instructions" mail is flagged
- Ollama with
gemma4:e2b(or any chat model): Run AI on your PC - uv from docs.astral.sh/uv ↗. The script uses only Python's standard library
- A mailbox with IMAP and app passwords: Gmail, Fastmail, iCloud Mail or most hosting-company mail. Outlook.com needs OAuth and isn't covered
- Prefer clicking to code? Sort, label and summarise your email with AI builds a labelling version in n8n
Decide what it may touch
Read-only for the inbox, write-only for one folder, and no way to send.
This assistant has three jobs and no others:
- Triage: read new mail and write
digest.md(a one-page summary, most urgent first) andtriage.csv. - Draft: for mail that needs a reply, write a draft in your voice into a local
queue/folder. - Review: show you each draft; the ones you approve are added to your mail account's Drafts folder.
- Triage: read new mail and write
And three hard limits, in the code, not the promptthe inbox is opened with
readonly=Trueand messages are fetched withBODY.PEEK, so nothing is marked read; there is no SMTP code, so nothing can be sent; and the only write is an IMAPAPPENDto your Drafts folder with the\Draftflag. You send from your normal mail app.How this differs from [Sort, label and summarise your email with AI](/learn/inbox-autopilot): that mission builds visual n8n workflows that label mail in Gmail. This one is a single Python script you can read in ten minutes, adds replies written in your own style from your Sent folder, and keeps every approval in your hands.
Get the kitinbox-ai.zip has
inbox_ai.py, a sample config, a facts file, a style file and six sample emails. kit.md has the setup checklist.