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

# Manage agent tokens

Manage tokens per agent to retrieve the password used to run functions at the agent.

You can now run some of the agent functions that require administrative passwords using a unique token shared between Cortex Cloud 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.

{% hint style="info" %}
**Note:**

Agent tokens are only supported for Windows and Mac.
{% endhint %}

### View agent password.

You can view the password of the selected agent. The dialog box indicates whether the password is from a rolling token or a temporary token.

```
1. Select Inventory → 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.

### Add a temporary token.

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

{% hint style="info" %}
**Note:**

You can select a one or multiple agents to add a temporary token.
{% endhint %}

```
1. Select Inventory → 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 on the agent.

### 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 on 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 on 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-cloud-runtime-security/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.
