# AutoFix PR Configuration

## Pull Request Configuration <a href="#pull-request-configuration" id="pull-request-configuration"></a>

You can configure the AutoFix pull requests to your own needs with the ["PR Configuration" settings](https://app.aikido.dev/issues/fix/settings). It's possible to change the following fields:

* **Title Prefix:** Customize the title to match your internal processes
* **Labels:** Add specific labels to the PR for easier sorting and tracking
* **Branch name:** Customize the prefix of the branch Autofix creates
* **Commit Message:** Customize the prefix of the commit message in the PR
* **Summary:** Optionally include an additional message for each PR. For example add custom instructions for engineers or additional context.
* **Create Draft PR:** create draft PRs instead of ready for review.
* **Auto-Merge PR:** Aikido relies on built-in Github, Gitlab and Azure DevOps auto-merge features for this, learn more [here](/autofix-and-remediation/automation-and-merging/auto-merge-autofix-pull-requests.md).
* **Create Task for PR:** important for compliance reasons. This will automatically create a new task in your connected task tracker, linking to the created PR.

### Linking Pull Requests with Tasks

There are two ways to link AutoFix pull requests to tasks, both can be used at the same time.<br>

1. **Linking Existing Tasks**

Task identifiers for issues fixed in the PR are included in the branch name by default. If your workspace is integrated with a task tracker, the PR will automatically be linked to the corresponding task by the task tracker.

The task reference placeholder (`$TASK_REF` ) can be used in the following [Pull Request Configuration](#pull-request-configuration) fields:

* Branch prefix
* Commit message
* PR title

<div data-full-width="false"><figure><img src="/files/Dy1Ii7CVFIHIN3ahQ0xj" alt="" width="563"><figcaption></figcaption></figure></div>

2. **Create a new task per PR**

Creating a task for each AutoFix PR can be used to assign people to review and merge the AutoFix PRs. Enable "*Create task for PR*" in your AutoFix configuration. A task will be created for each AutoFix PR whether it is linked with existing tasks or not.

**Note:** this option is currently only available for Jira and Jira DC.

<figure><img src="/files/VPxnGh6klTXuw2M6R0du" alt=""><figcaption></figcaption></figure>

## Repository-specific configuration

Global AutoFix settings in the Aikido UI apply to all repositories within the Aikido workspace. To configure settings specific to a repository, use the `.aikido` file located at the root of the repo. The configurations specified in this file will override the global settings.

For example, this configuation:

```
autofix:
  pr_config:
    branch_prefix: "aikido-"
    auto_merge: true
  single_pr_for_repo: true
```

creates a single PR for all lockfiles in the repo, the branch name starts with `aikido-` and the PR will be auto-merged by the SCM (eg Gitlab) when the required approvals are present.

The sections below explain each configuration parameter in detail.

### **Branch prefixes**

Branch prefixes can be configured per repo by adding a `.aikido` file at the root level of the repo with the following contents:

```
autofix:
  pr_config:
    branch_prefix: "prefix-for-branch-"
```

AutoFix will use the `branch_prefix` value when creating a branch for that specific repository.

The branch prefix defined in the `.aikido` file takes priority over the branch prefix configured in the UI.

#### Example

If your `.aikido` file contains:

```
autofix:
  pr_config:
    branch_prefix: "security-fix-"
```

AutoFix will create branches like `security-fix-update-dependency-xyz`.

### Auto-merge

Auto merging can be configured per repo by adding a `.aikido` file at the root level of the repo with the following contents:

<pre><code>autofix:
<strong>  pr_config:
</strong><strong>    auto_merge: &#x3C;true | false>
</strong></code></pre>

The auto-merge configuration in the `.aikido` file takes priority over the auto-merge configuration in the UI.

#### Example

If your `.aikido` file contains:

```
autofix:
  pr_config:
    auto_merge: true
```

AutoFix will enabled auto merging for all pull requests in this repo regardless of the configuration in the Aikido UI.

### Grouping AutoFixes per lockfile or per repo

By default, Aikido AutoFix creates a separate Pull Request for every lockfile in your repository. his keeps changes isolated and easy to review for standard projects.

For repos with many lockfiles owned by a single team, receiving many individual PRs can be noisy. Enabling a single PR per repo reduces the administrative overhead and CI/CD usage.

To change this behavior, add or update the `.aikido` configuration file at the **root level** of your repository.

<table><thead><tr><th width="180.09375">Setting</th><th width="100.1796875">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>single_pr_for_repo</code></td><td><code>false</code></td><td>When <code>true</code>, Aikido groups all AutoFixes for the entire repo into one PR.</td></tr></tbody></table>

Example `.aikido` file:

```
autofix:
    single_pr_for_repo: true
```


---

# 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://help.aikido.dev/autofix-and-remediation/configure/autofix-pr-configuration.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.
