Note
Push protection for AI-detected secrets is in public preview and subject to change.
When you enable push protection for AI-detected secrets, GitHub uses AI to find and block generic secrets, such as passwords, that do not match any pattern.
Push protection for AI-detected secrets consumes AI credits in addition to your GitHub Secret Protection or GitHub Advanced Security license. See Push protection and GitHub Advanced Security license billing.
Usage is billed to the organization that owns the repository. For organization-owned repositories in an enterprise, usage counts toward the enterprise's pool of AI credits. Only repositories in the personal namespace of a managed user account consume the repository owner's individual pool, regardless of who pushes. Otherwise, users' individual pools are not charged.
Prerequisites
- Your repository must have GitHub Secret Protection or GitHub Advanced Security enabled.
- Push protection must be enabled. See Enabling push protection for your repository.
- Scanning for AI-detected secrets must be enabled. See Enabling scanning for AI-detected secrets.
Enabling push protection for AI-detected secrets for your repository
-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

-
In the "Security and quality" section of the sidebar, click Advanced Security.
-
Under "Secret Protection", to the right of "Push protection for AI-detected secrets", toggle the setting to On.
Enabling push protection for AI-detected secrets for your organization
You can enable push protection for AI-detected secrets for repositories in your organization with a custom security configuration. Security configurations are collections of security settings that you can customize and apply at scale. See Creating a custom security configuration.