Secret scanning is a security control that searches repository content for exposed credentials, API keys, access tokens, certificates, or other sensitive strings. It is used to catch secrets that were accidentally committed in source code, configuration files, build scripts, commit history, or pull requests before they can be abused.
It matters because a single leaked token can let an attacker access cloud services, CI/CD systems, internal APIs, or third-party integrations without needing to break in. Defenders use secret scanning in code-hosting platforms and CI pipelines to alert on matches, block risky merges, and trigger follow-up actions such as revoking or rotating the secret. Attackers also scan public repositories and stolen code for usable credentials, which makes fast detection essential.


