- Embedded vs. Standalone Security Copilot: Where M365 admins get the fastest ROI—embedded inside Defender XDR, Microsoft Entra, Purview, and Intune without switching portals.
- SCU Capacity Planning: How Security Compute Units (SCUs) are billed, how to prevent runaway promptbook consumption, and how to configure overage limits.
- Ready-to-Run KQL Hunting Queries: Hunt for anomalous Copilot grounding spikes, rogue local AI agent binaries, and post-outage admin phishing clicks across Defender + Sentinel.
- Promptbooks for Tier-1/Tier-2 Triage: Chain repeatable multi-step investigation prompts to turn a 45-minute BEC investigation into a 3-minute guided summary.
While Chapters 1–8 focused on securing AI, Chapter 9 flips the lens: using AI to secure your Microsoft 365 tenant.
Microsoft Security Copilot connects directly into Microsoft Defender XDR, Microsoft Sentinel, Entra ID, Purview, and Intune. Instead of manually writing complex 40-line KQL joins during a live Business Email Compromise (BEC) incident or hunting for a misconfigured local AI agent, administrators can summarize incidents, reverse-engineer obfuscated PowerShell payloads, and generate validated KQL hunting queries in seconds.
1. High-Signal KQL Queries for AI & Agentic Threat Hunting
Run these KQL queries in Microsoft Defender XDR → Hunting → Advanced hunting (or trigger them inside a Security Copilot Promptbook):
Query 1: Detect Anomalous Copilot Prompt Spikes (Potential Automated Scraping)
CloudAppEvents
| where Timestamp > ago(24h)
| where ActionType == "CopilotInteraction"
| summarize PromptCount = count(), DistinctApps = dcount(Application) by AccountDisplayName, AccountObjectId, bin(Timestamp, 1h)
| where PromptCount > 60
| sort by PromptCount desc
Query 2: Hunt for Unsanctioned Local AI Coding Agents & Suspicious Subprocess Spawns
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("claude.exe", "codex.exe", "ollama.exe", "lmstudio.exe", "node.exe")
| where ProcessCommandLine has_any ("copilot", "claude", "openai", "anthropic", "mcp-server")
| summarize Executions = count(), Devices = dcount(DeviceName) by AccountName, FileName, InitiatingProcessFileName
| sort by Executions desc
2. Building a Repeatable BEC & Phishing Triage Promptbook
Instead of typing ad-hoc prompts during an incident, save a Security Copilot Promptbook (M365-Admin-BEC-Triage) that runs 4 chained steps automatically for any suspicious UPN:
- "Summarize all Entra ID sign-in failures, impossible travel alerts, and newly registered MFA methods for
<UPN>in the last 72 hours." - "List any new Exchange Online inbox rules (
New-InboxRule), forwarding settings, or OAuth app consents granted by<UPN>." - "Check whether
<UPN>triggered any Purview DLP orCopilotInteractionevents touching Confidential-labeled files." - "Generate a 5-bullet executive incident brief and recommended PowerShell containment commands (
Revoke-MgUserSignInSession)."
3. Managing Security Compute Units (SCUs) Without Bill Shock
Security Copilot is provisioned in hourly Security Compute Units (SCUs) billed to an Azure subscription:
- Start with 1–2 provisioned SCUs for a 3–5 person SOC/M365 security team, and enable overage SCUs with a strict monthly cap so burst incident investigations don't stall while preventing runaway charges.
- Use Role-Based Access Control (RBAC) inside Security Copilot (Settings → Role assignment) so only designated SOC analysts and M365 Security Admins can invoke SCU-consuming plugins and promptbooks.
4. Chapter 9 Lab Checklist
- [ ] Verify Security Copilot RBAC assignments and cap overage SCUs in Azure Cost Management.
- [ ] Run the two KQL hunting queries above in Defender XDR Advanced Hunting to baseline Copilot volume and local agent processes.
- [ ] Create and test one repeatable Promptbook for BEC / phishing triage (see also our Post-Outage Defender KQL Hunting Runbook).
💬 Reader Comments & Feedback
Did this runbook help, or did Microsoft change a cmdlet or UI menu? Share your feedback below.
Leave a Comment or Report an Update