/projects — 2026-04-03

M365 Policy Assistant

in-progress

claude-apim365powershelltypescript

Problem

My nonprofit clients often have Conditional Access policies that were set up years ago and nobody fully remembers why. When an access issue comes up, I spend time digging through the Entra ID portal, cross-referencing policy conditions, and reconstructing the intent behind each rule.

I wanted a faster way to answer questions like: “Why would a user on a personal device get blocked when accessing SharePoint from home?”

Approach

  1. Export Conditional Access policy JSON from Entra ID using PowerShell (Get-MgIdentityConditionalAccessPolicy)
  2. Feed the policies as context to Claude via the API
  3. Ask questions in plain English and get back answers that reference the specific policy rules

Current state

I have a working prototype that:

The responses are genuinely useful. Claude correctly identifies policy conflicts and explains exclusions in terms a non-technical stakeholder can follow.

What’s not working yet

Next steps

What I’ve learned

Structured JSON is actually great context for LLMs. The policy objects have consistent schemas, which makes it easy to write a system prompt that tells Claude exactly how to interpret the data.

The main challenge isn’t the AI part — it’s getting clean, complete data out of Entra ID in the first place.