# Permissions for AI autodetect

To activate AI Code Autodetection, a SonarQube Server Instance Admin must first check that the feature is enabled.

Then, a DevOps platform administrator must set the correct permission level in your AI-powered web service. For specific instructions in your DevOps platform, please refer to the applicable section below.

## GitHub Copilot Business <a href="#github-copilot-business" id="github-copilot-business"></a>

When a SonarQube Server administrator activates AI Code Autodetection for a instance of SonarQube Server, GitHub Copilot Business app administrators must enable the GitHub integration. Check [#enable-in-github](https://docs.sonarsource.com/sonarqube-server/2025.5/instance-administration/autodetect-ai-code#enable-in-github "mention"), for the complete details. Once enabling the integration in GitHub, the GitHub Copilot Business app administrator will receive an will receive an email notification to confirm the SonarQube App’s permission request.

With access to your GitHub Copilot Business App, SonarQube Server can evaluate users’ GitHub Copilot usage and code contribution patterns to identify potential AI-generated code. If there is a match in user data, SonarQube Server will display the ![$ai-icon-sparkle](https://4159601124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8MaL7qHHph0mwB0jcBjB%2Fuploads%2Fgit-blob-975a17de7ce8ae3b164dd9f9db9c791adb294bbb%2F4be9087a2b059c269f15df202838af7a74e71a96.svg?alt=media)**AI code detected** status on the project’s Overview and Project Information pages. The GitHub organization connected to Copilot should match the organization bound to SonarQube Server.

SonarQube Server does not retroactively check older code from previous commits. In addition, projects that have the ![$contains-ai-code](https://4159601124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8MaL7qHHph0mwB0jcBjB%2Fuploads%2Fgit-blob-ca3b9de37a93a3d09c496b45878e418adab02c9f%2Fc151514ef7beca0f865ee429bc9fe0e33b05ceb4.svg?alt=media) applied by a quality standards admin will be excluded from automatic AI code detection. See the [#label-projects-with-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.5/quality-standards-administration/ai-code-assurance/overview#label-projects-with-ai-code "mention") page for details.

{% hint style="warning" %}
If the GitHub Copilot Business and Enterprise account administrator chooses to ignore the request, Sonar’s AI Code Autodetection will be turned on, but not be activated.
{% endhint %}

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

* [overview](https://docs.sonarsource.com/sonarqube-server/2025.5/ai-capabilities/overview "mention") of AI capabilities
* Learn how to[overview](https://docs.sonarsource.com/sonarqube-server/2025.5/quality-standards-administration/ai-code-assurance/overview "mention")
* Learn about [ai-codefix](https://docs.sonarsource.com/sonarqube-server/2025.5/ai-capabilities/ai-codefix "mention") to get AI-generated fix suggestions
* [autodetect-ai-code](https://docs.sonarsource.com/sonarqube-server/2025.5/instance-administration/ai-features/autodetect-ai-code "mention")


---

# 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/2025.5/instance-administration/ai-features/permissions-for-ai-autodetect.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.
