Skip to content

AAK-SECRET-008: GitHub/GitLab personal access token exposed

Severity
CRITICAL
Category
Secret Exposure (secret-exposure)
Scanner
agent_audit_kit/scanners/secret_exposure.py
Auto-fixable
No.
SARIF name
GitTokenExposed

What it detects

A GitHub or GitLab personal access token (ghp_*, github_pat_*, glpat-*) was found in a project file.

How to fix

Remove token, rotate immediately, use environment variables.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-SECRET-008

Limitations

Reads GitHub personal access tokens (ghp_ classic, github_pat_ fine-grained) and GitLab glpat- tokens. GitHub's other token types are not reported: OAuth (gho_), GitHub App user (ghu_) and installation (ghs_), and refresh (ghr_) tokens. In Markdown, a key shaped like a documentation stand-in (one repeated character after the prefix, a run of x, or REPLACE, YOUR, EXAMPLE, PLACEHOLDER or CHANGEME in it) is skipped. A file over 1,000,000 bytes is not read.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-SECRET-008.md: the page then shows that text, with the registry reference appended under it.