How It Works
ZeroPath can automatically generate code fixes for detected vulnerabilities and open pull requests with the remediation. The system analyzes the vulnerability context, writes a targeted fix, and presents it for your review before any changes reach your codebase.- AI-generated patches — fixes are generated by an AI agent that understands the vulnerability, the surrounding code, and the appropriate remediation pattern.
- Human-in-the-loop — by default, patches require explicit approval before a PR is created. You review the diff, approve it, and ZeroPath opens the PR.
- Both SAST and SCA — code-level vulnerabilities get code fixes; dependency vulnerabilities get version bumps with proper lockfile updates. Auto-fix PRs are supported for both SAST and SCA findings, so dependency vulnerability patches follow the same review-and-merge workflow as code fixes.
Requesting a Patch
- On-Demand (Dashboard)
- Automatic (during Scans)
1
Navigate to a Finding
Open a finding and select Fix. Patch generation requires a repository connection that ZeroPath can clone.
2
Generate Patch
Click “Generate Patch” on the issue detail view. ZeroPath generates a git diff targeting the vulnerability.
3
Review Changes
Review the proposed changes in the dashboard.
4
Approve, Regenerate, or Select a Variant
Select Approve and Issue Patch to request a PR, or Adjust Patch to request a revision. You can provide up to 4,000 characters of feedback and compare up to three candidates. Choose the candidate to keep. If the repository supports download only, use Patch Diff → Download .diff to apply it yourself. See Patch Variants for details.
Automatic Pull Requests
When you approve a patch (or when auto-PR generation is enabled), ZeroPath:- Checks that no pull request already exists for this patch. If a PR was already opened, the approval is refused with a message explaining that a pull request already exists.
- Creates a fix branch for the relevant scan branch. If no scan branch is available, it uses the repository default.
- Applies the fix as a commit with a descriptive message.
- Opens a pull request with:
- A clear title describing the fix (e.g., “Fix SQL injection in user authentication handler”)
- A description structured in two sections: a Fix section with a one-sentence summary of what the patch does and a short bulleted list of the concrete changes, followed by a Details section with the vulnerability description, root cause, and patch implementation. Both sections use plain Markdown so the body renders correctly in your VCS and in the ZeroPath UI.
- Links the PR back to the finding in ZeroPath for tracking.
Requesting Follow-Up Changes on GitHub
After ZeroPath opens a GitHub patch PR, reviewers can request changes by commenting on the PR with@ZeroPath and a concrete
description of the edit. If ZeroPath can verify that the current PR branch is
the patch branch it created, it commits the requested change to that same branch
and replies with a summary and commit reference.
PR comment
PR creation also requires a repository connection that can push and open a PR. For CVS, Gerrit, and generic Git imports, download the patch and apply it through your normal workflow.
PR Lifecycle Tracking
ZeroPath tracks the status of generated PRs:- Open — PR has been created and is awaiting review.
- Accepted — the PR was merged. This normally updates the finding to Resolved. Check its current status and verification evidence before closing out remediation.
- Rejected — PR was closed without merging.
What Can Be Auto-Fixed
Code Vulnerabilities (SAST)
The AI agent can generate fixes for most code-level security issues, including:- SQL injection
- XSS
- Path traversal
- Command injection
- SSRF
- Insecure cryptography
- Missing authentication/authorization checks
- and more…
Dependency Vulnerabilities (SCA)
For vulnerable dependencies, ZeroPath:- Looks for the nearest published stable version with no known advisories. If none is available, it looks for the nearest version that fixes the targeted advisory without adding new ones. See dependency upgrade selection.
- For direct dependencies: updates the version in your manifest file and regenerates the lockfile using the appropriate package manager.
- For transitive dependencies: updates the direct parent dependency that pulls in the vulnerable package.
- npm / Node.js
- Go modules
- Rust / Cargo
- Ruby / Bundler
- Python / Poetry
- Python / pip
- Maven / Gradle
- and more…
Configuration
Patch generation settings follow org/tag/repo-level inheritance:Repository Instructions in Patches
Follow repository instructions in patches is off by default. Turn it on for a repository (or set it for a tag or the whole organization) and patches follow the repository’s own agent instruction files:AGENTS.md, CLAUDE.md, .cursorrules, .cursor/rules/*.mdc,
.github/copilot-instructions.md and .github/instructions/*.instructions.md. When several
folders have one, the file in the folder closest to the changed code wins. Your organization’s
Contexts marked for patch generation are included under the same switch.
The contents of these files are sent to the AI model together with the code being patched.
Changing the setting does not regenerate existing patches. The repository settings page lists the
instruction files found in the last scan; patches still look for them at patch time if the
repository has not been scanned yet.
This setting is rolling out: patch generation starts following it in an upcoming release.
Jira Ticket References in Templates
When a finding has a linked Jira ticket, you can reference it in your PR title, PR description, branch name, and commit message templates using the following placeholders:
For example, a branch name template of
fix/{jira_id}/{vuln_class} would produce a branch like fix/PROJ-123/sql-injection when the finding is linked to a Jira ticket. If no Jira ticket is linked, the placeholders are omitted and the template is filled with the available vulnerability context only.
SCA-Specific Settings
Troubleshooting
GitHub Actions Workflow Permission Error
If a patch modifies a GitHub Actions workflow file (under.github/workflows/), PR creation may fail with a permissions error. GitHub requires the workflows permission to create or update workflow files via API.
To resolve this:
- Manually apply the patch — copy the suggested changes and commit them yourself.
- Have a repository administrator create the PR — admins with sufficient permissions can push the workflow change.
- Grant the workflows permission — if your organization policy allows it, add the
workflowspermission to the ZeroPath GitHub App installation.
Fix PRs for findings from incomplete scans
You can approve a patch for a finding that ZeroPath recorded before its scan stopped. ZeroPath attempts to open the requested fix PR and shows a failure reason in the patch panel if it cannot.Automatic Retry After PR Submission Failures
When a patch PR cannot be pushed — for example, because of a branch protection rule, a repository ruleset that forbids creating refs, or a revoked installation token — ZeroPath records the failure and retries automatically using an exponential backoff schedule. You do not need to re-approve the patch; once the underlying VCS configuration issue is resolved, the next retry creates the PR. Each submission attempt counts against a per-patch budget of five attempts. Retry intervals grow with each failure (15 minutes, 1 hour, 4 hours, 12 hours) so a repeatedly failing patch does not consume a worker slot every hour while it burns through its budget. Certain failure reasons are classified as permanent and retire the submission immediately without waiting for the budget to be exhausted:- Archived repository — the repository is read-only and cannot accept new branches.
- Missing push credentials — the installation token was revoked or expired, or the integration lacks push access.
- Repository not linked — no VCS integration is configured for the repository.
- Fork pull request — the patch was generated for a finding in a pull request opened from a fork repository. ZeroPath cannot push to a fork’s head branch, so the patch cannot be automatically submitted as a PR. The patch panel shows “We can’t open this pull request” with guidance for applying the fix manually — copy the diff and apply it directly to your branch.
Repository Rule Violations
If your repository has branch protection rules that enforce commit message formats or branch naming patterns, PR creation may fail. Update your repository rules or adjust ZeroPath’s PR branch name and commit message formats under Settings → Remediation → Pull request templates on the repository page (see scanner settings), then retry.Adoption Guide
- Start with on-demand patching — click “Generate Patch” on individual findings to see the quality of generated fixes for your codebase.
- Enable PR scan suggestions — turn on
prScanAutoPatchingto get fix suggestions as inline comments on your pull requests. - Tune thresholds — adjust the patch and PR thresholds to focus auto-patching on high-severity findings first.
- Enable full scan auto-patching — once comfortable with patch quality, enable automatic patch generation for full scans.
- Consider auto-PR creation — for teams with fast review cycles, enable auto-PR to get fix branches created automatically.