> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-runtime-security/dashboards-and-reports/monitor-dashboards-and-reports/advanced-configuration/create-custom-widgets/create-widgets-using-ai.md).

# Create widgets using AI

Use natural language prompts to request visual insights by instructing the **Agentic Assistant** to display its findings as charts or graphs. This makes it easy to visualize data for threat hunting, business intelligence, or investigations without writing XQL queries or manually creating data visualization.

When you request a visualization, the agent generates an XQL query, executes it, and then presents the results in a graph. **Agentic Assistant** supports all graph types supported by the Cortex Platform.

{% stepper %}
{% step %}
**From the Widget Library, select Create widget > Generate with AI.**
{% endstep %}

{% step %}
**Input a natural language prompt describing the security metrics you want to evaluate.**

For example: *"Show me a bar chart of failed user logins sorted by country over the last week"*.

The **Agentic Assistant** parses your request and creates a widget visualization.
{% endstep %}

{% step %}
**(Optional) Provide additional prompts to refine the widget using the Agentic Assistant.**
{% endstep %}

{% step %}
**(Optional) Refine the widget manually in XQL.**

Click the three dots icon on the widget and **Edit in XQL** to open the query in the **Query Builder**. You can edit the query or use the **Chart Editor** to change the visualization. See [Create XQL widgets](/cortex-cloud-runtime-security/dashboards-and-reports/monitor-dashboards-and-reports/advanced-configuration/create-custom-widgets/create-xql-widgets.md) for instructions.
{% endstep %}

{% step %}
**Save to the Widget Library.**

Click the three dots icon on the widget and **Save as Widget**. You can define the widget name, description, and visibility level (Public or Restricted).
{% endstep %}
{% endstepper %}

**Best practices for prompting**\
We recommend using clear specific language to request that the agent create these visualizations. Use terminology such as:

* Create a pie chart showing the distribution of issue severities over the last 7 days.
* Visualize the top 10 targeted assets by malware in a bar chart.
* Generate a line chart tracking the number of failed login attempts per day for the past month.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-cloud-runtime-security/dashboards-and-reports/monitor-dashboards-and-reports/advanced-configuration/create-custom-widgets/create-widgets-using-ai.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
