Secret scanning now helps you more easily define custom patterns with GitHub Copilot.
Generally available as of today, you can now leverage AI to generate custom patterns without expert knowledge of regular expressions.
What’s changing?
Defining custom patterns is now simpler and more efficient. You can leverage AI to generate patterns via text input — without expert knowledge in regular expressions.
With secret scanning, you can create your own custom detectors by using custom patterns. Formatted as regular expressions, these custom patterns can be challenging to write. Secret scanning now supports a pattern generator backed by GitHub Copilot in order to generate regular expressions that match your input.
How do I use the regular expression generator?
When defining a custom pattern, you can select “generate with AI” in order to launch the regular expression generator.
The model returns up to three regular expressions for you to review. You can click on the regular expression to get an AI-generated plain language description of the regular expression. You should still review this input and carefully validate performance of results by performing a dry run across your organization or repository.
Who can use the regular expression generator?
All GitHub Advanced Security customers on GitHub Enterprise Cloud can use the regular expression generator today. Anyone able to define custom patterns is able to use the regular expression generator (e.g. any admin at the repository, organization, or enterprise levels). You do not need a GitHub Copilot license to use the regular expression generator.
Learn more about the regular expression generator or how to define your own custom patterns.