You add nosecrets to the pre-commit hook. On every git commit it reads the files staged for that commit, checks them for known secret formats and suspicious random tokens, and leaves out anything you marked as intentional.
If a secret is left, the commit stops and you see the file, the line and the kind of secret. Everything runs locally: no code is uploaded and no provider is contacted.