# Tailscale

This guide describes how to connect P0 to your Tailscale network to enable just-in-time SSH access governed by your Tailscale policy file.

### Before you begin

* You must have an active Tailscale account.
* You must have an Tailscale API key. API keys can be generated from the [Keys](https://login.tailscale.com/admin/settings/keys) page of the admin console provided you have either an **Owner**, **Admin**, or **Network admin** role.
* P0 manages access by dynamically inserting temporary grants into your Tailscale policy file. Ensure you are comfortable with an automated service managing these grants.
* Installed the [P0 CLI package](https://github.com/p0-security/p0cli) if you are making requests through PO CLI.

### Setting up Tailscale

The installation process involves generating an API key in Tailscale and providing it to P0.

1. Navigate to the **Integrations** page on [p0.app](https://p0.app), under **Resources** click **Tailscale**.

   <figure><img src="/files/PVh19yyY153c2jo7PRVx" alt="P0 Integrations page with Tailscale selected." width="375"><figcaption></figcaption></figure>
2. Click the **Tailscale policy management**.

   <figure><img src="/files/vi7zBvJtVsnftfwkxVfV" alt="Tailscale policy management page in P0." width="563"><figcaption></figcaption></figure>
3. Click **Add organization**. Give an **Organization identifier** and click **Next**.
4. Enter your **API key**.
5. Click **Finish**.

{% hint style="success" %}
Congratulations! You have successfully set up Tailscale for P0. You can return to the Tailscale policy management page at any time to update the API Key by toggling on **Hash**.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.p0.dev/integrations/resource-integrations/tailscale.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
