mathewboswell.com — llm-vulnerability-management-patch-automation.md
guest@mathewboswell:~$ cat llm-vulnerability-management-patch-automation.md

From Alerts to Action: Using LLMs to Automate Vulnerability Management

2026-10-13 · # security # vulnerability-management # automation # llms

Vulnerability management has a throughput problem.

Most teams can detect more vulnerabilities than they can realistically assess, prioritize, remediate, and verify. New CVEs arrive constantly; dependency graphs change just as quickly; and the security signal that actually matters is buried beneath duplicate alerts, vague severity scores, and incomplete asset data.

Large language models can help—not by becoming an autonomous security administrator, but by acting as the reasoning layer between vulnerability intelligence and a tightly governed automation pipeline.

The opportunity is to move from “a scanner found something” to a repeatable loop:

Detect → understand → prioritize → patch → test → approve → deploy → verify

That sounds simple. The real work is designing the guardrails around it.

What an LLM adds to vulnerability management

Traditional vulnerability tooling is already good at collecting data. Vulnerability scanners, software composition analysis (SCA) tools, cloud security platforms, and endpoint-management tools can identify affected software, known CVEs, and missing patches.

The challenge is making sense of all of it in the context of a real environment.

An LLM can combine and explain signals such as:

  • The affected package, application, image, host, or SaaS integration
  • CVE details, severity, affected versions, and available fixed versions
  • Whether the vulnerability is being exploited in the wild
  • Internet exposure and asset criticality
  • Dependency paths and reachability
  • Existing compensating controls
  • Change history, test coverage, and deployment risk
  • Runbooks, service ownership, and maintenance windows

That enables better questions than “Is this CVE critical?”

For example:

  • Is this vulnerable dependency actually present in a production workload?
  • Is it directly used, or only included transitively?
  • Does the affected code path appear reachable?
  • Is the service public-facing?
  • Is there a patched version that is compatible with our application?
  • What similar upgrades have succeeded or failed in this repository?
  • Should the issue create a pull request, a ticket, an emergency change, or simply be monitored?

The LLM’s job is to produce an evidence-backed recommendation. It should not be trusted as the final authority on exploitability or production deployment.

Monitoring for new vulnerabilities

A practical system starts with reliable, structured inputs. The LLM should enrich and interpret those inputs—not replace them.

Useful sources include:

  • Software inventories and SBOMs. CycloneDX and SPDX inventories provide the map of what is actually deployed.
  • Dependency and container scanning. GitHub Dependabot, Snyk, Trivy, Grype, GitLab Dependency Scanning, and commercial SCA platforms can identify affected components.
  • Vulnerability intelligence. CVE records, the NVD, vendor advisories, GitHub Security Advisories, and the OSV database provide vulnerability and version data.
  • Exploitation intelligence. CISA’s Known Exploited Vulnerabilities catalog is especially useful as a prioritization signal because it focuses on vulnerabilities with evidence of active exploitation.
  • Asset and exposure context. A CMDB, cloud inventory, Kubernetes inventory, EDR, WAF, and attack-surface-management platform provide the business context scanners lack.

An event-driven workflow can ingest new vulnerability records as they appear, then correlate them against the organization’s software inventory. For example, when a new advisory is published, a worker can:

  1. Normalize the advisory into a common format.
  2. Match affected packages and versions against SBOMs, repositories, container images, and endpoints.
  3. Enrich each finding with service ownership, exposure, environment, exploit signals, and available remediation.
  4. Ask an LLM to summarize the evidence and recommend the correct workflow.
  5. Route the result according to policy.

The important point: the LLM should receive a bounded, trusted data package. It should not be asked to browse arbitrary untrusted web pages and make production decisions from them.

Prioritization: beyond CVSS

CVSS remains useful, but it is not a patching queue.

A CVSS 9.8 issue in an isolated development environment may be less urgent than a lower-scoring vulnerability in an internet-facing production service with active exploitation. A good prioritization model considers both technical severity and local risk.

A simple policy might look like this:

  • Known exploitation: escalate priority immediately
  • Internet-facing asset: increase urgency
  • Production environment: increase urgency
  • Critical business service: increase urgency
  • Reachable vulnerable code: increase urgency
  • No fixed version available: create mitigation workflow
  • Tested patch available: enable automated PR path
  • Unsupported/end-of-life component: escalate for replacement

The LLM can explain the score in plain English, link the evidence, identify the service owner, and recommend a next step. This is where it is most valuable: translating a pile of security data into a decision a developer, SRE, or security analyst can act on.

Automating the patch safely

For application dependencies, the automation path is mature.

Tools such as GitHub Dependabot and Renovate can already create pull requests that update vulnerable packages and lockfiles. Dependabot security updates automatically attempt a corrective pull request when an alert identifies a vulnerable dependency, while Renovate provides extensive control over update schedules, grouping, and repository-specific rules.

The LLM can improve that workflow by handling the context around the patch:

  • Read the advisory and identify the minimum safe upgrade.
  • Inspect the dependency graph and affected application code.
  • Summarize breaking changes from release notes and changelogs.
  • Update configuration or application code when an upgrade requires a small migration.
  • Generate or adjust tests for the changed behavior.
  • Explain the pull request in terms of risk, impact, and rollback.
  • Route the change to the right owners.

A typical flow is:

New advisory or scanner finding → Match against SBOMs and deployed assets → Risk policy evaluates exposure, exploitability, and business context → LLM creates an evidence-backed remediation plan → Dependency bot or automation opens a patch branch → CI runs build, tests, SCA, SAST, container scan, and policy checks → Human approval when required → Progressive deployment and runtime verification → Close the finding only after verification.

For operating systems, containers, and infrastructure, the pattern is similar but the execution layer changes:

  • Containers: Rebuild from a patched base image, scan the resulting image, sign it, and deploy through GitOps.
  • Cloud infrastructure: Use Terraform, CloudFormation, or Pulumi to update immutable infrastructure or managed-service versions.
  • Endpoints and servers: Use tools such as Microsoft Intune, Jamf, Ansible, Puppet, Chef, AWS Systems Manager, or Azure Update Manager.
  • Kubernetes: Update image references or Helm charts through a pull request, then roll out progressively with health checks.

In every case, treat the LLM as a planner and change author—not as an unrestricted production operator.

Guardrails matter more than clever prompts

A patching agent should be governed like any other privileged automation.

The safe model is policy-based autonomy:

  • Auto-merge only low-risk changes. For example, patch-level dependency updates with passing tests, no production configuration changes, and an approved dependency source.
  • Require human approval for higher-risk changes. Major-version upgrades, kernel updates, database changes, public API changes, or changes to critical services should enter a review queue.
  • Use least-privilege credentials. The agent may create a branch and pull request, but it should not have unrestricted production access.
  • Keep execution deterministic. The LLM can propose a command or infrastructure change; a controlled pipeline should validate and execute it.
  • Protect against prompt injection. Advisory text, changelogs, issue comments, and repository files are untrusted inputs. Never allow content from them to override system instructions, approval rules, or deployment policy.
  • Maintain an audit trail. Store the evidence, model recommendation, change diff, test results, approver, deployment result, and verification outcome.
  • Design rollback before deployment. A patch is not automated safely unless the system can stop, roll back, or restore service when checks fail.

The best systems use LLMs to reduce human effort while preserving human accountability.

An implementation blueprint

A practical stack could include:

  • Inventory: SBOM generation with Syft, CycloneDX, SPDX, or native build tooling
  • Detection: Dependabot, Renovate, Trivy, Grype, Snyk, GitHub Advanced Security, or a commercial vulnerability-management platform
  • Intelligence: CVE/NVD data, OSV, GitHub Security Advisories, vendor advisories, and CISA KEV
  • Orchestration: GitHub Actions, GitLab CI/CD, Jenkins, Temporal, Step Functions, or a workflow engine
  • LLM layer: A model accessed through a secure API with structured outputs, retrieval over approved internal documents, and no direct production credentials
  • Change execution: Pull requests, GitOps with Argo CD or Flux, Terraform, Ansible, or endpoint-management tooling
  • Verification: CI tests, policy-as-code, image scanning, canary deployment, telemetry, and automated rollback

Start with one narrow workflow: automatically create security-update pull requests for direct application dependencies, run the existing test suite, and ask the LLM to prepare the explanation and risk summary. Measure merge rate, lead time to remediation, failed deployments, and reopened findings.

Once that workflow is reliable, expand to transitive dependencies, container base images, and infrastructure patches.

The goal is not “fully autonomous patching”

The most useful outcome is not an AI that blindly patches everything. It is a security and engineering workflow that responds faster, with better evidence and less manual triage.

LLMs can help security teams understand what changed, why it matters, what can safely be automated, and when a human needs to step in. Pair that reasoning with strong data sources, policy controls, tested automation, and auditable deployments—and vulnerability management becomes less of a backlog and more of a continuously improving system.

That is the real promise: not fewer vulnerabilities, but far less time spent between discovery and verified remediation.

guest@mathewboswell:~$ cd /posts
guest@mathewboswell:/posts/llm-vulnerability-management-patch-automation2026 — System 1.0