ghp_… (also github_pat_…)

Exposed GitHub Personal Access Token? Here's how to detect and rotate it

A leaked GitHub PAT (ghp_… / github_pat_…) can push malicious code and read private repos. Scan free with Trust, then delete it in Developer settings.

A GitHub Personal Access Token (classic ghp_ or fine-grained github_pat_) authenticates to GitHub as YOU. Depending on its scopes it can read and write your private repositories, push code, and act on your account via the API. A leaked token is a direct path into your source and CI.

What an attacker can do with a leaked GitHub Personal Access Token

How GitHub Personal Access Tokens get exposed

Scan your repo and live site for exposed GitHub Personal Access Tokens — free

Trust checks your code, git history, and shipped JavaScript. No signup, results in about a minute.

Run a free scan →

How to rotate a leaked GitHub Personal Access Token

  1. On GitHub: profile picture → Settings → Developer settings.
  2. Open Tokens (classic) for ghp_ tokens, or Fine-grained tokens for github_pat_ tokens.
  3. Delete the leaked token (immediate, irreversible) — for classic tokens you can instead Regenerate it.
  4. Create a new token with the minimum scopes/repos it actually needs and copy it once.
  5. Update your git remotes, CI secrets, and any tooling with the new token.
  6. Review your account's Security log and repo activity for anything the attacker did.

Open the GitHub Personal Access Token dashboard →