# Introduction

A quality gate consists of a set of conditions against which the code is measured during analysis. A condition is defined on either new code or overall code. Depending on the result, the code will pass or fail the quality gate, giving developers indications on whether to fix issues or merge the code.

Each project has a single quality gate definition activated at any given time. This definition is used for all the quality gates that appear in the project, whether on the main branch, other branches, or pull requests.

Two built-in quality gates are provided: The **Sonar way** quality gate is initially set as your default quality gate, and the **Sonar way for AI Code** quality gate is recommended for projects containing AI code.

With the Administer Quality Gates permission in your organization, you can create your own quality gates, called custom quality gates.

When first imported, a project is assigned the default quality gate definition set for its organization. However, a different one can be chosen by a project administrator from among those available within the organization. The quality gate definitions available in your organization are defined and managed at the organization level by an organization administrator.

**In this section:**

* [Understanding quality gates](/sonarqube-cloud/standards/managing-quality-gates/introduction-to-quality-gates.md)
* [Viewing a quality gate](/sonarqube-cloud/standards/managing-quality-gates/viewing-quality-gate.md)
* [Managing custom quality gates](/sonarqube-cloud/standards/managing-quality-gates/managing-custom-quality-gates.md)
* [Changing default quality gate](/sonarqube-cloud/standards/managing-quality-gates/changing-default-quality-gate.md)
* [Associating a quality gate with projects](/sonarqube-cloud/standards/managing-quality-gates/associating-projects-with-quality-gate.md)


---

# 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/managing-quality-gates/introduction.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.
