Query Details
# MDE - Local AI Agents Inventory   ## Query Information ### Description These KQL queries inventory local AI agents detected by Microsoft Defender for Endpoint using the `AgentsInfo` table. The queries surface which devices have local AI agents installed and, conversely, which AI agents are present across how many devices, helping identify the spread and distribution of local AI agent deployments in your environment. #### References ### Author - **Alex Verboon** ## KQL Query Devices with Local AI Agents ```kql AgentsInfo | where Platform == @"LocalAgents" | extend AgentInfo = parse_json(RawAgentInfo).localAgentMetadata | where isnotempty( AgentInfo) | extend DeviceName = tostring(AgentInfo.deviceName) | summarize Agents = make_set(Name), TotalAgents = dcount(Name,4) by DeviceName | project DeviceName, TotalAgents, Agents ``` AI Agents and total devices ```kql AgentsInfo | where Platform == @"LocalAgents" | extend AgentInfo = parse_json(RawAgentInfo).localAgentMetadata | where isnotempty( AgentInfo) | extend DeviceName = tostring(AgentInfo.deviceName) | summarize Devices = make_set(DeviceName), TotalDevices = dcount(DeviceName,4) by Name | project Agent=Name, TotalDevices, Devices ```
This KQL query set is designed to analyze and inventory local AI agents detected by Microsoft Defender for Endpoint. It uses the AgentsInfo table to provide insights into which devices have local AI agents installed and how these agents are distributed across devices in your environment. Here's a simple breakdown of the two queries:
Devices with Local AI Agents:
AI Agents and Total Devices:
Overall, these queries help you understand the distribution and prevalence of local AI agents across devices in your network.

Alex Verboon
Released: June 12, 2026
Tables
Keywords
Operators