Skip to main content
GitHub GitLab The Generate Labels feature analyzes the code changes in a pull request and automatically suggests relevant labels. Suggestions are based on a predefined set of labels and their descriptions, helping teams keep PRs consistently categorized with minimal manual effort. Generated labels can reflect aspects such as the type of change, impacted areas, or the nature of the update, making it easier to triage, review, and track pull requests at scale.

How to use Generate Labels

Manual usage

You can trigger label generation directly from the pull request using a comment command:

Enabling custom labels

Qodo supports custom labels in two different ways, depending on how you manage configuration in your environment. Repository configuration file You can enable and configure custom labels directly at the repository level. To do this, apply the relevant configuration changes in the local .pr_agent.toml file in your repository. Repository labels page
Platforms supported: GitHub, GitLab
Qodo can also work directly with labels defined in the repository itself. When enabled, Qodo reads labels from the repository’s labels page and uses them as candidates when suggesting labels for pull requests.
  • GitHub: https://github.com/{owner}/{repo}/labels, or click the Labels tab in the issues or PR’s page.
  • GitLab: https://gitlab.com/{owner}/{repo}/-/labels, or click Manage and then Labels from the left menu.
To make a repository label discoverable this way, start its description with the prefix pr_agent:. This prefix is how Qodo tells label candidates apart from the rest of the repository’s labels, and applies only to this configuration method. Example (GitHub or GitLab label description): pr_agent: Suggest this label when the PR introduces authentication/authorization logic, handles secrets, touches crypto, or modifies security-sensitive endpoints.
GitHub repository Labels page showing a label's description field with the required pr_agent: prefix

Custom label format

When defining custom labels in .pr_agent.toml, use the following format:
  • Label name: The name of the custom label.
  • Description: A comprehensive, detailed description explaining when Qodo should suggest this label for a pull request.
Example:
  • Label name: security
  • Description: Suggest this label when the PR introduces authentication/authorization logic, handles secrets, touches crypto, or modifies security-sensitive endpoints.

Using label generation

After adding custom labels, they become available for use by Qodo’s label generation feature. In your repository’s .pr_agent.toml file:
  • Set enable_custom_labels to True: This will disable the default labels and enable the custom labels you define.
  • Add the custom labels. It should be formatted as follows:
Example: If you want Qodo to detect changes to SQL queries in a pull request, you can add a custom label with a clear description that explains when it should be applied:
Custom labels list showing configured labels with names and descriptions
When the generate_labels feature runs on a pull request that includes SQL-related changes, Qodo will automatically suggest this custom label:
Qodo suggesting a custom label on a pull request with SQL-related changes
Note that custom labels are not only used by generate_labels. They are also taken into account by the PR description feature, helping enrich summaries and classifications.