← Back to SOC feed Coverage →

AI Agents - Organization-wide Shared

kql MEDIUM Azure-Sentinel
IdentityInfo
backdoorcredential-thefthuntingmicrosoftofficial
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-07-02T23:00:00Z · Confidence: medium

Hunt Hypothesis

This hunt targets the potential exposure of sensitive data by identifying AI agents configured with organization-wide sharing permissions, which may inadvertently grant excessive access to unauthorized users. Proactively hunting for these configurations in Azure Sentinel is critical to mitigate the risk of lateral movement and data exfiltration stemming from overly permissive agent scopes before they are exploited by adversaries.

KQL Query

let IdentityIdtoUPN = materialize (
    IdentityInfo
    | where isnotempty(AccountObjectId) and isnotempty(AccountUpn)
    | summarize arg_max(Timestamp, AccountUpn) by AccountObjectId
    | project AccountObjectId = tostring(AccountObjectId), AccountUpn);
AgentsInfo
| summarize arg_max(Timestamp, *) by AgentId
| where LifecycleStatus != "Deleted"
| where array_length(SharedWith) > 0
| mv-expand Shared = SharedWith to typeof(string)
| where tostring(Shared) == "*"
| extend OwnerId = tostring(Owners[0])
| join kind=leftouter IdentityIdtoUPN on $left.OwnerId == $right.AccountObjectId
| project-rename OwnerUpn = AccountUpn
| project-away Shared, OwnerId, AccountObjectId
| project-reorder CreatedDateTime, AgentId, Name, Platform, SharedWith, OwnerUpn

Analytic Rule Definition

id: 8a53cf8e-04b1-4de6-95f2-916cc7c2b805
name: AI Agents - Organization-wide Shared
description: |
  This query identifies AI agents that are shared with the entire organization (SharedWith contains "*").
  Such configurations significantly increase the risk of unauthorized access by unintended users, which could lead to data exposure or misuse of agent capabilities.
  Broad sharing is especially sensitive when the agent has access to sensitive data sources, tools, or credentials.
  Recommended Action: Review these agents to confirm whether organization-wide sharing is necessary for the business scenario.
  If not, restrict access to specific users or groups and apply least-privilege principles. For broadly shared configurations, ensure proper governance and compliance checks are in place.
requiredDataConnectors: []
tactics: []
relevantTechniques: []
query: |
  let IdentityIdtoUPN = materialize (
      IdentityInfo
      | where isnotempty(AccountObjectId) and isnotempty(AccountUpn)
      | summarize arg_max(Timestamp, AccountUpn) by AccountObjectId
      | project AccountObjectId = tostring(AccountObjectId), AccountUpn);
  AgentsInfo
  | summarize arg_max(Timestamp, *) by AgentId
  | where LifecycleStatus != "Deleted"
  | where array_length(SharedWith) > 0
  | mv-expand Shared = SharedWith to typeof(string)
  | where tostring(Shared) == "*"
  | extend OwnerId = tostring(Owners[0])
  | join kind=leftouter IdentityIdtoUPN on $left.OwnerId == $right.AccountObjectId
  | project-rename OwnerUpn = AccountUpn
  | project-away Shared, OwnerId, AccountObjectId
  | project-reorder CreatedDateTime, AgentId, Name, Platform, SharedWith, OwnerUpn
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: OwnerUpn
  - entityType: Host
    fieldMappings:
      - identifier: HostName
        columnName: Name
version: 1.0.0

Required Data Sources

Sentinel TableNotes
IdentityInfoEnsure this data connector is enabled

References

False Positive Guidance

Here are 5 specific false positive scenarios for the AI Agents - Organization-wide Shared detection rule, including context and recommended filters:

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/AI Agents/AgentsInfoOrganizationWideShared.yaml