Pivot In Every Prompt Injection Detection For Investigation
Query
// Prompt-injection detections over the last 30 days, including details
let lookback = 30d;
EmailEvents
| where Timestamp > ago(lookback)
| where DetectionMethods has "Prompt injection"
| project Timestamp, NetworkMessageId, SenderFromAddress, RecipientEmailAddress,
Subject, DeliveryAction, DeliveryLocation, DetectionMethods
| sort by Timestamp descAbout this query
Pivot in every prompt-injection detection for investigation
Description
This query helps investigate further, once you've run Uncover every prompt-injection detection and its disposition.
Microsoft Defender XDR
Versioning
| Version | Date | Comments |
|---|---|---|
| 1.0 | 08/10/2026 | Initial publish |
Explanation
This query is designed to help investigate prompt-injection detections in email communications over the past 30 days. It is a follow-up step after identifying such detections and their outcomes. Here's a simple breakdown of what the query does:
- Time Frame: It looks at email events from the last 30 days.
- Filter for Prompt Injection: It specifically filters for email events where the detection method includes "Prompt injection."
- Select Relevant Information: The query retrieves specific details about these events, including:
- The time the event was recorded (
Timestamp). - A unique identifier for the email (
NetworkMessageId). - The sender's email address (
SenderFromAddress). - The recipient's email address (
RecipientEmailAddress). - The subject of the email (
Subject). - The action taken on the email (e.g., delivered, blocked) (
DeliveryAction). - Where the email was delivered (
DeliveryLocation). - The methods used to detect the threat (
DetectionMethods).
- The time the event was recorded (
- Sort the Results: The results are sorted by the timestamp in descending order, meaning the most recent events appear first.
This query is part of a broader investigation process to understand and respond to prompt-injection threats detected by Microsoft Defender XDR.