# Leaked Harness API Key? Delete the Token

> Harness API key exposed on GitHub? Delete the token, then review pipelines, secrets and audit trail activity. Step-by-step guide.

Source: https://leakwatch.net/secrets/harness-api-key

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  Harness API Key

Code & CI · Secret guide

# Leaked Harness API Key: what to do in the first hour

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

A Harness API key is a token for the Harness platform API. It acts as a person (a personal token) or as a service account (a service account token) and can do whatever that identity is allowed to do: read and run pipelines, manage connectors and secrets, change delivery settings, and in some setups reach the cloud accounts those connectors point to. Harness sits in the middle of deployment, so a leaked token is a path toward production. Delete the token first, then review what the identity did.

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

Provider

Harness

Severity

High

Impact

Source code and build access

Checked live by LeakWatch

No

## What a Harness API Key looks like

A Harness token is a single string of four parts separated by dots. It starts with `pat.` for a personal token or `sat.` for a service account token, then three parts of random characters:

```text
pat.XXXXXXXX….XXXXXXXX….XXXXXXXX…   personal token (masked)
sat.XXXXXXXX….XXXXXXXX….XXXXXXXX…   service account token (masked)
```

The parts are an account identifier of 22 characters, a token identifier of 24 characters and a secret of 20 characters. The token is sent in the `x-api-key` header of Harness API requests, or stored in a variable such as `HARNESS_API_KEY` or a Terraform provider setting. Tell the two apart by the prefix: `sat.` belongs to a service account, often meant for automation, and may have broader rights than a developer’s `pat.` token. The first part contains the account identifier, which is not secret on its own, but the whole string is.

## How Harness API Keys get leaked

-   **Terraform and infrastructure code.** Provider configuration for the Harness platform with the key written inline.
-   **CI pipelines.** A step that calls the Harness API, with the token in a workflow file instead of a secret.
-   **Scripts and notebooks.** Automation scripts that create or trigger pipelines, committed with the key.
-   **Environment files.** `HARNESS_API_KEY` in a `.env` file or a Docker compose file.
-   **Support and documentation.** A curl example with a real `x-api-key` header pasted in a ticket or a wiki.

## What to do in the first hour

1.  **Delete the token.** In Harness, delete the token from the API key it belongs to. For a personal token, use your user profile; for a service account token, use the service account in account settings. See below.
2.  **Create a new token** for the automation that needs it, on an identity with limited permissions, and prefer an expiry date.
3.  **Update your pipelines** and secret stores with the new value and test them.
4.  **Check the audit trail.** Harness records user and API actions in an audit trail at the account level. Filter it by the identity that owned the token and read the period of exposure.
5.  **Look at what could have been created or changed.** New pipelines, triggers, connectors, delegates, secrets, users, service accounts, API keys and role assignments.
6.  **Rotate downstream secrets.** If the token could manage connectors or secrets, replace the cloud and registry credentials they use.
7.  **Clean up the code** and the 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 Harness

According to the Harness documentation, a personal token is deleted from your user profile: expand the token under My API Keys, choose More Options, then Delete. A service account token is deleted from Account Settings, then Access Control, then Service Accounts: select the service account, select the API key, choose More Options next to the token and select Delete. Open the Harness platform and sign in with an account allowed to manage the key. A person has not confirmed the exact menu wording for this guide, and the interface can change, so look for the section where tokens are listed and follow the Harness documentation on managing API keys. The platform also has an API call to delete a token.

## How LeakWatch detects it

The rule is called Harness API Key. It accepts `pat.` or `sat.`, then 22 characters made of letters, digits, `_` or `-`, a dot, 24 letters or digits, a dot, and 20 letters or digits. The shape is distinctive enough that no vendor word is required nearby. Values with different part lengths, other prefixes or missing dots are not reported. The severity is **high**. This type is not checked live: LeakWatch does not send any request to Harness 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

What is the difference between pat. and sat. tokens?

A `pat.` token belongs to a person and acts as that person. A `sat.` token belongs to a service account, which is usually shared automation, so check what permissions that account holds.

Is the account identifier in the token a secret?

On its own it is not, since it identifies the account. The full token is the secret, so replace the whole value.

Will deleting the token break my pipelines?

Any job that calls the Harness API with it will fail until you provide a new token. Prepare the replacement first, unless you see abuse.

## Related

-   [CircleCI Personal Access Token](/secrets/circleci-personal-access-token)
-   [Pulumi API Token](/secrets/pulumi-access-token)
-   [Terraform Cloud API Token](/secrets/terraform-cloud-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 Harness.

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