threatdeck
Live 13:45 UTC ·

Detection library

KQLHunting query: tune before alertingShadow AI and AI-powered attackers

Entra ID user or admin consent granted to an AI application

AI assistants, meeting bots and writing tools ask for delegated Microsoft Graph access to mail, files and chats; a single Allow click gives a third party durable access (offline_access) to that data. Entra records each grant as the ApplicationManagement activity "Consent to application", with ConsentContext.IsAdminConsent and ConsentAction.Permissions in the modified properties. This hunt filters grants to apps whose names match an AI keyword list and highlights the scopes Microsoft's consent playbook calls out as most abused.

Log source
Microsoft Sentinel / Log Analytics: AuditLogs (Entra ID)
Techniques
ASI03 Identity and Privilege Abuse · LLM02 Sensitive Information Disclosure · LLM06 Excessive Agency
MITRE ATT&CK
T1528Steal Application Access TokenT1671Cloud Application Integration
Reviewed
2026-11-10

Query

let ai_app_keywords = dynamic(["ChatGPT", "OpenAI", "Claude", "Anthropic", "Gemini", "Copilot", "Perplexity",
                                "Otter", "Fireflies", "Read AI", "Grammarly", "Notion", "Glean", "DeepSeek", "Manus"]);
AuditLogs
| where TimeGenerated > ago(30d)
| where OperationName == "Consent to application"
| where Result =~ "success"
| extend AppName = tostring(TargetResources[0].displayName), ServicePrincipalId = tostring(TargetResources[0].id)
| where AppName has_any (ai_app_keywords)
| mv-apply prop = TargetResources[0].modifiedProperties on (
    summarize IsAdminConsent = take_anyif(tostring(prop.newValue), tostring(prop.displayName) == "ConsentContext.IsAdminConsent"),
              Permissions = take_anyif(tostring(prop.newValue), tostring(prop.displayName) == "ConsentAction.Permissions"))
| extend Actor = coalesce(tostring(InitiatedBy.user.userPrincipalName), tostring(InitiatedBy.app.displayName))
| extend HighRiskScope = Permissions matches regex @"(?i)(Mail\.|Files\.|Sites\.|Chat\.|Contacts\.|MailboxSettings\.|Notes\.|offline_access)"
| project TimeGenerated, Actor, AppName, ServicePrincipalId, IsAdminConsent, HighRiskScope, Permissions
| order by HighRiskScope desc, TimeGenerated desc

Expected false positives

  • Sanctioned AI apps that users are expected to connect (filter by ServicePrincipalId)
  • Non-AI apps whose names contain a keyword (for example Notion without AI features)

Sources

Reviewed against vendor documentation, not tested in your environment. Defensive use only.

Following

Follow the vendors, products, AI tools, techniques and actors you care about. Matching stories, CVEs and exploited bugs are marked, a Following tab appears in the feed, and returning visits show what changed. Saved only in this browser.

Presets

Get updates

A personal RSS feed of new stories on everything you follow. Paste it into any feed reader, Slack or Teams RSS app.