> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mindfort.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Patching

> Learn how to generate proposed fix pull requests for security findings using the GitHub integration, then review, validate, and merge.

## Overview

Patching turns a finding into a proposed pull request against the repository and branch you select, giving engineers a concrete change to review and validate.

## Patching Use Cases

Use patching when you want MindFort to turn finding context into a proposed code change.

| Use Case                                       | How It Helps                                                                                            |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| **Address a confirmed finding**                | Generate a proposed fix PR from the finding's evidence, impact, and remediation advice.                 |
| **Speed up remediation review**                | Give engineers a concrete patch to inspect instead of starting from a blank ticket.                     |
| **Handle repeated bug classes**                | Patch similar access-control, validation, or configuration issues faster after a pattern is understood. |
| **Prepare for retest**                         | Merge a reviewed fix, then re-run an assessment or targeted Agent to validate the result.               |
| **Connect security and engineering workflows** | Keep the finding linked to the generated PR so teams can move from evidence to code review.             |

Patching is best for platform-generated pull requests. If your team wants to use a local AI copilot inside its own checkout, connect the copilot through [MCP](/guides/mcp) so it can read MindFort finding evidence and remediation advice from the platform.

## Prerequisites

* Connect GitHub under **Settings → Integrations**.
* Link at least one enabled repository to the target.

## Create a Patch

1. Open a finding from the **Findings** view.
2. Select **Patch** in the finding actions.
3. Select a linked repository.
4. Select the **base branch** the PR should target.
5. Click **Create PR**.

MindFort will begin generating the patch. While the patch is being created, the button shows a "Patching" status indicator. Once complete, a **View PR** link appears so you can review the changes on GitHub.

## Review and Merge

After the PR is created:

1. Review the proposed changes on GitHub.
2. Run your CI/CD checks as usual.
3. Merge when satisfied.

## Recommended Process

1. Start with high- and critical-severity findings.
2. Always review the generated PR before merging — treat it as a starting point.
3. Re-run an assessment or retest after merging to confirm the finding is resolved.
