What you are building
An AI email assistant takes the repetitive parts of inbox management off your plate: it reads each new message, sorts it into a category, and drafts a reply you can approve with one click. Crucially, it never sends on its own by default — it prepares the work and leaves the decision to you. This keeps the speed benefit of automation without the risk of an embarrassing or wrong email going out unsupervised.
How it works
The assistant has three stages. First, ingestion: it connects to your mail server over IMAP with a scoped credential, fetches unread messages, and parses each into a clean sender/subject/body. Second, understanding: each message goes to the model with a fixed list of categories and a request to return structured JSON — the chosen category plus a drafted reply written in your preferred tone. Third, review: the draft is saved to your drafts folder or a review queue, and you edit, approve, or discard it. Only approved drafts are sent, through a separate send step.
Two things make this safe and reliable. Asking for structured output
({category, draft, confidence}) means you can route by category and surface
low-confidence drafts for closer review. And keeping the model’s instructions
strictly separate from the email content guards against prompt injection — never
let text inside a message override your system rules. The builder below
assembles the exact classify-and-draft prompt from your categories and tone.
Tips for a trustworthy assistant
Start with a tiny, unambiguous set of categories — five is plenty — because classification accuracy collapses with a long fuzzy taxonomy. Send only the latest message, not the entire quoted thread, to save tokens and reduce leakage. Strip signatures and obvious PII before the model sees anything. Treat every email body and attachment as untrusted input, never as instructions. And resist auto-send until you have watched the assistant’s drafts for a while and trust a specific, narrow category enough to let it go straight out.