Every developer has to manage credentials. Secret scanning watches public and private repositories for known secret formats and immediately notifies either the secret provider or private repository admins when secrets are found.
If your project communicates with an external service, you might use a token or private key for authentication. Tokens and private keys are examples of secrets that a service provider can issue.
If you check a secret into a repository, anyone who has read access to the repository can use the secret to access the external service with your privileges. We recommend that you store secrets in a dedicated, secure location outside of the repository for your project.
Secret scanning happens by default on public repositories, and can be enabled on private repositories by repository administrators or organization owners.