A Tailscale API access token lets whoever holds it manage your tailnet through the Tailscale API. That covers the device list, the access control policy, auth keys and other settings for the private network. A token with that reach can add a device, change who can reach what, and create new keys that keep working after the token itself is gone. Because the tailnet is the network that holds your internal services, this is one of the more serious leaks for an infrastructure team. Revoke it first, then check what changed on the network.
Check your GitHub account for leaked secrets — free
- Provider
- Tailscale
- Severity
- Critical
- Impact
- Cloud infrastructure access
- Checked live by LeakWatch
- Yes
What a Tailscale API Access Token looks like
Tailscale API access tokens start with tskey-api-. A longer value follows, containing a CNTRL- marker before its final block. The whole token is one string with no spaces:
tskey-api-k…CNTRL-… Tailscale API access token (masked)
The tskey- family is shared by several Tailscale credentials, so the middle part matters. An api token manages the tailnet through the API, while an auth key is used only to join a device to the network. An auth key can be less dangerous than an API token, but it still lets a machine enrol, so do not assume the prefix alone tells you how serious a leak is. Check the part after tskey- before you decide how urgent the response is.
How Tailscale API Access Tokens get leaked
- Infrastructure code. A provider or script that writes the token into a file that is then committed, often next to other cloud credentials.
- CI pipelines. A build step that prints environment variables, or a job that passes the token in a command line visible in logs.
- Helper scripts. A small automation for listing devices or rotating auth keys, shared with the token still inside it.
- Dotfiles and backups. A home directory synced to a repository or a shared drive, including a shell profile where someone exported the token.
- Pasted examples. A token copied into a support thread or a forum post when asking why an API call returns an error.
What to do in the first hour
- Revoke the token. Open the account settings for your tailnet and revoke the API access token that leaked. Do this first, because an active token can change the network while you investigate.
- Create a replacement with the shortest expiry that your automation can cope with, and store it in a secret manager. Tokens can last up to 90 days, so a short expiry limits the window if another leak happens.
- Review the device list. Look for machines you do not recognize, especially recently added ones and any that appeared after the exposure date.
- Review the access policy. Check recent changes to the access control policy. An attacker who can edit it can open paths to services that were private before.
- Review keys. Check the list of auth keys and remove any you did not create. A key created during the exposure window can let a machine join the network later, even after the token is revoked.
- Check the audit log. The admin console records key creation and related events. Filter to the period since the exposure and look for actions you did not take.
- Clean the repository. Remove the token from the files that held it and keep the value in a secret store. For a wider search across your history, see deep-scan your whole git history.
Not sure what else leaked from the same place? Run a free scan.
Revoke it at Tailscale
API access tokens are managed on the Keys page of the admin console. Open the API access tokens section, find the token and select Revoke next to it. A revoked token stops working at once, and it appears among the recently revoked tokens on the same page. Generating a new token needs an owner, admin, IT admin or network admin role on the tailnet. The admin console labels can change, so follow what you see on the page. If you cannot find the token, check that you are signed in to the right tailnet.
LeakWatch also checks whether a detected token is still accepted by Tailscale, using a validator tied to this rule. A token that has been revoked or has expired will not pass that check.
How LeakWatch detects it
The rule is called Tailscale API Access Token. It looks for the tskey-api-k prefix, a short block of letters and digits, the CNTRL- marker and a final block of letters and digits, with word boundaries on both sides. Other tskey- values, such as auth keys, are not matched by this rule. The severity is critical, with the impact class for infrastructure and cloud access. This type is checked live: LeakWatch can check whether a detected token is still active, so you can tell an expired value from a working one.
LeakWatch can check whether a detected key is still active with a read-only request to Tailscale. It never reads your data or spends your credits.
FAQ
Is an expired token still a risk?
Usually not for API calls, but check that the value really expired and was not renewed. Keys created while the token was valid may still be active, so review the key list either way.
Can I just shorten the expiry of the old token?
No. Expiry can only be set when a token is created, and you cannot extend an expired one. Revoke the leaked token, then generate a new one with the expiry you want.
What if my automation breaks after revoking?
Create the new token, deploy it through your secret store, then run the automation once to confirm it works. A short outage is better than a token that keeps working for someone else.