# Leaked Vault Batch Token? Contain It, Audit Access

> HashiCorp Vault batch token exposed on GitHub? Limit its policies, check the audit log and rotate what it could read. Step-by-step guide.

Source: https://leakwatch.net/secrets/vault-batch-token

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  HashiCorp Vault Batch Token

Databases & keys · Secret guide

# Leaked HashiCorp Vault Batch Token: what to do in the first hour

Critical severityDetected onlyLast verified October 30, 2026 · 4 min read

A HashiCorp Vault batch token is a credential for a Vault server. Whoever holds it acts with the policies attached to it, so it can read the secrets those policies allow: database passwords, cloud credentials, encryption keys. The danger is the secrets behind it, not the token itself. Batch tokens also behave differently from the usual service tokens: they are not stored by Vault, and they cannot be renewed or revoked one by one. The reliable limits are their expiry and the policies they carry. Contain the access first, then investigate what was read.

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

Provider

Vault

Severity

Critical

Impact

Cloud infrastructure access

Checked live by LeakWatch

No

## What a Vault Batch Token looks like

A batch token starts with `hvb.` followed by a long opaque string. HashiCorp documents the part after the prefix as 24 or more generated characters, and treats the structure as opaque, so the length varies:

```text
hvb.XXXXXXXX…   Vault batch token (masked; prefix + long URL-safe body)
```

Tokens seen in practice are often well over 100 characters. They appear in `VAULT_TOKEN` variables, in the `X-Vault-Token` request header, in CI variables and in Vault agent sink files. Tell them apart from their siblings: service tokens start with `hvs.` (see the [Vault service token guide](/secrets/vault-service-token)), and the old format without a clear prefix, starting with `b.`, belongs to Vault versions before 1.10. A recovery or root token is a separate and more serious case.

## How Vault Batch Tokens get leaked

-   **Shell history and scripts.** A token exported in a terminal or typed into a deployment script, then committed.
-   **CI and pipeline configuration.** Batch tokens are popular for short jobs, and a pipeline file or log that prints `VAULT_TOKEN` exposes one.
-   **Environment files.** A `.env` or compose file with `VAULT_TOKEN` committed by accident.
-   **Debug output.** A client or agent run with verbose logging that prints the request headers.
-   **Documentation and tickets.** A working token pasted into a runbook, an issue or a chat to show a command that works.

## What to do in the first hour

1.  **Find out what the token can do.** Identify the policies and the remaining lifetime. Batch tokens carry their TTL and expire on their own, so the exposure window may already be short. If you do not know how it was issued, find the auth method and role that created it in your Vault configuration.
2.  **Stop new tokens like it.** Because the token cannot be revoked individually, act on its source: tighten or remove the policies of the role or auth method that issues it, shorten the TTL, or disable the role until you have looked. Read the Vault documentation on revoking tokens by their parent or by their auth method before choosing.
3.  **Check the audit log.** If an audit device is enabled, search it for requests made with this token: reads of secrets, token creation, policy changes and unusual source addresses. This tells you which secrets were exposed.
4.  **Rotate what it could read.** Treat every secret the policies allowed as exposed: database credentials, cloud keys, API keys. Dynamic secrets leased through the token should be revoked by their lease.
5.  **Check for persistence.** Look for new tokens, roles, policies or auth methods created during the window.
6.  **Clean up the code** and replace the long-lived pattern with short TTLs and narrow policies. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github).

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 HashiCorp Vault

Vault is usually self-hosted, or run as a managed cluster, so there is no single vendor page to revoke a token from: you work on your own cluster, through its CLI, API or interface, with an account allowed to manage tokens and policies. The Vault documentation on tokens explains that batch tokens are not persisted and are not revoked one at a time, so the practical levers are the expiry, the issuing role and its policies. A person has not confirmed the exact commands for your setup, so check the documentation for your Vault version.

## How LeakWatch detects it

The rule is called Vault Batch Token. It looks for `hvb.` followed by 24 to 300 characters made of letters, digits, underscores and dashes, with a word boundary before the prefix, and it requires the value to end at a quote, a space, a semicolon or the end of the line. It does not need a variable name next to it. A body shorter than 24 characters, a different prefix such as `hvs.`, or the older `b.` format is not reported. The case of the prefix matters. The severity is **critical**. This type is not checked live: LeakWatch does not send any request to a Vault server with the token 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

Can I revoke a batch token with vault token revoke?

Not individually: batch tokens are not stored and have no accessor. Rely on their expiry, and act on the role and policies that issue them.

Is a short TTL enough protection?

It limits the window, but secrets read during that window stay compromised. Check the audit log and rotate what the token could read.

How is it different from a service token?

A service token is stored, can be renewed and can be revoked directly. A batch token is lighter, but gives up those controls.

## Related

-   [Vault Service Token](/secrets/vault-service-token)
-   [Database Connection String](/secrets/database-connection-string)
-   [Doppler API Token](/secrets/doppler-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 Vault.

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