← Back to SOC feed Coverage →

AI Agents - Orphaned Agents with Disabled Owners

kql MEDIUM Azure-Sentinel
T1078T1562
IdentityInfo
backdoorhuntingmicrosoftofficialpersistence
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-04-21T09:00:00Z · Confidence: medium

Hunt Hypothesis

Orphaned AI agents with disabled or removed owners may indicate adversary activity leveraging abandoned resources to persist or execute malicious payloads. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential security gaps and mitigate risks associated with unaccounted AI agents.

KQL Query

let EnabledAccountUpns =  
    IdentityInfo  
    | where IsAccountEnabled == 1  
    | distinct AccountUpn;  
AIAgentsInfo  
| where RegistrySource != "A365"
| summarize arg_max(Timestamp, *) by AIAgentId  
| where AgentStatus != "Deleted"   
| where not(OwnerAccountUpns in (EnabledAccountUpns))
| project-reorder AgentCreationTime, AIAgentId, AIAgentName, AgentStatus, CreatorAccountUpn, OwnerAccountUpns

Analytic Rule Definition

id: 5e0f4a6b-7c8d-9e0f-1a2b-3c4d5e6f7a8b
name: AI Agents - Orphaned Agents with Disabled Owners
description: |
  This query identifies AI agents whose owners are either disabled or removed from the organization. 
  Orphaned agents without an active owner pose governance and security risks because no one is accountable for their configuration, updates, or potential misuse. 
  If these agents remain active, they could retain sensitive connections or perform actions without proper oversight, increasing the risk of unauthorized access or persistence in the environment.
  Recommended Action: Assign a new active owner to each orphaned agent or retire the agent if it`s no longer needed. Regularly review ownership to maintain compliance and security governance.
requiredDataConnectors: []
tactics:
  - Persistence
  - DefenseEvasion
relevantTechniques:
  - T1078
  - T1562
query: |
  let EnabledAccountUpns =  
      IdentityInfo  
      | where IsAccountEnabled == 1  
      | distinct AccountUpn;  
  AIAgentsInfo  
  | where RegistrySource != "A365"
  | summarize arg_max(Timestamp, *) by AIAgentId  
  | where AgentStatus != "Deleted"   
  | where not(OwnerAccountUpns in (EnabledAccountUpns))
  | project-reorder AgentCreationTime, AIAgentId, AIAgentName, AgentStatus, CreatorAccountUpn, OwnerAccountUpns
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: OwnerAccountUpns
  - entityType: Host
    fieldMappings:
      - identifier: HostName
        columnName: AIAgentName

version: 1.0.0

Required Data Sources

Sentinel TableNotes
IdentityInfoEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/AI Agents/Copilot Studio Connector/OrphanedAIAgents.yaml