Automatic detection of AI code in your project
Responsible use of AI can increase development velocity. However, when AI-generated code is used, it is important to apply a high code quality and security standard to such projects to reduce risk and upkeep long term maintainability of the code base. SonarQube can automatically detect presence of AI-generated code in your project when GitHub and GitHub Copilot are used.
Please note that, for this feature to work, SonarQube needs additional permissions through the GitHub app.
If you are using SonarQube Server (available from SonarQube Server 2025.1 LTA, Developer Edition+), follow these steps to complete setting up Autodetecting AI code.
If you are using SonarQube Cloud (available in Team plan+), follow these steps to complete setting up Autodetecting AI code.
AI Code Assurance
When AI-generated code is detected (or if you are aware of presence of AI-generated code) in your project, we recommend protecting such projects with Sonar’s AI Code Assurance workflow. This will allow your team to confidently embrace AI-coding assistants to boost development productivity. Read more here.