1- id : 8f0a7b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c
2- name : AI Agents - Published Generative Orchestration without Instructions
3- description : |
4- 'Identifies published AI agents with generative orchestration that lack configured instructions. This may present
5- a risk to the agent and heighten the likelihood of the agent being influenced to deviate from the intended course
6- of action through prompt injection attacks. Organizations should ensure proper instructions are configured.'
7- requiredDataConnectors : []
8- tactics :
9- - Impact
10- - DefenseEvasion
11- relevantTechniques :
12- - T1499
13- - T1562
14- query : |
15- AIAgentsInfo
16- | summarize arg_max(Timestamp, *) by AIAgentId
17- | where AgentStatus != "Deleted"
18- | extend Config = tostring(todynamic(RawAgentInfo).Bot.Attributes.configuration)
19- | parse Config with * "\"GenerativeActionsEnabled\":" GenerativeActionsEnabled:boolean *
20- | where GenerativeActionsEnabled
21- | extend BotComponents = todynamic(RawAgentInfo).BotComponents
22- | mv-expand BotComponent = BotComponents
23- | where BotComponent has "GptComponentMetadata"
24- | where BotComponent.FormattedValues.componenttype == "Custom GPT"
25- | extend InstructionsRaw = tostring(BotComponent.Attributes.data), AIAgentName
26- | where InstructionsRaw has "instructions"
27- | where BotComponent.Attributes.schemaname endswith ".gpt.default"
28- | extend DisplayNamePos = indexof(InstructionsRaw, "displayName", indexof(InstructionsRaw, "instructions:") + strlen("instructions:"))
29- | extend CapabilitiesPos = indexof(InstructionsRaw, "gptCapabilities", indexof(InstructionsRaw, "instructions:") + strlen("instructions:"))
30- | extend InstructionsStart = indexof(InstructionsRaw, "instructions:") + strlen("instructions:")
31- | extend InstructionsEnd = iif(
32- DisplayNamePos != -1 and CapabilitiesPos != -1,
33- iif(DisplayNamePos < CapabilitiesPos, DisplayNamePos, CapabilitiesPos),
34- iif(DisplayNamePos != -1, DisplayNamePos,
35- iif(CapabilitiesPos != -1, CapabilitiesPos, strlen(InstructionsRaw)))
36- )
37- | extend Instructions = substring(InstructionsRaw, InstructionsStart, InstructionsEnd - InstructionsStart)
38- | where CapabilitiesPos == 43 and CapabilitiesPos == InstructionsEnd
39- | project-away DisplayNamePos, CapabilitiesPos, InstructionsStart, InstructionsEnd
40- | project-reorder AgentCreationTime, AIAgentId, AIAgentName, AgentStatus, CreatorAccountUpn, OwnerAccountUpns
41- | extend AccountCustomEntity = CreatorAccountUpn
42- | extend HostCustomEntity = AIAgentName
43- entityMappings :
44- - entityType : Account
45- fieldMappings :
46- - identifier : FullName
47- columnName : CreatorAccountUpn
48- - entityType : Host
49- fieldMappings :
50- - identifier : HostName
51- columnName : AIAgentName
52- version : 1.0.0
1+ id : 8f0a7b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c
2+ name : AI Agents - Published Generative Orchestration without Instructions
3+ description : |
4+ This query identifies Copilot Studio AI agents that are published with generative orchestration enabled but lack configured instructions.
5+ Missing instructions increase the risk of prompt injection attacks, where malicious input can influence the agent to deviate from its intended behavior.
6+ Without clear guidance, the agent may respond unpredictably or expose sensitive data.
7+ Recommended Action: Ensure all generative orchestration components have well-defined instructions that specify the agent`s purpose, boundaries, and allowed actions.
8+ Regularly review and update instructions to maintain security and prevent misuse.
9+ requiredDataConnectors : []
10+ tactics :
11+ - Impact
12+ - DefenseEvasion
13+ relevantTechniques :
14+ - T1499
15+ - T1562
16+ query : |
17+ AIAgentsInfo
18+ | summarize arg_max(Timestamp, *) by AIAgentId
19+ | where AgentStatus != "Deleted"
20+ | where IsGenerativeOrchestrationEnabled
21+ | extend BotComponents = todynamic(RawAgentInfo).BotComponents
22+ | mv-expand BotComponent = BotComponents
23+ | where BotComponent has "GptComponentMetadata"
24+ | where BotComponent.FormattedValues.componenttype == "Custom GPT"
25+ | extend InstructionsRaw = tostring(BotComponent.Attributes.data), AIAgentName
26+ | where InstructionsRaw has "instructions"
27+ | where BotComponent.Attributes.schemaname endswith ".gpt.default"
28+ | extend DisplayNamePos = indexof(InstructionsRaw, "displayName", indexof(InstructionsRaw, "instructions:") + strlen("instructions:"))
29+ | extend CapabilitiesPos = indexof(InstructionsRaw, "gptCapabilities", indexof(InstructionsRaw, "instructions:") + strlen("instructions:"))
30+ | extend InstructionsStart = indexof(InstructionsRaw, "instructions:") + strlen("instructions:")
31+ | extend InstructionsEnd = iif(
32+ DisplayNamePos != -1 and CapabilitiesPos != -1,
33+ iif(DisplayNamePos < CapabilitiesPos, DisplayNamePos, CapabilitiesPos),
34+ iif(DisplayNamePos != -1, DisplayNamePos,
35+ iif(CapabilitiesPos != -1, CapabilitiesPos, strlen(InstructionsRaw)))
36+ )
37+ | extend Instructions = substring(InstructionsRaw, InstructionsStart, InstructionsEnd - InstructionsStart)
38+ | where isempty(Instructions)
39+ | project-away DisplayNamePos, CapabilitiesPos, InstructionsStart, InstructionsEnd
40+ | project-reorder AgentCreationTime, AIAgentId, AIAgentName, AgentStatus, CreatorAccountUpn, OwnerAccountUpns
41+ entityMappings :
42+ - entityType : Account
43+ fieldMappings :
44+ - identifier : FullName
45+ columnName : CreatorAccountUpn
46+ - entityType : Host
47+ fieldMappings :
48+ - identifier : HostName
49+ columnName : AIAgentName
50+ version : 1.0.0
0 commit comments