Skip to content

Integration of mailboxes #71

Open
Open

Description

@SommerEngineering

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.

  1. Mailboxes as local data sources: sync, index, the read-only tools search_mails, read_mail, and count_mails, mail sources in chats, outbound data restriction, root folders (Added mailboxes as local data sources AI-Studio#1022)
  2. A mail viewer and shared actions for sources
  3. A trust check for emails: known addresses, lookalike domains, SPF/DKIM/DMARC, and an assessment by the model
  4. Approval dialogs and tools that change mailboxes: mark, move, create and rename folders, delete (into the trash), and drafts
  5. Replies to emails from sources in the email assistant, including "Save as draft"
  6. 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

Activity

  1. added
    epicA large feature that is divided into smaller parts and developed.
    on Oct 2, 2026
  2. moved this from Proposed to In Development in Roadmapon Oct 2, 2026
  3. changed the title [-]Integration of email mailboxes[/-] [+]Integration of mailboxes[/+] on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

epicA large feature that is divided into smaller parts and developed.

Type

No type

Projects

  • Status
    In Development

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions