# 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 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](/sonarqube-server/2026.2/quality-standards-administration/ai-code-assurance/monitor-projects-with-ai-code.md).

### Label 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 *Your project* > **Project settings** > **AI-generated code** and activate the **Contains AI-generated code** setting. Projects marked in this way will have the ![$contains-ai-code](/files/CbhFHzz92q9TXOM4NzNi) 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](/sonarqube-server/2026.2/quality-standards-administration/ai-code-assurance/quality-gates-for-ai-code.md) page for more information about qualifying your custom quality gate for AI Code Assurance. In addition, the [Set up AI Code Assurance](/sonarqube-server/2026.2/project-administration/ai-features/set-up-ai-code-assurance.md) 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](/files/CbhFHzz92q9TXOM4NzNi) label and using a quality gate qualified for AI Code are eligible to publish the ![$in-shield-on](/files/ZvVp0lpwaG1eGfGW8PbE) badge on your external websites. For information about using the AI Code Assurance badges, please see the [Monitor projects with AI code](/sonarqube-server/2026.2/quality-standards-administration/ai-code-assurance/monitor-projects-with-ai-code.md) page.

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

* [Agent Centric Development Cycle](https://docs.sonarsource.com/agent-centric-development-cycle/) of AI capabilites
* [Overview](/sonarqube-server/2026.2/instance-administration/ai-features/overview.md) of AI features for instance administration
* The [Set up AI Code Assurance](/sonarqube-server/2026.2/project-administration/ai-features/set-up-ai-code-assurance.md) page has information about using the API for AI Code Assurance
* See the [Fixing issues](/sonarqube-server/2026.2/user-guide/issues/fixing.md#getting-ai-generated-fix-suggestions) to use AI CodeFix
* See the [Managing custom quality gates](/sonarqube-server/2026.2/quality-standards-administration/managing-quality-gates/managing-custom-quality-gates.md) page for standard instructions to create a new quality gate


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/2026.2/quality-standards-administration/ai-code-assurance/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
