> 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-xdr-5.x/reference-and-developer-docs/role-based-access-control/investigation-and-response-permissions/search-permissions/query-library-permissions.md).

# Query Library permissions

Controls access to the Query Library, which is a repository of saved XQL queries within Cortex XDR. It allows users to save, organize, share, and reuse XQL queries across the team. Key capabilities include:

* Browse, search, and filter saved queries by name, labels, and type
* Save new queries from XQL Search results
* Share queries with specific users or make them public

Users can primarily access Query Library from **Investigation & Response** → **Search** → **XQL Search**, and select the **Query Library** tab.

{% hint style="info" %}

### Note

Users must have at least View permission in **Query Center** to access the **Query Library** from **Query Center**.

If you want to execute and schedule queries from the Query Library, you also need View/Edit permission in the **Query Center**.
{% endhint %}

Cortex XDR enforces least-privileged per-object access by allowing you to manage access for individual instances of Saved Queries. For more information, see [Manage access to objects.](/cortex-xdr-5.x/onboard-cortex-xdr/post-deployment-steps/manage-user-roles-and-access-management/manage-access-to-objects.md)

| Permission | Description                                                                                                                                                                                                                                                                                                                                                                              | Roles Example                                       |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
| Enabled    | <p>Users can browse, search, filter, and view saved queries. Users can also save, edit, delete, and share their own queries. Users can also be granted:</p><ul><li><strong>Create Queries:</strong> Users can edit, delete, and share queries.</li><li><strong>Edit Public Queries</strong>: Adds the ability to edit and delete public/shared queries created by other users.</li></ul> | Most roles require creating/editing public queries. |
| Disabled   | No access to the **Query Library**.                                                                                                                                                                                                                                                                                                                                                      |                                                     |

**Required and recommended permissions**

| Permission     | Permission Level  | Reason                                                                                                                                                                                                                           |
| -------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Query Center   | View or View/Edit | <ul><li>View: The XQL Search page (where the Query Library lives) requires this permission. Without it, users cannot access the page. Required.</li><li>View/Edit. Required if users want to run and schedule queries.</li></ul> |
| Dataset Access | N/a               | Required. Queries reference specific datasets. Without dataset access, queries will return errors or empty results.                                                                                                              |
| Dashboards     | Enabled           | Strongly recommended for users to take a query from the Library and instantly turn it into a Dashboard widget for persistent monitoring.                                                                                         |
| Reports        | Enabled           | Recommended for users who need to link a Library query to a scheduled report (e.g., a weekly "Top 10 Blocked IPs" report).                                                                                                       |


---

# 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-xdr-5.x/reference-and-developer-docs/role-based-access-control/investigation-and-response-permissions/search-permissions/query-library-permissions.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.
