For the complete documentation index, see llms.txt. This page is also available as Markdown.

Set your AI standards

This section explains how to manage AI standards, including the use of tools for Sonar’s AI Code Assurance in your SonarQube Cloud project.

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

Quality gate and quality profiles for agent centric development

Traditional quality profiles and quality gates like Sonar way were tuned for human developers. Holding agentic AI code to the same standards can introduce potential risks, because AI often does better where humans fail but fails in areas that humans tend to do well. The Sonar way for agentic AI quality gate and Sonar agentic AI quality profiles are recommended for agent centric development. See Quality gate for agentic AI and Quality profiles for agentic AI for more information.

Assuring your AI code

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. Publish an AI Code Assurance badge externally to your websites to Monitor projects containing AI code.

Label 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 Summary page of your project.

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. See Quality gate for agentic AI for more information.

We recommend you use the Sonar way for agentic AI quality gate in conjunction with the Sonar agentic AI quality profile if you want to optimize the standards for agent centric development. See Quality profiles for agentic AI for language support.

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, see Monitor projects with AI code.

Last updated

Was this helpful?