# Leaked Buildkite API Token? Revoke It Now

> Buildkite API token exposed on GitHub? Revoke it, review pipelines, agents and audit events for abuse and rotate secrets. Step-by-step guide.

Source: https://leakwatch.net/secrets/buildkite-api-token

---

[LeakWatch](/)

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

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

Code & CI · Secret guide

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

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

A Buildkite API token lets a script call the Buildkite REST or GraphQL API as the user who created it, within the scopes chosen at creation. Depending on those scopes, it can list organizations and pipelines, read builds and their logs, create builds, change pipeline settings and manage agent tokens. The danger is control of your CI: a modified pipeline runs on your own agents, which usually hold deployment credentials. Revoke the token first, then investigate what it did.

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

Provider

Buildkite

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

No

## What a Buildkite API Token looks like

Buildkite API access tokens are 40-character strings of lowercase letters and digits, with no prefix. They are shown once, when you create them:

```text
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx   (40 lowercase letters or digits, no prefix)
```

Typical contexts are `BUILDKITE_API_TOKEN` or `BUILDKITE_TOKEN` in a `.env` file, an `Authorization: Bearer` header in a `curl` command, a Terraform provider configuration, or a CLI configuration. Do not confuse it with the **agent token**, a separate secret that lets a build agent register with your organization and fetch jobs. An agent token is not an API token, but a leak of one is also serious: handle both if both are in the file.

## How Buildkite API Tokens get leaked

-   **Automation scripts.** A script that triggers builds or reads logs, committed with the token as a constant or default value.
-   **Infrastructure as code.** A Terraform or provider configuration with the token in a variable file.
-   **Environment files.** `.env`, Docker compose or Helm values files with `BUILDKITE_API_TOKEN` pushed by accident.
-   **Pipeline definitions.** A `pipeline.yml` or a step that echoes the token, or passes it in a command line printed in public build logs.
-   **Chat and tickets.** A `curl` example pasted into an issue, a forum post or documentation with the real token.

## What to do in the first hour

1.  **Revoke the token.** In Buildkite, open your personal settings and the list of API access tokens, find the exposed token (see the link below) and revoke it. If you do not know which one leaked, revoke all of those used by automation and recreate them.
2.  **Create a new token** with the smallest set of scopes the job needs, and a restriction to the organization where it applies, then deploy it to your secret store.
3.  **Review pipelines.** Compare pipeline settings and steps with what you expect. Look for commands added to steps, new pipelines, changed branch filters and changed webhooks.
4.  **Read the audit log.** If your plan includes audit events for the organization, review them for the period since the exposure: token creation, member changes, pipeline changes, agent token creation.
5.  **Check builds.** Look for builds you did not start, especially on pipelines that deploy, and read their logs for secrets printed.
6.  **Rotate downstream secrets.** If the token could read logs or build environments, rotate the secrets that appear there. Also replace agent tokens if you think they were exposed.
7.  **Clean up the code** and history. 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 Buildkite

API access tokens are listed and revoked from the API access tokens page of your Buildkite personal settings, after you sign in. Open the token and revoke it; revocation is meant to stop it from authenticating. A person has not confirmed the exact menu wording for this guide, and the interface can change, so if the page differs from this description, look for the section where API access tokens are listed, and follow Buildkite’s documentation. Agent tokens are managed separately, from the agents area of the organization.

## How LeakWatch detects it

The rule is called Buildkite API Token. It looks for the word `buildkite` in any letter case, then within about 40 characters a standalone run of exactly 40 letters or digits, case-insensitive, bounded by word boundaries. Without the word `buildkite` close by, a 40-character string is not reported, and a longer or shorter run is refused. The prefilter keyword is `buildkite`. The severity is **high**. This type is not checked live: LeakWatch does not send any request to Buildkite with the token it found. Because the rule is contextual, a token placed far from the word, or in a file that never says `buildkite`, can be missed.

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 someone run code on my agents with this token?

Possibly. If its scopes allow creating builds or editing pipelines, an attacker can start jobs that run on your agents. That is why you review pipelines and builds, not only revoke the token.

Is an agent token the same thing?

No. An agent token lets a build agent connect to your organization. An API token calls the API. They are managed in different places, so check for both.

Do I need to rewrite git history?

Removing the token from history helps, but it does not make the value safe. Revoking it is the step that matters.

## Related

-   [CircleCI Personal Access Token](/secrets/circleci-personal-access-token)
-   [GitLab Personal Access Token](/secrets/gitlab-personal-access-token)
-   [GitHub Personal Access Token](/secrets/github-personal-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 Buildkite.

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