---
id: "github_token"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["secrets"]
langs: ["common"]
quality: 75
url: "http://registry.apicrafter.io/datatype/github_token"
---

# GitHub token (`github_token`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Token issued by GitHub, such as a personal access token. It starts with a prefix that names the token type (ghp_, gho_, ghu_, ghs_ or ghr_) followed by 36 letters and digits.

- Personal data (PII): no
- Categories: Secrets and credentials (passwords, keys, tokens) (secrets)
- Countries: global
- Languages: Common to most languages (common)

## Detection

Regular expression (Python `re`):

```
^gh[pousr]_[A-Za-z0-9]{36}$
```

## Mappings

- purview: `GitHub personal access token`, `All Credential Types`, `All credentials`

## Supported by tools

- `detectsecrets`
- `gitleaks`
- `microsoftpurview`
- `nightfall`
- `semgrep`
- `trufflehog`

## Sources

- doc: <https://learn.microsoft.com/en-us/purview/sit-defn-github-personal-access-token>
- doc: <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github>

## Quality

Score 75/100. Missing: examples, negative example, translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/github_token.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/secrets/github_token.yaml>
