# Leaked GitLab Kubernetes Agent Token? Revoke

> GitLab Kubernetes agent token exposed on GitHub? Revoke it, rotate it and audit the cluster connection. Step-by-step guide.

Source: https://leakwatch.net/secrets/gitlab-kubernetes-agent-token

---

[LeakWatch](/)

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

1.  [Home](/)
2.  [Secrets](/secrets)
3.  GitLab Kubernetes Agent Token

Code & CI · Secret guide

# Leaked GitLab Kubernetes Agent Token: what to do in the first hour

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

A GitLab Kubernetes agent token is the credential that the GitLab agent for Kubernetes uses to connect from a cluster to GitLab. Whoever holds it can present itself to GitLab as that agent: it can receive the agent’s configuration from the repository, and it can take part in the agent workflows that GitLab offers, such as the CI/CD tunnel that lets pipelines reach the cluster. The token does not itself contain cluster credentials, but the agent’s configuration decides which projects and groups can send commands through it, and those commands run with the agent’s permissions in the cluster. Revoke it first, then review what the agent could do.

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

Provider

GitLab

Severity

High

Impact

Cloud infrastructure access

Checked live by LeakWatch

No

## What a GitLab Kubernetes Agent Token looks like

The token has a fixed prefix followed by a long block of letters, digits, dashes and underscores:

```text
glagent-XXXXXXXX…   GitLab agent for Kubernetes token (masked, 8-character prefix + 50 characters)
```

The body is 50 characters long in the form this rule recognizes. GitLab shows the token once, when an agent is registered or when a new token is created for it, and does not display it again. It usually appears in a Helm command (`helm upgrade --install … --set config.token=…`), a Kubernetes `Secret` manifest, a Terraform or Pulumi file that installs the agent, or a variable such as `GITLAB_AGENT_TOKEN`. Do not confuse it with a runner token (`glrt-`) or a personal access token (`glpat-`): those authenticate other things.

## How GitLab Kubernetes Agent Tokens get leaked

-   **Install commands.** The Helm command GitLab prints at registration is pasted into a README, a ticket or a runbook, with the token included.
-   **Infrastructure as code.** The token is set in a Terraform variable file, a Helm values file or a manifest and committed.
-   **Kubernetes manifests.** The agent’s `Secret` object is exported with `kubectl get secret -o yaml` and stored in a repository.
-   **CI/CD files.** A pipeline that bootstraps clusters carries the token in its definition instead of a masked variable.
-   **Cluster dumps.** A debugging archive or a support bundle contains the secret that holds the token.

## What to do in the first hour

1.  **Revoke the token.** Open the agent in GitLab, find its list of tokens and revoke the exposed one. See the revocation section below.
2.  **Create a new token** for the agent, install it in the cluster by updating the `Secret` or the Helm release, and confirm the agent shows as connected again.
3.  **Review the agent configuration.** Check the agent’s configuration file in the repository, in particular which projects and groups are authorized to use it through the CI/CD tunnel, and remove access that is not needed.
4.  **Audit the cluster.** Use the cluster’s audit logs, if enabled, to look for actions performed by the agent’s service account at unexpected times. Check for new pods, role bindings, secrets and service accounts.
5.  **Check the pipelines.** In the projects that use the agent, look at recent pipelines and at who changed the agent configuration, for example through the repository history and the group’s audit events.
6.  **Rotate secrets** that the agent’s service account could read in the cluster, if you see signs of misuse.
7.  **Clean up the code** and search the history for other secrets. 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 GitLab

Agent tokens are managed on the agent itself, in the project that hosts its configuration. Sign in to your GitLab project, open the section that lists Kubernetes clusters and agents, select the agent, and look for the tab or list showing its tokens, where each one can be revoked. An agent can hold only a small number of active tokens at the same time, so you may need to revoke one before you create another. Revocation takes effect for new connections, and the agent in the cluster will stop connecting until it receives a new token. A person has not confirmed the exact menu wording for this guide, and GitLab changes these pages, so follow the [GitLab documentation on the agent for Kubernetes](https://docs.gitlab.com/user/clusters/agent/) if the interface differs.

## How LeakWatch detects it

The rule is called GitLab Kubernetes Agent Token. It looks for the literal prefix `glagent-` followed by exactly 50 characters from letters, digits, dashes and underscores. A shorter body, or a different prefix, is refused. The pattern has no boundary at the end, so a value with a longer body can still match on its first 50 characters. The severity is **high**, and the impact is classed as cloud infrastructure rather than code, because the token is the link between a cluster and GitLab. This type is not checked live: LeakWatch does not send any request to GitLab 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

Does this token give direct access to my cluster?

No, it authenticates the agent to GitLab. But anyone who can use the agent through GitLab acts with the agent’s cluster permissions, so the real risk depends on that configuration and on your role bindings.

Do I need to reinstall the agent after revoking?

You need to give the running agent a new token. Update the secret or the Helm release that holds the token, and the existing installation reconnects without a full reinstall.

Can I see where the token was used?

GitLab shows when a token was last used on the agent page. Cluster audit logs show what the agent’s service account did. Use both to date any misuse.

## Related

-   [GitLab Runner Registration Token](/secrets/gitlab-runner-registration-token)
-   [Kubernetes Secret YAML](/secrets/kubernetes-secret-yaml)
-   [GitLab Personal Access Token](/secrets/gitlab-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 GitLab.

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