Overview
OneCLI connects AI agents to Outlook Mail through Microsoft’s OAuth flow. Agents can read your inbox, send emails, manage folders, and search messages. The gateway injects OAuth credentials into requests to the Microsoft Graph API automatically. This is useful for agents working in Microsoft 365 environments that need to process emails, send notifications, or automate inbox management.What you will set up
- An Outlook Mail connection through Microsoft OAuth
- Automatic token injection on requests to Microsoft Graph
- Per-agent, per-tool access, such as read freely and approve sends
Setup
Go to Connections
Authorize

The Outlook Mail connect window on OneCLI Cloud.
Self-hosted: use your own Microsoft app
MICROSOFT_CLIENT_ID and MICROSOFT_CLIENT_SECRET set. One Microsoft app serves Outlook Mail, Outlook Calendar, Microsoft Word, and Microsoft OneNote, so you set it up once.1. Register the app
1. Register the app
OneCLI and, under Supported account types, choose Any Entra ID Tenant + Personal Microsoft accounts.2. Add the redirect URI
2. Add the redirect URI

The registration form: account type and the Web redirect URI.

Copy the Redirect URI from Custom credentials in OneCLI.
3. Add the API permissions
3. Add the API permissions

API permissions after adding the Microsoft Graph delegated permissions. Extra ones such as openid and email are harmless.
4. Connect with your app
4. Connect with your app
What agents can do
- Search messages by sender, subject, body content, date range, or folder
- Read the full content of emails, including attachments
- Send new emails with recipients, subject, body, and attachments
- Reply to or forward messages
- Create, rename, and delete mail folders
- Move messages between folders
- Mark messages as read or unread
- Flag messages for follow-up
- List and manage inbox rules
- Read and manage focused inbox preferences
Controlling access
Access is per agent: grant the connection to each agent that needs it, choosing per tool what runs freely, what needs human approval, and what stays blocked — a read-only agent is a single grant. Organization rules add guardrails on top, like rate limits and blanket blocks. Everything is checked before credential injection, so a blocked request never reaches Microsoft Graph.FAQ
Can an agent read Outlook mail without sending?
Can an agent read Outlook mail without sending?
Does the agent see my Microsoft token?
Does the agent see my Microsoft token?
Does one Microsoft app cover Outlook Calendar and Word too?
Does one Microsoft app cover Outlook Calendar and Word too?
How do I reconnect Outlook Mail?
How do I reconnect Outlook Mail?