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:
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_KEYin a.envfile or a Docker compose file. - Support and documentation. A curl example with a real
x-api-keyheader pasted in a ticket or a wiki.
What to do in the first hour
- 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.
- Create a new token for the automation that needs it, on an identity with limited permissions, and prefer an expiry date.
- Update your pipelines and secret stores with the new value and test them.
- 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.
- Look at what could have been created or changed. New pipelines, triggers, connectors, delegates, secrets, users, service accounts, API keys and role assignments.
- Rotate downstream secrets. If the token could manage connectors or secrets, replace the cloud and registry credentials they use.
- Clean up the code and the history. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? 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.