Start FreeLog in
SonarQube Cloud | Setting your quality standards | Standards for AI Code Assurance | Set your AI standards

Setting quality standards for AI Code Assurance

On this page

Sonar's AI Code Assurance helps you ensure security and code quality within projects containing AI-generated code. By utilizing project labels, custom quality gate certification and marking, and dynamic project badge publishing, you can maintain high standards and confidently assure the quality of your AI projects.

Assuring your AI code

SonarQube Cloud recognizes that AI-generated code should be monitored with additional quality standards. Recommended checks include high standards to reduce code complexity, remove bugs, and eliminate injection vulnerabilities. SonarQube’s AI Code Assurance features bring confidence that your AI-generated code is being reviewed to avoid any accountability crisis.

These objectives are achieved with three features that allow Quality Standard administrators to qualify projects as AI Code Assured:

  1. Label your project as containing AI code
  2. Apply a quality gate for AI Code Assurance
  3. Publish an AI Code Assurance badge externally to your websites to Monitor projects containing AI code.

Labeling projects with AI code

The first step to achieving AI Code Assurance is to mark your project as containing AI code.

Go to Your Project > Administration > AI Code Assurance and select This project contains AI-generated code. Projects marked in this way will have the $contains-ai-code label shown on the Projects page, on the Main branch Overview page, and on the Project Information pages.

Apply a quality gate for AI Code Assurance

Step 2 in achieving AI Code Assurance requires that an AI-qualified quality gate be applied to your project. While you are in Your Project > Administration > AI Code Assurance, select a qualified quality gate from the list. For new projects, the Sonar way for AI code quality gate is the default selection. 

See Quality gates for AI code for more information about qualifying your custom quality gate for AI Code Assurance.

Monitor projects containing AI code

Projects marked with the $contains-ai-code label and using a quality gate qualified for AI Code are eligible to publish the $in-shield-on badge on your external websites. For information about using the AI Code Assurance badges, please see Monitoring your projects containing AI code.


Was this page helpful?

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

Creative Commons License