Automated Remediation
Overview
Section titled “Overview”Automated Remediation lets you fix vulnerabilities directly from Fencer without leaving the platform. When a vulnerability is fixable, Fencer launches an AI agent that proposes a code change and opens a pull request (or merge request) in your connected repository — turning hours of manual triage and remediation into a single click.
This feature is available for code scan vulnerabilities (via AI-powered fixes) and select cloud infrastructure misconfigurations (via API-based fixes for AWS and GCP). For details on cloud infrastructure fixes, see Cloud Infrastructure Fixes.
Prerequisites
Section titled “Prerequisites”- A paid plan with the Automatic Fixers feature enabled.
- A role that can edit vulnerabilities (Administrator, Team Member, or Penetration Tester) to launch a fix.
- At least one connected source code integration (GitHub, GitLab, Bitbucket, Azure DevOps, or Cursor Origin) for code-level fixes.
- For cloud fixes, a connected AWS or GCP integration with the optional fixer permissions.
How it works
Section titled “How it works”Fencer supports two fix types: AI-based and API-based. AI fixes apply to any vulnerability discovered through a code scan — Fencer clones the affected repository and an AI agent works on the code with the vulnerability’s context, producing a patch and a summary of what it changed and why. API fixes target specific cloud misconfigurations (for example, blocking public access on an S3 bucket) and call the cloud provider’s API directly.
Every fix goes through a tracked lifecycle. When you trigger a fix, Fencer creates a fix attempt with the status Pending, In Progress, Success, or Failed. For AI code fixes, on success you can review the generated diff, download the patch file, and open a pull request — or let Fencer open it automatically. For API-based cloud fixes, success means the fix was applied directly to your cloud environment — see Cloud Infrastructure Fixes for the full lifecycle and verification workflow.
The first AI fix for each vulnerability counts toward AI Fixers usage, shown on the Usage tab of Admin > Billing.
Usage / Configuration
Section titled “Usage / Configuration”Triggering a fix
Section titled “Triggering a fix”- Open a vulnerability’s detail page.
- If the vulnerability is fixable, the Mitigation card shows a Launch Agent to Fix button (or Show Instructions for a cloud misconfiguration).
- Click Launch Agent to Fix. If the vulnerability has no assignee, it is assigned to you.
- The button tracks the attempt: Fix Queued, Fixing…, then Fix Available or Fix Failed. The card shows the agent’s progress while it works and a summary when it finishes.
To fix several vulnerabilities at once, select them in a vulnerability list and choose Fix from the bulk actions. Up to 50 vulnerabilities are processed per request, and Fencer skips any that can’t be fixed automatically or already have a fix in progress.
Fixing a group of vulnerabilities
Section titled “Fixing a group of vulnerabilities”To fix every open vulnerability in a group with one pull request, open Vulnerabilities > Grouped, then either right-click the group and choose Schedule fix…, or select the group and click Schedule fix above its vulnerabilities. Fencer shows how many vulnerabilities it will fix, how many it will skip (those that can’t be fixed automatically or already have a fix in progress), and how many pull requests it will open before you confirm. A group that spans several repositories or branches gets one pull request per repository branch, and a branch with more than 50 vulnerabilities gets one pull request per 50. A group fix always opens its pull request, even when automatic pull requests are turned off for the repository. The group’s Fix column shows where its latest fix stands: Fixing… while it runs, then Fix ready or Failed.
A vulnerability can’t be fixed on its own while a group fix is running on it. Once the group fix finishes, you can fix it on its own even while the group’s pull request is still open.
Reviewing a fix attempt
Section titled “Reviewing a fix attempt”- On the Mitigation card, click View full agent details (or Fix Available). The fix opens in the Main > Agents workspace with the vulnerability alongside it.
- Review the Changes — the diff of the proposed fix — and the summary that explains what was changed and why.
- If the attempt failed, the error details are displayed so you can understand the issue. Click Review & Re-Run Fix on the vulnerability, or Rerun AI fix in the workspace, to try again.
Downloading a patch
Section titled “Downloading a patch”In the fix’s agent details, click Download patch. The patch is a diff file that you can apply
locally with git apply.
Opening a pull request
Section titled “Opening a pull request”By default, Fencer opens a pull request automatically as soon as an AI fix attempt succeeds. If automatic pull requests are turned off, click Create pull request under the fix summary.
- Fencer creates a branch named
fencer-fix-<vulnerability-slug>-<attempt-id>in your repository (fencer-fix-group-<attempt-id>for a group fix). - The patch is applied as a commit, and a pull request (or merge request) is opened against the branch where the vulnerability was last found.
- The PR title follows the format
Fix <VULN-SLUG>: <vulnerability title>and includes the AI-generated summary in the body. A group fix’s PR is titledFix <group title> vulnerabilities, its body lists every vulnerability it resolves under Resolves, and its View in Fencer link opens the group. - The PR status is tracked in Fencer and updates as the PR is merged, closed, or rejected. Use View pull request to open it. When the PR merges, every vulnerability it resolves moves to Ready for verification.
On GitHub, the PR body includes an Autofix checkbox. While it is ticked, Fencer answers review comments on the pull request with follow-up changes; untick it to turn that off for the PR.
Automatic pull requests
Section titled “Automatic pull requests”Whether Fencer opens a pull request automatically when an AI fix succeeds is set in two places:
- Organization default — Settings > Organization, under AI fixes, toggle Automatically open a PR on AI fix. It is on by default. Changing it requires the Administrator role.
- Per repository — open the repository under Posture > Code, go to its Settings tab, and under Automation > AI Fixes set Automatically open a PR on AI fix to Use organization default, On, or Off.
Pull request states
Section titled “Pull request states”| State | Description |
|---|---|
| Pending | PR creation is queued |
| Open | PR was successfully created in the repository |
| Merged | PR was merged |
| Rejected | PR was closed without merging |
| Failed | PR creation encountered an error |
Examples
Section titled “Examples”Fixing a code vulnerability with AI
Section titled “Fixing a code vulnerability with AI”You discover a dependency vulnerability (VULN-1234) in your GitHub repository’s package.json. On
the vulnerability detail page, you click Launch Agent to Fix, and within a few minutes the
attempt completes with a diff showing the updated dependency version. Fencer opens a pull request in
your repository on a fencer-fix-vuln-1234-… branch, and your team reviews and merges it through
your normal workflow.
Fixing an AWS misconfiguration
Section titled “Fixing an AWS misconfiguration”A cloud scan detects that an S3 bucket allows public access. On the vulnerability detail page, you click Show Instructions, review the fix, and click Apply Fix Automatically. Fencer calls the AWS API directly to apply the configuration. The attempt completes with a Success status and the vulnerability moves to Ready for verification automatically. For a detailed walkthrough of the cloud fix workflow and verification steps, see Cloud Infrastructure Fixes.
Troubleshooting
Section titled “Troubleshooting”- “Fix attempt must succeed before creating a pull request.” — You can only open a PR after a fix attempt reaches the Success status. If the attempt failed, review the error and try again.
- PR creation fails with a permissions error — Ensure your GitHub App (or GitLab/Bitbucket/Azure DevOps/Cursor Origin integration) has write access to the repository, including permission to create branches and pull requests. On Cursor Origin, that means the app needs both Write repository contents and branches and Create and update pull requests.
- Fix attempt times out — AI-based fixes have a processing timeout. Stale attempts are automatically detected and marked as failed. You can retry by triggering a new fix attempt.
- Provider unavailable error — The repository’s integration may be disconnected or its token may have expired. Reconnect the integration and try again.
- No pull request was opened — automatic pull requests are off for the repository or the organization. Click Create pull request, or turn on Automatically open a PR on AI fix.