I migrated a credit-bound, approval-gated AI email assistant into a self-hosted Microsoft 365 architecture — eliminating credit exhaustion and the Slack-approval bottleneck for a California law firm.
The firm had an existing AI email assistant — internally named Viktor — running inside a Slack channel. It worked: across 34 production runs it processed 350+ emails, classified them accurately, and drafted in the managing attorney's voice using 14 documented behavioral rules.
But the operational model created two friction points the firm couldn't get past:
The firm wanted an architecture they owned end-to-end, with predictable cost, no per-draft approval, and a path to deploy across six+ mailboxes.
I spent the first phase observing Viktor in production — analyzing 34 runs and 350+ emails — and extracted a 22-page knowledge document covering every rule, edge case, tone sample, and routing decision the predecessor had accumulated.
This became the source-of-truth for the new system's prompts and routing logic. It also surfaced the categories where the firm wanted AI to never draft — opposing counsel, settlement discussions, court deadlines, IRS notices — high-risk legal communications where wrong wording could waive privilege or create liability.
I evaluated two paths — Power Automate + Azure OpenAI versus Copilot Studio + Power Automate — and recommended the first. It eliminated the credit model that killed Viktor, kept all data inside the firm's Microsoft tenant, and cost roughly $140/month less to operate.
Inbound mail is fetched every two hours during business hours via Microsoft Graph. Each email runs through a classifier that assigns one of four routes, and only the route requiring a reply hits the drafter. Prompts live in SharePoint so the firm can edit behavior without touching the flow itself.
Critical design choices worth calling out:
Beyond the numbers, the deliverable the firm cares about most is ownership: the flow, the prompts, the templates, and the documentation all live in their tenant and SharePoint. Nothing is locked behind a vendor's credit ledger.
Most of the value in this engagement wasn't the code — it was the discovery work that translated a working-but-fragile predecessor into a documented set of rules the new system could inherit. The classifier is only as good as the categories you give it, and the drafter is only as good as the tone samples behind it.
The second lesson: in regulated domains, the most important architectural decision is what the AI doesn't do. Opposing counsel, settlement, court deadlines — these never get a draft. Defense-in-depth at the routing layer matters more than prompt cleverness.