Repository navigation
Description
AI Studio should be able to connect any number of email mailboxes as local data sources. The AI can then search, read, and count emails in a chat, and later also mark, move, and delete them, write drafts, and check whether an email can be trusted. Users can view emails and reply to them using the email assistant.
A live search on Exchange servers is too slow and supports neither BM25 nor vector search. Therefore, every mailbox becomes a local, embedded data source: AI Studio syncs it every 16 minutes and searches it using BM25, metadata, and vectors. The connection uses IMAP, since Microsoft blocks EWS in Exchange Online starting October 1, 2026, and shuts it down on April 1, 2027. This series replaces MindWorkAI/AI-Studio#998, which used EWS and worked only on Windows.
Key decisions
- Sign-in: IMAP with username and password (an app password for Gmail and iCloud; on-premises Exchange needs IMAP enabled). Microsoft 365 and Outlook.com follow with OAuth2.
- Time range: configurable, 12 months by default. Flagged emails are always indexed.
- Root folder: optional per mailbox. Syncing and all tools stay within this folder and its subfolders.
- Confidence level: required per mailbox and enforced at runtime for every provider that sees email content: chat, embedding, and trust check.
- Outbound data: a per-mailbox setting restricts where a chat may send data after it has read from that mailbox. The default allows only configured services. Organizations can enforce a minimum level.
- Failed sign-ins are stored permanently. AI Studio does not retry until the user saves a new password or explicitly starts a new attempt. This prevents account lockouts after a password change.
- Emails are untrusted content: everything a model sees passes through the prompt injection filter.
- Tools that change a mailbox must be selected explicitly and act only at the user's explicit request.
- The feature starts behind the preview flag
PRE_MAILBOXES_2026.
Planned pull requests
Each pull request targets main after the previous one has been merged.
- Mailboxes as local data sources: sync, index, the read-only tools
search_mails,read_mail, andcount_mails, mail sources in chats, outbound data restriction, root folders (Added mailboxes as local data sources AI-Studio#1022) - A mail viewer and shared actions for sources
- A trust check for emails: known addresses, lookalike domains, SPF/DKIM/DMARC, and an assessment by the model
- Approval dialogs and tools that change mailboxes: mark, move, create and rename folders, delete (into the trash), and drafts
- Replies to emails from sources in the email assistant, including "Save as draft"
- Microsoft sign-in (OAuth2) for Microsoft 365 and Outlook.com
Later
- Mailboxes predefined by the IT department; Windows-integrated sign-in for on-premises Exchange
- IMAP IDLE
- Email monitoring: an agent notifies users about new emails from specific senders or on specific topics
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Development
Activity
[-]Integration of email mailboxes[/-][+]Integration of mailboxes[/+]