> 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-3.x/cortex-xdr-3.x-documentation/endpoint-security/install-and-manage-endpoints/manage-endpoint-protection/manage-agent-tokens.md).

# Manage agent tokens

You can now run some of the agent functions that require administrative passwords using a unique token shared between Cortex XDR and Cortex XDR agent.

Two types of tokens can be set:

* **Rolling token:** Automatically generated per endpoint every fourteen days by the system and then sent to the relevant agent
* **Temporary token:** Set a temporary token that is valid anywhere from one to twenty-one days.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>Agent token is supported from Cortex XDR server version 3.3 and Cortex XDR agent version 7.7.1. It is only supported for Windows and Mac.</p></div>

1. View agent password.

   You can view the password of the selected agent. Whether the password is from a rolling token or a temporary token is indicated in the dialog.

   1. Select **Endpoints** → **All Endpoints** → **Endpoint Control** → **View Token**.
   2. Click the copy button to copy the password displayed and then click **Ok**.

   You can now use the password to run functions at the agent.
2. Add a temporary token.

   You can generate a temporary token for any of the agents for a specified number of days between one to twenty-one days. If the agent is disconnected, it gets the temporary token when the agent connects.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><h3>Note</h3><p>You can select a single or many endpoints at once to add a temporary token.</p></div>

   1. Select **Endpoints** → **All Endpoints** → **Endpoint Control** → **Set Temporary Token**.
   2. In the **Token Expiration** field, add the number of days for which to generate a temporary token for the agent and then click the **Add Token Expiration** blue arrow.
   3. Click the copy button to copy the password displayed and then click **Create** to begin generating the token.
   4. Go to the **Action Center** to view which agent received the temporary token.

   You can now use the password to run functions at the agent.
3. Retrieve the token using the token hash from the endpoint.

   If the endpoint is disconnected from the server at the point the rolling token was updated, it won’t be possible to run agent functions with the updated token from the server. You can still retrieve the password to run functions at the agent.

   1. From the agent, run the `cytool.exe` to run the **token query** command. This command displays the current token of the endpoint.
   2. Copy the token from the command line interface of the agent.
   3. In the server, at the top of the page, click **Retrieve Token**.
   4. In the **Retrieve Token** dialog box, in the **Hash** field, paste the token that you copied from the endpoint.
   5. Click the copy button to copy the password displayed and then click **Ok**.

      You can now use the password to run functions at the agent.


---

# 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-3.x/cortex-xdr-3.x-documentation/endpoint-security/install-and-manage-endpoints/manage-endpoint-protection/manage-agent-tokens.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.
