Secret scanning now helps you more easily define custom patterns with GitHub Copilot.
As of today, you can leverage AI to generate custom patterns without expert knowledge of regular expressions.
What’s changing?
You can create your own custom detectors for secret scanning 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?
Anyone able to define custom patterns is able to use the regular expression generator. This feature is shipping to public beta today for all GitHub Enterprise Cloud customers with GitHub Advanced Security.
Learn more about the regular expression generator or how to define your own custom patterns.