Snyk DeepCode AI—the underlying AI remediation engine powering Snyk Code and Snyk Agent Fix—can automatically generate code-level pull requests to patch security flaws across GitHub, GitLab, Bitbucket, and Azure Repos. Setting it up takes less than fifteen minutes in the Snyk Web UI, but 365Finds has a clear warning for DevSecOps teams: do not turn on unrestricted automatic pull requests across your entire codebase at once. Blindly generating PRs creates notification fatigue and congests CI pipelines.
365Finds recommends a phased deployment: enable Snyk DeepCode AI for pull request checks with inline interactive fixes first, and restrict automated backlog fix PRs to high-priority vulnerabilities with strict rate limits.
Prerequisites Before Enabling AI Fix PRs
Before configuring automated pull request generation, verify that your environment meets these structural requirements:
- SCM Integration with Write Permissions: Snyk needs read and write access to your repositories to branch code and submit PRs. If using GitHub, 365Finds strongly advises installing the official Snyk GitHub App rather than relying on personal access tokens (PATs), which tie automation to individual user accounts.
- Snyk Code License: DeepCode AI operates on static application security testing (SAST) rules and requires Snyk Code to be enabled for your organization.
- Supported Languages: Snyk DeepCode AI supports automated code fixes for major enterprise languages including JavaScript, TypeScript, Python, Java, C#, and Go.
Step 1: Enable Snyk Code and DeepCode AI at the Organization Level
DeepCode AI cannot generate remediation PRs if Snyk Code scanning is disabled at the organization hierarchy.
- Log in to the Snyk Web UI.
- In the top-left navigation, select your Organization.
- Go to Settings (gear icon in the header) > Snyk Code.
- Set the toggle for Snyk Code to Enabled.
- Save changes. This authorizes Snyk's hybrid AI engine—combining symbolic analysis with security-tuned large language models—to parse your AST (Abstract Syntax Tree) and synthesize patches.
Step 2: Configure SCM Integration Permissions
To allow Snyk DeepCode AI to create branches and open pull requests:
- Navigate to Settings > Integrations > Source control (e.g., GitHub, GitHub Enterprise, GitLab, Bitbucket, or Azure Repos).
- Click Edit settings for your connected provider.
- Verify repository access permissions. Ensure that Snyk is granted write access for Pull Requests/Merge Requests and Repository Contents.
Step 3: Configure Automatic Fix Pull Requests
Snyk handles automated remediation through two primary mechanisms: scheduled scans that automatically open Fix PRs against existing flaws, and PR Checks that evaluate incoming code changes.
Configuring Global Settings
- In the Organization Settings menu, select your SCM provider (e.g., GitHub).
- Scroll to the Automatic fix pull requests section.
- Configure the following toggles:
- New vulnerabilities: Toggle On. When recurring scans detect a newly exposed vulnerability with an available patch, Snyk opens a PR automatically.
- Known vulnerabilities (Backlog): Toggle On only if paired with priority scoring. Set the Minimum priority score to at least 700 (High/Critical) to prevent Snyk from opening dozens of low-severity PRs simultaneously.
- Set the Maximum open fix pull requests limit (365Finds recommends capping this between 2 and 5 concurrent PRs per repository).
- Set your Test & Automated Pull Request Frequency to Daily or Weekly.
Configuring Project-Level Overrides
If specific production services require tighter controls than the organization baseline:
- Go to Projects and select the target repository.
- Click the Settings tab within that project.
- Select the SCM integration tab.
- Uncheck Use organization settings to customize PR thresholds, target branches, or disable automated backlog PRs for legacy repositories.
Step 4: Enable In-PR Interactive DeepCode AI Fixes
Automated PRs for backlog debt are useful, but 365Finds considers the in-PR developer loop significantly more valuable. This feature allows developers to remediate newly introduced flaws directly inside their ongoing pull requests before merging to main.
- Under your SCM Integration Settings, locate Snyk PR Checks.
- Enable Open Source & Code Security PR Checks.
- Toggle on Inline code comments / Snyk Agent Fix suggestions.
- Once enabled, whenever a developer submits a PR containing a Snyk Code vulnerability, Snyk posts an inline comment on the vulnerable line with an AI-generated patch.
- Developers can inspect up to 5 suggested variations and trigger the fix directly from the pull request conversation by replying:
or specifying the desired option:@snyk /fix
Snyk DeepCode AI will commit the patch directly to the PR branch and re-run its SAST validation scan to confirm the vulnerability is resolved without introducing regressions.@snyk /apply 1
Operational Comparison: Automated Fix PRs vs. In-PR Interactive Fixes
365Finds evaluated both deployment modes across DevSecOps pipelines:
| Capability | Automatic Fix PRs (Backlog/New Issues) | In-PR Interactive Fixes (@snyk /fix) |
|---|---|---|
| Trigger Event | Scheduled recurring scans (e.g., every 24h) | Developer opens or updates an SCM pull request |
| Developer Friction | Moderate; creates separate PRs outside active sprint workflows | Very low; resolves flaws inside existing review windows |
| CI Overhead | High if backlog limits are not configured | Low; leverages existing PR CI runs |
| Verification Loop | Pre-tested by DeepCode AI validation engine | Pre-tested by DeepCode AI; immediately re-checked by PR Check |
| 365Finds Recommendation | Restrict to Critical issues (Score ≥ 700); max 2 PRs | Enable across all teams as default workflow |
365Finds Evaluation: Safeguards and Trade-offs
DeepCode AI differentiates itself from generic LLM coding assistants by running an automated validation loop: before proposing code, the AI-generated fix is scanned by Snyk's static analysis engine. If the proposed code fails security checks or introduces secondary vulnerabilities, the engine discards it and retries.
However, 365Finds observes two critical constraints that engineering leads must address:
- Style and Lint Mismatches: DeepCode AI optimizes for security correctness (such as parameterized queries or explicit bounds checking), not your internal Prettier or ESLint rules. Fix PRs will fail branch protections if your CI requires strict lint passing before merge. Configure a pre-commit GitHub Action to auto-format Snyk PR branches if your repository enforces zero-warning linters.
- Merge Conflicts with Rapidly Moving Branches: Automated backlog PRs branch off the default branch at the scan timestamp. In active repositories with high commit velocity, unattended Snyk PRs quickly become stale. Setting the open PR limit to 2 forces teams to review or close remediation PRs promptly rather than letting unmerged automated branches accumulate.
Snyk generates automatic pull requests using the branch naming convention snyk-fix-<short-hash> and signs commits through the configured Snyk App integration identity.