Skip to content
GitHub

Outlook Mail

The Outlook Mail provider connects to the Microsoft Graph API via OAuth2 (PKCE). It includes the same content filter pipeline as Gmail for protecting sensitive email content.

Search Outlook Mail messages using KQL search syntax.

Policy operation: search

ParameterTypeRequiredDescription
searchstringnoKQL search query (e.g. from:user@example.com subject:meeting). Omit to list recent messages.
filterstringnoOData $filter expression (e.g. isRead eq false). Cannot be combined with $orderby when $search is present.
folderIdstringnoFolder ID to search in (e.g. Inbox, SentItems). Omit to search all folders.
maxResultsnumbernoNumber of messages to return (1-50, default 10)

Returns message IDs and snippets. Search results are filtered by content filters when guards are configured. Use outlook_mail_read_message to get full content.


Read the full content of an Outlook Mail message by ID.

Policy operation: read_message

ParameterTypeRequiredDescription
messageIdstringyesOutlook message ID (from outlook_mail_search results)

Returns parsed headers (from, to, subject, date) and plaintext body. Messages may be blocked by content filters (2FA codes, password resets, etc.).


Create a new draft email. The draft is saved but NOT sent — the user must review and send manually.

Policy operation: create_draft

ParameterTypeRequiredDescription
tostringyesRecipient email address(es), comma-separated
subjectstringyesEmail subject line
bodystringyesEmail body in plain text
ccstringnoCC address(es), comma-separated
bccstringnoBCC address(es), comma-separated
conversationIdstringnoConversation ID to associate the draft with (for replies)

List existing draft emails.

Policy operation: list_drafts

ParameterTypeRequiredDescription
maxResultsnumbernoNumber of drafts to return (1-50, default 10)

Send an email directly. The email is sent immediately.

Policy operation: send

ParameterTypeRequiredDescription
tostringyesRecipient email address(es), comma-separated
subjectstringyesEmail subject line
bodystringyesEmail body in plain text
fromstringnoSender address (alias). If omitted, uses account default.
ccstringnoCC address(es), comma-separated
bccstringnoBCC address(es), comma-separated

Reply to an existing email. Uses the Graph API native reply endpoint. The reply is sent immediately.

Policy operation: reply

ParameterTypeRequiredDescription
messageIdstringyesOutlook message ID to reply to
bodystringyesReply body in plain text
replyAllbooleannoIf true, reply to all recipients (default: false)

Add or remove categories from a message. Uses string category names (e.g. “Blue Category”, “Red Category”).

Policy operation: categorize

ParameterTypeRequiredDescription
messageIdstringyesOutlook message ID
addCategoriesarraynoCategory names to add
removeCategoriesarraynoCategory names to remove

Archive a message by moving it to the Archive folder. The message remains accessible via search.

Policy operation: archive

ParameterTypeRequiredDescription
messageIdstringyesOutlook message ID to archive

List all mail folders in the Outlook account. Returns folder IDs, display names, and unread counts. Use the returned folder IDs with outlook_mail_move or outlook_mail_search.

Policy operation: list_folders

This tool takes no parameters.


Move a message to a different folder. Use well-known folder names (e.g. Inbox, Archive, SentItems) or folder IDs from outlook_mail_list_folders.

Policy operation: move

ParameterTypeRequiredDescription
messageIdstringyesOutlook message ID to move
folderIdstringyesDestination folder ID or well-known name

The default policy includes a protected_folders guard that prevents moving messages to deleteditems (Trash) and junkemail (Spam).


Set or clear the follow-up flag and importance level on a message.

Policy operation: flag

ParameterTypeRequiredDescription
messageIdstringyesOutlook message ID
flagStatusstringno"flagged", "notFlagged", or "complete"
importancestringno"low", "normal", or "high"

The search and read_message operations support the same content filter pipeline as Gmail, configured via guards. See Content Filters for full documentation.

The default policy includes additional Microsoft-specific blocked sender domains (account.live.com, login.microsoftonline.com) alongside the standard ones.

provider: outlook_mail
account: "{account}"
operations:
search:
allow: true
mutations:
- field: maxResults
action: cap
value: 50
guards:
block_subjects:
- password reset
- reset your password
- verification code
- security code
- two-factor
- 2FA
- one-time password
- one-time pin
- one-time code
- OTP
- sign-in attempt
- login alert
- security alert
- confirm your identity
- einmalcode
- sicherheitswarnung
- sicherheitscode
block_sender_domains:
- accounts.google.com
- accountprotection.microsoft.com
- account.live.com
- login.microsoftonline.com
redact_patterns:
- pattern: "\\b\\d{3}-\\d{2}-\\d{4}\\b"
replace: "[REDACTED-SSN]"
- pattern: "\\b\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}\\b"
replace: "[REDACTED-CC]"
- pattern: "\\b\\d{4}[\\s-]?\\d{6}[\\s-]?\\d{5}\\b"
replace: "[REDACTED-CC]"
- pattern: "\\bCVV[:\\s]*\\d{3,4}\\b"
replace: "CVV [REDACTED]"
- pattern: "\\b[A-Z]{1,2}\\d{6,9}\\b"
replace: "[REDACTED-PASSPORT]"
- pattern: "\\brouting[:\\s#]*\\d{9}\\b"
replace: "routing [REDACTED]"
- pattern: "\\baccount[:\\s#]*\\d{8,17}\\b"
replace: "account [REDACTED]"
read_message:
allow: true
guards:
block_subjects:
- password reset
- reset your password
- verification code
- security code
- two-factor
- 2FA
- one-time password
- one-time pin
- one-time code
- OTP
- sign-in attempt
- login alert
- security alert
- confirm your identity
- einmalcode
- sicherheitswarnung
- sicherheitscode
block_sender_domains:
- accounts.google.com
- accountprotection.microsoft.com
- account.live.com
- login.microsoftonline.com
redact_patterns:
- pattern: "\\b\\d{3}-\\d{2}-\\d{4}\\b"
replace: "[REDACTED-SSN]"
- pattern: "\\b\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}\\b"
replace: "[REDACTED-CC]"
- pattern: "\\b\\d{4}[\\s-]?\\d{6}[\\s-]?\\d{5}\\b"
replace: "[REDACTED-CC]"
- pattern: "\\bCVV[:\\s]*\\d{3,4}\\b"
replace: "CVV [REDACTED]"
- pattern: "\\b[A-Z]{1,2}\\d{6,9}\\b"
replace: "[REDACTED-PASSPORT]"
- pattern: "\\brouting[:\\s#]*\\d{9}\\b"
replace: "routing [REDACTED]"
- pattern: "\\baccount[:\\s#]*\\d{8,17}\\b"
replace: "account [REDACTED]"
create_draft:
allow: true
constraints:
- field: to
rule: must_not_be_empty
- field: subject
rule: must_not_be_empty
mutations:
- field: cc
action: delete
- field: bcc
action: delete
list_drafts:
allow: true
mutations:
- field: maxResults
action: cap
value: 50
send:
allow: false
constraints:
- field: to
rule: must_not_be_empty
- field: subject
rule: must_not_be_empty
mutations:
- field: cc
action: delete
- field: bcc
action: delete
reply:
allow: false
constraints:
- field: messageId
rule: must_not_be_empty
- field: body
rule: must_not_be_empty
mutations:
- field: replyAll
action: set
value: false
categorize:
allow: true
archive:
allow: true
list_folders:
allow: true
move:
allow: true
guards:
protected_folders:
- deleteditems
- junkemail
flag:
allow: true

delete_message is not implemented. There is no code path to permanently delete an Outlook Mail message through Gatelet.

Example: full agent with alias-restricted sending

Section titled “Example: full agent with alias-restricted sending”
provider: outlook_mail
account: me@outlook.com
operations:
search:
allow: true
guards:
block_subjects:
- password reset
- verification code
- 2FA
block_sender_domains:
- accountprotection.microsoft.com
- account.live.com
read_message:
allow: true
guards:
block_subjects:
- password reset
- verification code
- 2FA
create_draft:
allow: true
list_drafts:
allow: true
send:
allow: true
constraints:
- field: from
rule: must_match
value: ".*\\+agent@.*"
- field: to
rule: must_not_be_empty
- field: subject
rule: must_not_be_empty
mutations:
- field: cc
action: delete
- field: bcc
action: delete
reply:
allow: true
mutations:
- field: replyAll
action: set
value: false
categorize:
allow: true
archive:
allow: true
list_folders:
allow: true
move:
allow: true
guards:
protected_folders:
- deleteditems
- junkemail
flag:
allow: true