Skip to content

inline-secret

Command
gglint secrets
Severity
problem; warning if gitignored
--fix
env var, where the agent reads one

A token with a recognisable format is written into an agent file. That covers GitHub, GitLab, Anthropic, Slack, Stripe, Google and npm tokens, AWS access keys, sk- API keys and private keys. Once it’s committed, anyone with access to the repository, or any clone of it, can read it.

.cursor/mcp.json
"headers": { "Authorization": "Bearer ghp_…" }
./.cursor/mcp.json:5:45 inline-secret GitHub token in "Authorization" is written out in the file

uvx gglint secrets --fix replaces the token with an environment variable:

"headers": { "Authorization": "Bearer ghp_…" }
"headers": { "Authorization": "Bearer ${env:GITHUB_TOKEN}" }

Then set GITHUB_TOKEN in your environment and rotate the token, because the old one is still in git history. Placeholders like ghp_xxxx… and references like ${GITHUB_TOKEN} aren’t reported, and a token in a file git ignores is only a warning.