Important
This repo has moved. Active development is happening in the sibling repo, which pairs plain-English Markdown with Python code. We're maintaining only that one for now, until there is demand for a Markdown-only version or more languages.
See you over at the active repo: https://github.com/Azure-Samples/m365-inbox-serverless-agent-python
An AI agent that triages your Microsoft 365 inbox: it escalates urgent mail to Teams, drafts replies, and emails you a daily briefing — all following rules you write in plain markdown.
Powered by Azure Functions and Microsoft 365 connectors. You bring the markdown logic that drives every decision — no hand-written code.
Run it locally in minutes against sample data, point it at your real inbox, then deploy it so it runs on its own.
🐍 Want a code escape hatch (a deterministic Python classifier and offline hacking)? See the Python sibling (how they differ).
- 🚨 Escalate — VIP / urgent mail is posted to your Teams channel, with an @mention.
- ✉️ Reply — action-required mail gets a grounded draft reply.
- 📋 Brief — a daily summary of what matters lands in your inbox.
- 💬 Chat — ask read-only questions about your recent mail.
→ Full walkthroughs in docs/use-cases.md.
- Python 3.13+ (the agent host and local client run on it). Easiest install: uv, then
uv python install 3.13. - Azure Functions Core Tools v4 ≥ 4.12.0 (the v5 preview is not yet compatible).
- Azure Developer CLI (
azd). - An Azure subscription.
azd provision(Quickstart step 2) creates the Microsoft Foundry model deployment the agents need — required even for the offline path. - For real M365 (or
azd up): permission to authorize Microsoft 365 connectors, plus theconnector-namespaceCLI extension:curl -fsSL https://aka.ms/connector-namespace-cli-install | sh
Five steps: install, get resources, run locally, try it, deploy.
brew tap azure/functions
brew install azure-functions-core-tools@4
brew install azure-dev # azd
npm install -g azurite
curl -LsSf https://astral.sh/uv/install.sh | shLinux / Windows / WSL: use the Core Tools v4 install guide, azd install guide, Azurite install guide, and uv install guide.
azd provision creates the Foundry model deployment the agents require (needed even offline); hydrate copies the settings into local.settings.json. No API keys — managed identity throughout.
azd provision
./infra/scripts/hydrate-local-settings.shYes — even the offline, sample-data run needs this one-time
azd provision, because the agents call a Foundry model. It provisions the model deployment only; it never touches your inbox.
azurite --silent --location .azurite # terminal A
uv run func start # terminal B
uv run python chat.py # terminal CPick 1, 2, or 3. The client shows a 🟡 Offline banner and runs every agent in DRY RUN against sample-data/inbox/*.json: it produces the full deliverable as text and calls no connector, so nothing is ever sent. Pick 5 to chat with the sample inbox.
Want it to act on your real inbox while still local? See Go live with real M365.
azd upKnown issue (point-in-time):
azd upmay currently fail at the deploy step on Python 3.13 — the Flex remote build uses Python 3.11.8 (Azure/azure-dev#8538). Simple workaround: docs/deploy-python-313.md. This note can be removed once the bug is fixed.
Now inbox-triage fires automatically on every new email — no client, no waiting. Send yourself a message, then watch your Teams channel (VIP / incident) or your inbox (replies). Tail the live trace with azd monitor --logs.
azd down --purgeHitting an error? See docs/troubleshooting.md.
- ✍️ Edit
skills/vip-rules.mdto set your VIPs, what to skip, and what escalates to Teams. - 🔁 The
weekly-rule-suggestionsagent proposes tuning that you approve by hand. - 🔒 Use this repo as a private template before adding real rules or tenant data.
→ Full guide: docs/customize.md.
This is an Azure Functions app on the serverless agents runtime. Each agent is a markdown file (*.agent.md) that reasons over your rules in skills/*.md — no hand-written code. Microsoft 365 actions go through Entra-authorized MCP connectors — no app secrets, managed identity end to end.
→ Deeper dives: How it works · Configuration & deployment · Customize · Troubleshooting & reference