# 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-a-quality-gate-for-ai-code-assurance](#apply-a-quality-gate-for-ai-code-assurance "mention")
3. Publish an AI Code Assurance badge externally to your websites to [#monitor-projects-containing-ai-code](#monitor-projects-containing-ai-code "mention").

### 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* > **Administration** > **AI Code Assurance** and select **This project contains AI-generated code**. Projects marked in this way will have the ![$contains-ai-code](/files/iwZbXVzdyHjM2lcq7TaV) 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-a-quality-gate-for-ai-code-assurance" id="apply-a-quality-gate-for-ai-code-assurance"></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* > **Administration** > **AI Code Assurance**, select a qualified quality gate from the list.

See the [Quality gates for AI code](/sonarqube-cloud/standards/ai-code-assurance/quality-gates-for-ai-code.md) for detailed information about qualifying your custom quality gate for 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/iwZbXVzdyHjM2lcq7TaV) label and using a quality gate qualified for AI Code are eligible to publish the ![$in-shield-on](/files/0bWB93MbQPZ4CLq68g7k) badge on your external websites. For information about using the AI Code Assurance badges, please see [Monitor projects with AI code](/sonarqube-cloud/standards/ai-code-assurance/monitor-projects-with-ai-code.md).

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

* SonarQube Cloud's [AI capabilities](/sonarqube-cloud/ai-capabilities.md)
* Guide to setting up [AI features](/sonarqube-cloud/administering-sonarcloud/ai-features.md) at the organization level
  * Quickly [Enable AI CodeFix](/sonarqube-cloud/administering-sonarcloud/ai-features/enable-ai-codefix.md) to get AI-generated fix suggestions


---

# 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-cloud/standards/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.
