Skip to content

Commit 5a93d77

Browse files
authored
Merge pull request #5774 from MicrosoftDocs/poliveria-hunting-agent-11272025
Add docs for Copilot query assistant and threat hunting agent
2 parents a89cd52 + 7f48bcf commit 5a93d77

16 files changed

+283
-85
lines changed

defender-xdr/TOC.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,14 @@
160160
href: advanced-hunting-overview.md
161161
- name: Guided and advanced modes
162162
href: advanced-hunting-modes.md
163-
- name: Generate KQL queries with Security Copilot
164-
href: advanced-hunting-security-copilot.md
163+
- name: Hunt for threats with Security Copilot
164+
items:
165+
- name: Overview
166+
href: advanced-hunting-security-copilot.md
167+
- name: Use the Threat Hunting Agent
168+
href: advanced-hunting-security-copilot-threat-hunting-agent.md
169+
- name: Generate KQL queries
170+
href: advanced-hunting-security-copilot-query-assistant.md
165171
- name: Hunt over Microsoft Sentinel data
166172
items:
167173
- name: Microsoft Sentinel data in advanced hunting
@@ -458,8 +464,10 @@
458464
href: security-copilot-defender-identity-summary.md
459465
- name: Use guided responses
460466
href: security-copilot-m365d-guided-response.md
467+
- name: Hunt for threats using natural language
468+
href: advanced-hunting-security-copilot-threat-hunting-agent.md
461469
- name: Generate KQL queries
462-
href: advanced-hunting-security-copilot.md
470+
href: advanced-hunting-security-copilot-query-assistant.md
463471
- name: Create incident reports
464472
href: security-copilot-m365d-create-incident-report.md
465473
- name: Responsible AI FAQs
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: Microsoft Security Copilot advanced hunting query assistant
3+
description: Learn how Microsoft Security Copilot threat hunting agent can help you can generate a KQL query for you.
4+
search.appverid: met150
5+
ms.service: defender-xdr
6+
ms.subservice: adv-hunting
7+
f1.keywords:
8+
- NOCSH
9+
ms.author: pauloliveria
10+
author: poliveria
11+
ms.localizationpriority: medium
12+
audience: ITPro
13+
ms.collection:
14+
- m365-security
15+
- tier1
16+
- security-copilot
17+
- magic-ai-copilot
18+
ms.custom:
19+
- cx-ti
20+
- cx-ah
21+
ms.topic: how-to
22+
ms.date: 12/08/2025
23+
appliesto:
24+
- Microsoft Defender
25+
- Microsoft Defender XDR
26+
- Microsoft Sentinel in the Microsoft Defender portal
27+
---
28+
29+
# Microsoft Security Copilot advanced hunting query assistant
30+
31+
[Microsoft Security Copilot in Microsoft Defender](security-copilot-in-microsoft-365-defender.md) includes a query assistant feature for advanced hunting.
32+
33+
Threat hunters or security analysts who aren't familiar with or haven't learned Kusto query language (KQL) can make a request or ask a question in natural language (for example, *Get all alerts involving user admin123*). Security Copilot then generates a KQL query that matches the request by using the advanced hunting data schema.
34+
35+
This feature reduces the time it takes to write a hunting query from scratch, so threat hunters and security analysts can focus on hunting and investigating threats.
36+
37+
Users with access to Security Copilot can use this feature in advanced hunting.
38+
39+
> [!NOTE]
40+
> The advanced hunting capability is also available in the Security Copilot standalone experience through the Microsoft Defender XDR plugin. Know more about [preinstalled plugins in Security Copilot](/security-copilot/manage-plugins#preinstalled-plugins).
41+
42+
## Try your first request
43+
To start using the Query assistant, follow these steps:
44+
45+
>[!NOTE]
46+
> Make sure that the Query assistant mode is active. [Learn more](advanced-hunting-security-copilot.md#get-access)
47+
48+
1. Open the **Advanced hunting** page from the navigation bar in Microsoft Defender portal. The Security Copilot side pane for advanced hunting appears at the right hand side.
49+
50+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-pane-big.png" alt-text="Screenshot of the Copilot pane in advanced hunting." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-pane-big.png":::
51+
52+
You can also reopen Copilot by selecting **Copilot** at the top of the query editor.
53+
54+
55+
1. In the Copilot prompt bar, ask any threat hunting query that you want to run and press :::image type="icon" source="./media/advanced-hunting-security-copilot/Send.png" border="false"::: or **Enter**.
56+
57+
58+
59+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-query-big.png" alt-text="Screenshot that shows prompt bar in the Security Copilot for advanced hunting." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-query-big.png":::
60+
61+
1. Copilot generates a KQL query from your text instruction or question. While Copilot is generating, you can cancel the query generation by selecting **Stop generating**.
62+
63+
![Screenshot of Security Copilot in advanced hunting generating a response.](./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-generate.png)
64+
65+
66+
1. Review the generated query. To check how Copilot came up with the query, you can select **See the logic behind the query** below the query text to expand the explanation behind the query. Select it again to minimize.
67+
68+
![Screenshot of Copilot button showing See the logic behind the query.](./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-see-logic.png)
69+
70+
You can then choose to run the query by selecting **Run query**.
71+
72+
![Screenshot of Copilot button showing Run query option.](./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-run-query.png)
73+
74+
The generated query then appears as the last query in the query editor and runs automatically.
75+
76+
If you need to make further tweaks, select **Add to editor**.
77+
78+
![Screenshot of Security Copilot in advanced hunting showing the Add to editor option.](./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-add-editor.png)
79+
80+
The generated query appears in the query editor as the last query, where you can edit it before running using the regular **Run query** above the query editor.
81+
82+
83+
1. You can provide feedback about the generated response by selecting the feedback icon ![Screenshot of feedback icon.](./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-feedback-icon.png) and choosing **Looks right**, **Needs improvement**, or **Inappropriate**.
84+
85+
86+
> [!TIP]
87+
> Providing feedback is an important way to let the Security Copilot team know how well the query assistant was able to help in generating a useful KQL query. Feel free to articulate what could make the query better, what adjustments you had to make before running the generated KQL query, or share the KQL query that you eventually used.
88+
89+
90+
## Modify settings
91+
92+
Select the three-dot menu in the Copilot side pane to choose whether to automatically add and run the generated query in advanced hunting.
93+
94+
![Screenshot of Security Copilot in advanced hunting showing the settings three-dot menu icon.](./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-settings.png)
95+
96+
If you deselect the **Run generated query automatically** setting, you can choose to run the generated query automatically (**Add and run**) or add the generated query to the query editor for further modification (**Add to editor**).
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
title: Microsoft Security Copilot Threat Hunting Agent in advanced hunting
3+
description: Learn how Microsoft Security Copilot threat hunting agent can help you investigate threats using natural language.
4+
search.appverid: met150
5+
ms.service: defender-xdr
6+
ms.subservice: adv-hunting
7+
f1.keywords:
8+
- NOCSH
9+
ms.author: pauloliveria
10+
author: poliveria
11+
ms.localizationpriority: medium
12+
audience: ITPro
13+
ms.collection:
14+
- m365-security
15+
- tier1
16+
- security-copilot
17+
- magic-ai-copilot
18+
ms.custom:
19+
- cx-ti
20+
- cx-ah
21+
ms.topic: how-to
22+
ms.date: 12/08/2025
23+
appliesto:
24+
- Microsoft Defender
25+
- Microsoft Defender XDR
26+
- Microsoft Sentinel in the Microsoft Defender portal
27+
---
28+
29+
# Microsoft Security Copilot Threat Hunting Agent in advanced hunting (preview)
30+
31+
[!INCLUDE [Prerelease](../includes/prerelease.md)]
32+
33+
The Microsoft Security Copilot Threat Hunting Agent is an AI-powered agent that revolutionizes threat hunting by enabling you to investigate threats using natural language from start to finish. Unlike traditional hunting methods that rely heavily on Kusto query language (KQL) expertise, the Threat Hunting Agent transforms complex data into actionable insights quickly and intuitively, helping you drive the investigation into actions.
34+
35+
The Threat Hunting Agent goes beyond query generation by delivering a complete, conversational threat hunting experience. It not only generates queries but also interprets results, surfaces insights, and guides you through full hunting sessions. These capabilities empower analysts of all levels to hunt threats faster, more accurately, and with greater confidence.
36+
37+
## Key capabilities
38+
- **Natural language question to natural language answer.** Ask any data-related question in natural language (for example, *Which devices communicated with IPs in France in the last 24 hours?*) and receive direct conversational answers backed by KQL queries and tabular results.
39+
40+
- **Conversational flow.** The agent keeps track of context throughout your hunting session, enabling you to ask follow-up questions that build on previous ones and ensuring continuity across the entire session.
41+
42+
- **Observations.** The agent provides natural language observations and charts (pie, timeline, or vertical bar) to simplify result analysis. It selects relevant chart fields automatically, but you can change the chart type or grouping afterward.
43+
44+
- **Insight generation.** The agent surfaces additional contextual insights from related data sources to enrich your investigation, helping you discover connections and patterns that might otherwise be missed.
45+
46+
- **Smart suggestions.** The agent provides dynamic follow-up questions and remediation actions recommendations, in the context of the investigation, to drive your hunting session forward. These suggestions are available for selection only after the response generation. They're not available for selection when you ask a new question.
47+
48+
- **Integrated experience.** The agent's outputs are directly added to Advanced hunting components, with generated KQL placed in the editor and results displayed as usual. This gives users full access to all advanced hunting features during investigations, ensuring maximum flexibility.
49+
50+
## Try your first request
51+
To start using the Threat Hunting Agent, follow these steps:
52+
53+
>[!NOTE]
54+
> Make sure that the Threat Hunting Agent mode is active. [Learn more](advanced-hunting-security-copilot.md#get-access)
55+
56+
1. Open the **Advanced hunting** page from the navigation bar in Microsoft Defender portal. The Security Copilot side pane for advanced hunting appears at the right hand side.
57+
58+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-pane-big.png" alt-text="Screenshot of the Copilot pane in advanced hunting." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-pane-big.png":::
59+
60+
You can also reopen Copilot by selecting **Copilot** at the top of the query editor.
61+
62+
1. Start your hunting session by selecting a suggested prompt or typing a question in natural language in the prompt bar and pressing :::image type="icon" source="./media/advanced-hunting-security-copilot/Send.png" border="false"::: or Enter.
63+
64+
65+
**Sample questions you can ask the agent:**
66+
- Give me the list of users who sent more than 100 emails in the last 30 days.
67+
- Show me all failed sign-in attempts for admin accounts this week.
68+
- Which devices communicated with suspicious domains today?
69+
70+
The agent supports all types of hunting scenarios, including:
71+
- Investigating an alert or incident
72+
- Investigating a suspicious indicator of compromise (IOC)
73+
- Investigating the impact of an attack reviewed in a threat intelligence report
74+
- Proactively validating a security hypothesis
75+
76+
## Understand the response
77+
When the Threat Hunting Agent responds to your question, you get a comprehensive answer that includes:
78+
79+
- **Direct conversational answer:** A natural language response to your question is displayed in the Copilot side pane.
80+
81+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-answer.png" alt-text="Screenshot of the Copilot pane in advanced hunting with the answer highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-answer.png":::
82+
83+
- **KQL query and results:** The underlying KQL query is generated and run automatically, with the results displayed in the advanced hunting results pane and seamlessly integrated into the experience.
84+
85+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-query.png" alt-text="Screenshot of the advanced hunting page with query and results highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-query.png":::
86+
87+
- **Explanation of how the query was built:** To check how Copilot came up with the query, select **See the logic behind the query** below the query.
88+
89+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-logic.png" alt-text="Screenshot of the Copilot pane in advanced hunting with the logic behind the query highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-logic.png":::
90+
91+
- **Observations:** Data highlights and a chart are displayed above the results, simplifying results analysis. You can change the chart type or field grouping.
92+
93+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-chart.png" alt-text="Screenshot of the advanced hunting page with Copilot-generated chart highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-chart.png":::
94+
95+
- **Contextual insights:** Additional insights derived from various appropriate resources are displayed in the Copilot side pane as part of the natural language response.
96+
97+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-insights.png" alt-text="Screenshot of the Copilot pane in advanced hunting with insights highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-insights.png":::
98+
99+
- **Smart follow-up suggestions:** Recommended next questions or actions are displayed at the bottom of the Copilot side pane to help drive your hunt in the right direction:
100+
101+
- **Follow-up question suggestions** appear and the bottom of the side pane, above the prompt. Select one of the questions to run it automatically.
102+
103+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-suggestions.png" alt-text="Screenshot of the Copilot pane in advanced hunting with follow-up suggestions highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-suggestions.png":::
104+
105+
- You might also get **Action suggestions** in case a remediation action is recommended and needed in the context of your investigation. When you select a suggestion, the **Take actions** wizard opens with the action type and targeted entities already filled out. Complete the wizard to apply the suggested action.
106+
107+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-take-action.png" alt-text="Screenshot of the Copilot pane in advanced hunting with action suggestion highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-take-action.png":::
108+
109+
>[!NOTE]
110+
>You can only select the action suggestions for the last response in the conversation. If you send another question, the previous action suggestions are disabled.
111+
112+
## Continue your investigation
113+
After receiving a response, you can continue your hunting session in several ways:
114+
- **Ask follow-up questions:** The agent maintains context from your session history.
115+
- **Request query modifications:** Ask the agent to modify the generated query.
116+
- **Select suggested actions:** Choose from the follow-up questions or actions suggested by the agent.
117+
- **Use advanced hunting features:** Save your query, export results, create a detection rule, or use any of the other advanced hunting features for the KQL query displayed in the editor and the generated results.
118+
119+
## Start a new session
120+
To start a new hunting session, select the **New chat (+)** icon at the top of the Copilot side pane.
121+
122+
>[!NOTE]
123+
> Starting a new session deletes all chat history, which isn't saved.
124+
125+
## Provide feedback
126+
You can provide feedback directly in the portal by selecting the feedback icon and choosing your response. Your feedback helps improve the Threat Hunting Agent's capabilities and accuracy.
127+
128+
:::image type="content" source="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-feedback.png" alt-text="Screenshot of the advanced hunting page with Copilot feedback buttons highlighted." lightbox="./media/advanced-hunting-security-copilot/advanced-hunting-security-copilot-agent-feedback.png":::
129+
130+
>[!TIP]
131+
> Providing detailed feedback about what worked well or what could be improved helps us continuously enhance the Threat Hunting Agent experience.

0 commit comments

Comments
 (0)