# Set your AI standards

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 <a href="#assuring-your-ai-code" id="assuring-your-ai-code"></a>

Sonar 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-projects-with-ai-code](#label-projects-with-ai-code "mention")
2. [#apply-qualified-quality-gate](#apply-qualified-quality-gate "mention")
3. Publish an AI Code Assurance badge externally to your websites to [monitor-projects-with-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.4/quality-standards-administration/ai-code-assurance/monitor-projects-with-ai-code "mention").

### Labeling projects with AI code <a href="#label-projects-with-ai-code" id="label-projects-with-ai-code"></a>

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

Go to **Project settings** > **AI-generated code** and activate the **Contains AI-generated code** setting. Projects marked in this way will have the ![$contains-ai-code](https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-ca3b9de37a93a3d09c496b45878e418adab02c9f%2Fc151514ef7beca0f865ee429bc9fe0e33b05ceb4.svg?alt=media) 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 <a href="#apply-qualified-quality-gate" id="apply-qualified-quality-gate"></a>

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* > **Project Settings** > **Quality Gate**, select a qualified quality gate from the list.

See the [quality-gates-for-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.4/quality-standards-administration/ai-code-assurance/quality-gates-for-ai-code "mention") page for more information about qualifying your custom quality gate for AI Code Assurance. In addition, the [set-up-ai-code-assurance](https://docs.sonarsource.com/sonarqube-server/2025.4/project-administration/ai-features/set-up-ai-code-assurance "mention") page has information about using the API to setup AI Code Assurance.

## Monitor projects containing AI code <a href="#monitor-projects-containing-ai-code" id="monitor-projects-containing-ai-code"></a>

Projects marked with the ![$contains-ai-code](https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-ca3b9de37a93a3d09c496b45878e418adab02c9f%2Fc151514ef7beca0f865ee429bc9fe0e33b05ceb4.svg?alt=media) label and using a quality gate qualified for AI Code are eligible to publish the ![$in-shield-on](https://512221655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyDv2XwTC1xoOKBYeCK45%2Fuploads%2Fgit-blob-d7f52ebf82d639fd6bae4f80add21c21628c518e%2F185be81999243203ea71699933ca21b534b1d0c8.svg?alt=media) badge on your external websites. For information about using the AI Code Assurance badges, please see the [monitor-projects-with-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.4/quality-standards-administration/ai-code-assurance/monitor-projects-with-ai-code "mention") page.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [overview](https://docs.sonarsource.com/sonarqube-server/2025.4/ai-capabilities/overview "mention") of AI capabilites
* [overview](https://docs.sonarsource.com/sonarqube-server/2025.4/instance-administration/ai-features/overview "mention") of AI features for instance administration
* The [set-up-ai-code-assurance](https://docs.sonarsource.com/sonarqube-server/2025.4/project-administration/ai-features/set-up-ai-code-assurance "mention") page has information about using the API for AI Code Assurance
* Learn about how[autodetect-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.4/instance-administration/ai-features/autodetect-ai-code "mention") works
* See the [#getting-ai-generated-fix-suggestions](https://docs.sonarsource.com/sonarqube-server/2025.4/user-guide/issues/fixing#getting-ai-generated-fix-suggestions "mention") to use AI CodeFix
* See the [managing-custom-quality-gates](https://docs.sonarsource.com/sonarqube-server/2025.4/quality-standards-administration/managing-quality-gates/managing-custom-quality-gates "mention") page for standard instructions to create a new quality gate
