Query Details
# *AI Agent with Weak Authentication or Access Control*
## Query Information
#### MITRE ATT&CK Technique(s)
| Technique ID | Title | Link |
| --- | --- | --- |
| | | |
#### Description
This rule detects AI Agents configured with weak authentication types (None, Anonymous) or overly permissive access control policies ('allowedForAll' or 'unrestricted' capabilities). Such configurations can expose the AI Agent to unauthorized access or manipulation.
#### Author <Optional>
- **Name: Benjamin Zulliger**
- **Github: https://github.com/benscha/KQLAdvancedHunting**
- **LinkedIn: https://www.linkedin.com/in/benjamin-zulliger/**
## Defender XDR
```KQL
AIAgentsInfo
| where TimeGenerated >= ago(7d)
| extend RawInfo = parse_json(RawAgentInfo)
| extend AuthTrigger = toint(RawInfo.Bot.Attributes.authenticationtrigger.Value)
| extend IsStateActive = toint(RawInfo.Bot.Attributes.statecode.Value) == 0
| where UserAuthenticationType in~ ("None", "Anonymous")
or AccessControlPolicy =~ "allowedForAll"
or AccessCapabilities has "unrestricted"
| project TimeGenerated,
AIAgentId,
AIAgentName,
LastModifiedByUpn,
UserAuthenticationType,
AccessControlPolicy,
AccessCapabilities,
AgentStatus
| extend HostCustomEntity = LastModifiedByUpn```
This query is designed to identify AI Agents that have weak security settings, specifically focusing on authentication and access control. Here's a simplified breakdown:
Data Source: The query looks at information from a dataset called AIAgentsInfo.
Time Frame: It examines data from the past 7 days.
Security Checks:
Output: The query outputs a list of AI Agents with the following details:
TimeGenerated).AIAgentId).AIAgentName).LastModifiedByUpn).UserAuthenticationType).AccessControlPolicy).AccessCapabilities).AgentStatus).Additional Information: The query also extends the output with a custom entity (HostCustomEntity) based on the user who last modified the agent.
Overall, this query helps identify AI Agents that might be vulnerable to unauthorized access due to weak authentication and access control settings.

Benjamin Zulliger
Released: June 8, 2026
Tables
Keywords
Operators