# Leaked Sanity Auth Token? Delete It and Check Content

> Sanity.io auth token exposed in a repo or build log? Delete it in Manage, check document history and datasets, then rotate. Step-by-step guide.

Source: https://leakwatch.net/secrets/sanity-io-auth-token

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Sanity.io Auth Token

Cloud · Secret guide

# Leaked Sanity.io Auth Token: what to do in the first hour

High severityDetected onlyLast verified November 5, 2026 · 4 min read

A [Sanity.io](http://Sanity.io) auth token gives a tool or service access to a Sanity project, which is the content backend that holds the structured content of many websites and apps. A token with write permission can change or delete documents, and a token with read permission can export content that you may not have meant to publish. Sanity tokens are created per project and carry a role, so the first question after a leak is which project the token belongs to and what that role allows.

[Check your GitHub account for leaked secrets — free](/)

Provider

Sanity.io

Severity

High

Impact

SaaS account access and billing

Checked live by LeakWatch

No

## What a Sanity.io Auth Token looks like

Sanity auth tokens begin with `sk`, followed by a long block of letters and digits, which is how the detection rule finds them. The value is a single string:

```text
sk…   Sanity auth token (masked)
```

The `sk` start is short and is also used by other vendors, so the rule relies on the word “sanity” appearing close to the value. Tokens are often stored in a `SANITY_AUTH_TOKEN` environment variable for a deployment, a build hook or a content migration script. A token pasted without any Sanity context may not be found by the scanner, so search your own repositories for the value directly if you suspect one leaked.

## How Sanity.io Auth Tokens get leaked

-   **Environment files.** A `.env` file that contains `SANITY_AUTH_TOKEN` with the real value, committed because `.gitignore` did not list it.
-   **Deployment configuration.** A build or hosting setting that writes the token into a file in the repository.
-   **Migration scripts.** A content import script that was shared with a contractor or posted in a chat with the token inside.
-   **Logs.** A CI job or a Studio build that prints its environment when something fails.
-   **Public templates.** A starter project published with a working token left in its configuration.

## What to do in the first hour

1.  **Delete the token.** Open the account settings for your Sanity project, go to the API section and delete the token that leaked. Deleting cuts off access at once, so do this before you rebuild anything.
2.  **Create a replacement** with the role that the tool actually needs. A build that only reads content should not hold a write token.
3.  **Review the content.** Look at the document history for recent edits, deletions and publishes. Restore anything that was changed without your approval.
4.  **Check the datasets.** If the token could export content, look for exports you do not recognize. Review which datasets are public, since a public dataset can be read without any token at all.
5.  **Check webhooks and integrations** attached to the project, and remove any you did not add.
6.  **Look at other secrets** in the same file, such as deployment keys and other service tokens. Rotate them too. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github) for the order of steps.
7.  **Clean the repository.** Store the token in your hosting provider’s secret settings and remove it from the files. Revocation is the real fix, because a deleted commit remains in clones.

Not sure what else leaked? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at Sanity.io

Tokens are listed in the project’s API settings in Sanity Manage. Open account settings, go to the project’s tokens and delete the one that leaked. Sanity also provides a command-line tool that can list tokens and delete one by its identifier, which is useful for scripting the change. Some tokens can be given an expiry date, which limits the window of a future leak, but an expiry cannot be removed once it is set. We have not confirmed every label in the current interface, so follow the wording you see.

## How LeakWatch detects it

The rule is called [Sanity.io](http://Sanity.io) Auth Token. It looks for the word “sanity” in any case, followed within about 40 characters by a value that begins with `sk` and has 79 further letters or digits, with word boundaries on both sides. Values that do not have the Sanity context are not reported by this rule. The severity is **high**, with the impact class for SaaS tools. This type is not checked live: LeakWatch does not send a request to Sanity with the value it found.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Is a read-only Sanity token still a risk?

Yes, though less. It cannot change content, but it can export whatever it can read, which may include drafts or private datasets. Treat it as exposed.

Can I set an expiry instead of deleting?

An expiry only limits future use. For a token that has already leaked, delete it, because the leaked value keeps working until its expiry.

Will the site stop publishing?

Only the tools that use the deleted token. Create the replacement, deploy it, and test a publish before you rely on it.

## Related

-   [Vercel API Token](/secrets/vercel-api-token)
-   [Netlify Access Token](/secrets/netlify-access-token)
-   [Notion API Token](/secrets/notion-api-token)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Sanity.io.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
