# Leaked Val Town API Token? Revoke It and Review Vals

> Val Town API token exposed in a repo or script? Delete it on the API Tokens page, review your vals and environment variables. Step-by-step guide.

Source: https://leakwatch.net/secrets/val-town-api-token

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Val Town API Token

Cloud · Secret guide

# Leaked Val Town API Token: what to do in the first hour

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

A Val Town API token lets a script or tool act as your Val Town account through the Val Town API. Val Town runs small pieces of JavaScript or TypeScript on its servers, called vals, and some of them hold environment variables with secrets that the vals use. A token with the wrong scope can read or change the code of your vals, and the code can then run with access to whatever those variables open. Revoke the token first, then review the vals and their variables for changes.

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

Provider

Val Town

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

No

## What a Val Town API Token looks like

Val Town API tokens begin with `vtwn_`, followed by a run of letters, digits, underscores and hyphens of moderate length. The prefix is the signal to look for:

```text
vtwn_…XXXX   Val Town API token (masked)
```

Tokens are sent as bearer tokens in an Authorization header. They can be scoped by resource, so a token may be allowed to read vals but not to write them, and some scopes are off by default. The scopes are part of the risk: a token with write access to vals can change the code that runs on your account. A short value with the prefix, such as a truncated example in documentation, is not a working token, but any value that looks like a real token should be handled as one.

## How Val Town API Tokens get leaked

-   **Scripts that deploy or update vals.** A deployment script that holds the token so that it can publish code, pushed to a repository.
-   **Environment files.** A `.env` file used by a local development setup, committed or copied into a template.
-   **Shared code.** A val that was copied or forked with a token in its code, then published or shared with someone else.
-   **Logs and terminals.** A debug print of the request headers, or a terminal session recorded or shared while setting up a tool.
-   **Snippets and support threads.** A token pasted into a forum post or a chat when an API call returned an authorization error.

## What to do in the first hour

1.  **Delete the token.** Open the account settings for your Val Town account, find the API token in the list, and delete it. Deleting a token cuts off its access straight away, so update the tools that use it afterwards.
2.  **Create a replacement** with only the scopes the tool needs. Store it in a secret manager or the environment of the process that uses it, and never in a val’s own code.
3.  **Review your vals.** List the vals on the account and check their recent changes. Look for code you did not write, new vals, and edits to existing ones, especially any that send requests to outside servers.
4.  **Check environment variables.** Review the variables stored for each val. Rotate any secret that a val reads, because the token could have been used to read those values.
5.  **Check the scheduled and HTTP vals.** A val that runs on a schedule or responds to web requests can keep working after the token is gone, so look at what is running and disable what you do not recognize.
6.  **Check the rest of the file.** Revoke other credentials stored with the token, such as database passwords or cloud keys.
7.  **Clean the repository.** Remove the value from current files, add the file to `.gitignore`, and rewrite history if the repository was public. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github) for the full order.

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

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

## Revoke it at Val Town

Val Town’s documentation says tokens are created and managed on the API Tokens page of the account settings, and that deleting a token on that page cuts its access right away. The same page is where you choose the scopes, and where you set expiry dates. Give the replacement the narrowest scope the tool needs, set an expiry so that it is rotated automatically, and avoid giving write access to vals unless the job requires it. We could not confirm every button label from the live page, so check the names in your own account. If the leaked token had broad scope, review the vals and their variables before assuming the damage is limited.

## How LeakWatch detects it

The rule is called “Val Town API Token”. It looks for the prefix `vtwn_` followed by 20 to 80 letters, digits, underscores or hyphens, with a word boundary before the prefix and a quote, space, semicolon or line end after the value. A value shorter than 20 characters after the prefix is not reported. The severity is **high**, with the identity and code impact class, because the token can change code that runs on your account. **This type is not checked live**: LeakWatch does not send the value to Val Town, so a finding means the value has the right shape, not that it still works.

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

Can a leaked Val Town token change running code?

Yes, if the token has write scope for vals. That is why the first step is to delete the token and then compare the code of every val with what you expect.

Are the environment variables safe if the token was read-only?

Not necessarily. A read-only token can still read variables and code, and those can contain secrets. Rotate any secret that a val depends on if you cannot confirm that the token was never used.

What is a safe way to set up a token for a tool?

Create one per tool, scope it to what the tool needs, set an expiry date, and store it in your secret store. Remove the token from the tool when the tool is retired.

## Related

-   [Vercel API Token](/secrets/vercel-api-token)
-   [Netlify Access Token](/secrets/netlify-access-token)
-   [Fly.io Access Token](/secrets/flyio-access-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 Val Town.

![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)
