# Source: https://docs.sonarsource.com/sonarqube-server/2025.2/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.3/instance-administration/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.3/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.5/instance-administration/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.5/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.1/instance-administration/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.1/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.4/instance-administration/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.4/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.6/instance-administration/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/2025.6/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/instance-administration/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-server/ai-capabilities/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/ai-features/autodetect-ai-code.md

# Source: https://docs.sonarsource.com/sonarqube-cloud/ai-capabilities/autodetect-ai-code.md

# Autodetect AI code

Knowing if your project contains AI-generated code helps raise awareness of code ownership and code security. To help build this awareness, SonarQube Cloud can autodetect AI-generated code in projects using GitHub Copilot.

* If turned on, the feature alerts Project Admins when project contributors recently used GitHub Copilot.
* If Copilot usage is detected, Project Admins can implement the tags and quality gates associated with your team’s *AI Code Assurance profile* to better call out projects that contain AI code.

**Autodetect AI-Generated Code** is turned on by default in SonarQube Cloud, but your GitHub App must have the appropriate permissions in order to allow communication with SonarQube Cloud.

For full details about the feature including instructions and requirements, see [autodetect-ai-code](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/ai-features/autodetect-ai-code "mention") page.

If you’re a GitHub Admin and want more information about the required permission levels in GitHub, see [permissions-for-ai-autodetect](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/ai-features/permissions-for-ai-autodetect "mention").

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

* [ai-code-assurance](https://docs.sonarsource.com/sonarqube-cloud/ai-capabilities/ai-code-assurance "mention")
* Administering your [ai-features](https://docs.sonarsource.com/sonarqube-cloud/administering-sonarcloud/ai-features "mention") as an Organization Admin