Query Details

Copilot - Jailbreak Detection

Copilot Jailbreak Detected

Query

CopilotActivity
| where RecordType == "CopilotInteraction"
| extend LLMData = parse_json(LLMEventData)
| mv-expand Message = LLMData.Messages
| extend JailbreakDetected = tobool(Message.JailbreakDetected)
| where JailbreakDetected == true
//| project TimeGenerated, ActorName, AppHost, AIModelName, MessageId = tostring(Message.Id), IsPrompt = tobool(Message.isPrompt)
| order by TimeGenerated desc

About this query

Explanation

This KQL query is designed to detect and retrieve events related to "jailbreak" attempts in Microsoft Copilot, which is an AI-powered tool. Here's a simple breakdown of what the query does:

  1. Data Source: It looks at the CopilotActivity table, which contains records of interactions with Copilot.

  2. Filtering:

    • The query specifically filters for records where the RecordType is "CopilotInteraction", indicating that these are interactions with the Copilot tool.
    • It then parses the LLMEventData field to extract JSON data and focuses on the Messages within this data.
  3. Jailbreak Detection:

    • It checks each message to see if a jailbreak attempt was detected by converting the JailbreakDetected field to a boolean.
    • The query filters to only include messages where JailbreakDetected is true, meaning a jailbreak attempt was identified.
  4. Sorting: The results are ordered by the time the event was generated, with the most recent events appearing first.

  5. Additional Log Entry:

    • Another log entry is provided, which also looks at the CopilotActivity table.
    • It parses the LLMEventData to extract accessed resources and checks if any resource name matches "JailBreak".
    • This log entry projects various fields like TimeGenerated, Action, Id, Name, Type, and others, providing additional context about the jailbreak attempt.

Overall, this query is part of a testing phase to monitor and detect jailbreak attempts in interactions with Microsoft Copilot, helping to ensure the security and integrity of the AI tool.

Details

Alex Verboon profile picture

Alex Verboon

Released: May 15, 2026

Tables

CopilotActivity

Keywords

CopilotActivityJailbreakMessageResourceActionIdNameTypeSrcIpAddrWorkloadAppHostAppIdentity

Operators

CopilotActivitywhereextendparse_jsonmv-expandtoboolorder bytostringproject

MITRE Techniques

Actions

GitHub