LLM-Based Fix Suggestions for Code Analysis Alerts

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing code analysis tools generate alerts for vulnerabilities and errors in source code, requiring manual and time-consuming developer intervention for fixes, which can be prone to errors, especially in complex code bases.

Innovation Solution

A system and method that utilizes Large Language Models (LLMs) to automatically generate and process fix suggestions for code analysis tool alerts by parsing alerts, generating prompts, and converting LLM responses into formatted suggestions for resolving vulnerabilities or errors, including natural language explanations and selectable options.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual review and fixing of code vulnerabilities is performed by developers, then the fixes can be reviewed and validated by human expertise, but the process is time-consuming and error-prone

Engineering Contradiction:
Improveaccuracy of vulnerability fixesVSAvoidtime required for vulnerability remediation
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent introduces an intermediary system comprising a parser, prompt generator, and LLM-based fix suggestion generator that mediates between the code analysis tool alerts and the developer. This intermediary automatically processes vulnerability alerts, extracts relevant information, generates targeted prompts, and produces fix suggestions, thereby reducing the time developers spend on manual review while maintaining reliability through structured processing and expert model inference.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by automatically parsing vulnerability alerts, extracting code context, generating appropriate prompts, and producing fix suggestions before the developer begins their review process. This preliminary automated processing prepares the groundwork for developer review, reducing the overall time required while ensuring that the fixes are pre-validated through structured analysis.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If developers manually review and propose fixes for code vulnerabilities, then the fixes can be tailored to specific code contexts, but the process becomes error-prone especially for complex code bases or unfamiliar vulnerability types

Engineering Contradiction:
Improveability to handle diverse vulnerability typesVSAvoidaccuracy of vulnerability fixes
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The system enables self-service by allowing the LLM-based fix suggestion generator to automatically analyze vulnerability alerts, extract relevant code context, and generate tailored fix suggestions without requiring developer intervention for each vulnerability type. The system serves itself by processing diverse vulnerability types through standardized parsing and prompt generation mechanisms, reducing errors while maintaining adaptability through context-aware processing.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system changes parameters by dynamically adjusting the prompt structure and content based on the specific vulnerability type and code context. The parser extracts relevant parameters from each alert, and the prompt generator adapts the prompt template to match the vulnerability characteristics, enabling the LLM to generate accurate, tailored fix suggestions for diverse vulnerability types while maintaining high reliability through parameterized processing.

Inventive Principle:
Principle #35Parameter changes

3Productivity

If LLMs are used to generate fix suggestions automatically, then the processing speed and efficiency are improved, but the LLMs have not been specifically trained to fix vulnerabilities or errors associated with code

Engineering Contradiction:
Improvespeed of vulnerability remediationVSAvoidaccuracy of code-specific fix suggestions
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the vulnerability fixing process into distinct components: alert parsing, code context extraction, prompt generation, and fix suggestion generation. By segmenting the process, the system can use the LLM specifically for the generation phase while relying on structured parsing and extraction for the analytical phases, thereby improving productivity through automated LLM inference while maintaining reliability through structured preprocessing and post-processing validation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system introduces intermediary components (parser, prompt generator, response processor) that mediate between the general-purpose LLM and the code vulnerability fixing task. These intermediaries translate vulnerability alerts into structured prompts and translate LLM responses into validated fix suggestions, enabling the use of fast, general-purpose LLMs while maintaining accuracy through structured transformation and validation layers.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentEP4597309A1Methods and systems for processing analysis tool alerts and for generating prompts and fix suggestions for the alerts using ai
Publication Date: 2025.08.06 MICROSOFT TECHNOLOGY LICENSING LLC
  • EP4597309A1 patent drawingFigure 1
  • EP4597309A1 patent drawingFigure 2
  • EP4597309A1 patent drawingFigure 3

AI summary

Systems are provided for implementing methods for generating and processing fix suggestions for alerts produced by code analysis tools. The methods involve receiving an alert, parsing the alert to identify relevant information, and assembling a prompt for a Large Language Model (LLM). The prompt includes a general description of the problem, a description of the alert message, a source-code location, and a request for a proposed fix to the alert. The prompt is sent to the LLM, and a response is obtained. The response includes a proposed fix comprising a set of edits to be applied to the source code and/or configuration files. The response is processed and validated, and a fix suggestion is assembled and provided based on the response. The fix suggestion includes a natural language explanation of the proposed fix, suggested source-code changes, and selectable options for accepting, rejecting, and editing the fix suggestion.