Secret scanning is the automated searching of code and commits for credentials such as API keys and tokens. Tools look for patterns that match known credential formats, and some also check whether a found value is still active.

It matters because credentials committed to a repository are easy to miss and easy to abuse. Once a key has been pushed, anyone with access to the repository, and in the case of public repositories anyone at all, may be able to read it, and the history keeps it even after the file is changed.

Scanning is not complete. It can miss secrets that do not match a known pattern, and it can raise false alarms on harmless strings. It finds a leak after the fact, so a flagged key should be treated as exposed: deleting it from the code does not make it safe. Features and coverage differ between tools and platforms.

To use it well, enable it on all repositories, include history in scans, revoke and replace any credential it finds before cleaning up the code and combine it with measures that stop secrets being committed in the first place.