Start FreeLog in
SonarQube Cloud | Managing your projects | AI standards

Standards for AI-generated code

On this page

SonarQube Cloud helps you set appropriate standards for projects containing AI-generated code to ensure security and code quality. A combination of tools, including project labels, a default quality gate, and the availability of externally published project badges, lets you ensure that your AI projects are AI code-assured.

Marking a project as containing AI-generated code

Anyone with Project Admin permissions can mark any project with an AI Code Assurance status label to indicate that it contains AI-generated code. To do this, go to Your project > Administration > AI-generated code and select Contains AI-Generated Code.

When you select Lock Quality Gate and Save to save your setting:

  • The Sonar way quality gate is enforced on the project.
    • If the project already uses the Sonar way Quality Qate, activating the setting will lock the project’s quality gate.
    • If the project does not use the Sonar way quality gate, activating this setting will change the project’s quality gate to Sonar way and lock it.

      Locking the Sonar way quality gate ensures that the AI-generated code is clean by enforcing high-quality standards.
  • The project will have the AI Code Assurance badge:
    • An AI Code Assurance badge is displayed next to the project in the SonarQube Cloud UI.

Next, see the Using a project badge article to learn about publishing SonarQube Cloud badges to promote your project’s health on your web pages. You do not need to enable the AI CodeFix feature to use the AI Code Assurance badge. 

If you want to use the AI CodeFix feature to have SonarQube Cloud generate a fix suggestion using AI, check with an Organization Admin about enabling AI-generated fix suggestions on your Organization.

AI features

Managing AI features in your organization


Was this page helpful?

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License