MADE:Explorations · Features

OpenM365

Amplifier meets the enterprise.
Agents that work natively with Outlook, Teams, SharePoint — the entire Microsoft 365 stack.

Active · MIT License
May 2026 · ramparte/openm365
The Problem

Enterprise data
is off limits

🔒

Locked Behind GUIs

Billions of emails, documents, and calendar events sit inside M365 — accessible only through manual point-and-click interfaces. Agents can't touch them.

⚠️

Raw APIs Are Dangerous

Giving an LLM raw Microsoft Graph API access is like handing it the keys to the building. One bad call deletes a mailbox or shares confidential files externally.

🚫

No Safety Envelope

No rollback, no approval gates, no DLP, no cost controls, no audit trail. Enterprise IT cannot approve what it cannot govern.

Non-technical people need the power to use LLMs on their enterprise data — emails, documents, calendars, SharePoint — without the risk of data loss, security breaches, or irreversible mistakes.

— OpenM365 Project Intent
The Solution

Natural language,
enterprise guard rails

Type what you want. OpenM365 decomposes intent into a plan, enforces safety policy at every step, and executes against Microsoft Graph — with full rollback.

1

Intent

Natural language is classified and decomposed by the Intent Kernel into a structured, inspectable execution plan. No ambiguity reaches the API.

2

Plan

The Planner validates scope, estimates cost, resolves resource dependencies, and pre-checks RBAC permissions — before a single API call is made.

3

Execute

The Executor runs each step through 8 constitutional safety hooks — identity, RBAC, DLP, cost control, approval, audit, rate limiting, and tool gateway — then calls Microsoft Graph.

4

Checkpoint & Rollback

Every mutating operation creates a checkpoint. If anything goes wrong, roll back to any prior state with one command.

Architecture

17 modules, one constitutional invariant

The safe path is the only path. Compliance is not advisory — it is structurally enforced by the execution kernel before application code runs.

💬

Intent

NL → structured dispatch via classifier, mapper, and OpenAI provider

📋

Planner

Plan builder, cost estimator, scope analyzer, validator

⚙️

Executor

Step runner with checkpoint manager and dry-run mode

🛡️

Safety

8 hooks, policy engine, constitutional enforcement

Graph API Clients

Mail, Calendar, Contacts, OneDrive, SharePoint, Teams, Tasks, Groups — each with pagination, throttling, batch support

Auth & Identity

MSAL device code + service principal flows, Entra ID identity, scoped tokens, 401 retry with invalidation

Service Layer

FastAPI gateway with rate limiting, request correlation, security headers, streaming, graceful shutdown

Constitutional Safety

8 hooks. Every call. No exceptions.

The executor invokes the full hook pipeline before every tool call. There is no “skip hooks” mode. There is no fast path that bypasses safety.

Entra Identity

Validates caller identity against Azure AD. Every operation is tied to a real Entra ID principal.

RBAC

YAML-driven role hierarchy with inheritance. Pre-flight permission checks block unauthorized operations.

DLP

Data Loss Prevention scanning. Detects sensitive content before it leaves the safety boundary.

Cost Control

Per-operation cost estimation. Rejects plans that exceed configured budget thresholds.

Approval Workflow

State machine for human-in-the-loop gates. Destructive operations require explicit approval.

Audit

Every action logged with caller identity, timestamp, parameters, and outcome. Full forensic trail.

Rate Limiting

Per-user and per-tenant throttling. Prevents runaway agents from burning through Graph API quotas.

Tool Gateway

Sandboxed tool execution with path control. Tools cannot reach beyond their declared scope.

M365 Domains

8 domains. Full Graph API coverage.

Each domain has a typed Graph client, a gateway handler, and a CLI command group — from reading mail to restructuring SharePoint sites.

📧

Mail

Read, send, move, delete, draft batch responses. Attachments via base64.

📅

Calendar

Events, scheduling, calendar management. Create, update, delete events.

📁

OneDrive

Files, folders, sharing. Upload, download, organize cloud storage.

🌐

SharePoint

Sites, lists, document libraries, pages. Full site restructuring.

📢

Teams

Teams, channels, messages, tabs. Send and read channel messages.

Tasks

To Do and Planner tasks. Create, update, complete, organize task lists.

👥

Contacts

People, contact lists. Read, create, update organizational contacts.

🏢

Groups

M365 Groups, membership. List, inspect, manage group members.

How It Feels

Agent-native M365

A user types natural language. The system does the rest — safely.

1

“Reorganize my inbox by project”

Intent kernel classifies the utterance, maps to mail domain tools, builds a multi-step execution plan.

2

Checkpoint created automatically

Before any mutation, a rollback point captures current state. One-click undo if anything goes wrong.

3

8 safety hooks fire on every operation

Identity verified, RBAC checked, DLP scanned, cost estimated, approval gate evaluated, audit logged — then the Graph API call executes.

4

Summary delivered, rollback available

User sees what changed, can approve the batch, or roll everything back to the checkpoint.

Velocity

Built in 5 weeks

1,992
Commits
154
Source Files
29K
Lines of Source
81K
Lines of Tests

~2.8:1 Test Ratio

81,153 lines of tests vs 28,781 lines of source across 226 test files. Strict type checking with Pyright in strict mode.

17 Modules

Clean separation: intent, planner, executor, graph, auth, safety, approval, rbac, gateway, audit, store, models, config, errors, service, context, CLI.

Ecosystem

More than one repo

OpenM365 is the core. A constellation of packages extends it for autonomous agents, multi-agent collaboration, and enterprise productivity bundles.

openm365

Core library. Graph API clients, safety hooks, intent kernel, executor, CLI. 154 source files, 17 modules.

ramparte/openm365

openm365-worker

Worker-machine task tools wrapping Graph API clients for autonomous M365 operations. Actions for mail, calendar, teams, SharePoint, OneDrive, tasks.

ramparte/openm365-worker

m365-collab

Amplifier bundle enabling multi-agent collaboration via Microsoft 365. Agents coordinate through SharePoint.

ramparte/amplifier-bundle-m365-collab

The information-worker bundle combines M365 integration with Slack and collaboration tools into a single enterprise productivity suite — everything an office worker's agent needs.

— amplifier-themed-bundles / information-worker
Under the Hood

Tech stack & design decisions

Stack

  • Python 3.12+ with Click CLI
  • FastAPI + Uvicorn service layer
  • httpx async HTTP for Microsoft Graph
  • MSAL for OAuth / Entra ID auth
  • Pydantic v2 domain models (strict)
  • SQLite local state + migrations
  • Pyright strict type checking
  • Hatchling build system

Design Principles

  • CLI-first: can later drive web portal, Teams bot, or VS Code extension
  • Graph clients are stateless — accept tokens, never acquire them
  • Plans are serializable data structures — inspectable, diffable
  • Constitutional hooks cannot be bypassed — architectural law
  • No external database dependency — SQLite only
  • Every command returns JSON for agent consumption

Dry-Run Mode

Execute any plan without touching M365. See exactly what would happen, review the plan, then run it for real.

Minimum-Privilege Scopes

scopes_for_tools() narrows OAuth scopes per-operation. Never request more permissions than the current plan requires.

Enterprise Context Layer

Policy bridge loads safety rules from the organization's context store. IT defines the rules; the system enforces them.

The Bigger Picture

Enterprise-grade
agent infrastructure

OpenM365 is the safety layer between AI agents and the Microsoft 365 data that enterprises live in. It makes the entire M365 stack agent-native — without asking IT to lower their guard.

# Install uv pip install openm365 # Authenticate with your M365 tenant openm365 auth login # Agent-driven: reorganize inbox by project openm365 "reorganize my inbox by project"
ramparte/openm365
MIT License · Python 3.12+ · Microsoft Graph API
Sources & Methodology

How this deck was built

All metrics are derived from real repository data. No estimates or fabricated numbers.

Architecture: Sourced from specs/architecture.md (Gate 3 — Sufficient Architecture). Project Intent: Sourced from PROJECT-INTENT.md. Safety hooks & domain handlers: Enumerated from src/openm365/safety/hooks/ and src/openm365/gateway/handlers/. Ecosystem repos: Discovered via team_knowledge(operation="search", query="openM365").

Primary contributor: ramparte · Generated: May 2026

More Amplifier Stories