Microsoft · Filed Feb 28, 2025 · Published Sep 3, 2026

Microsoft Patents AI That Rewrites Security Patches to Fit Customized Software Copies

A security fix exists for a known vulnerability, but your software is a custom fork and the patch simply won't install. Microsoft is filing a patent for an AI system that rewrites the fix so it fits your code.

A system diagram illustrates how a generative AI model processes upstream software information to create a downstream software patch. Drawing from patent filing US 2026/0259990 A1.
A system diagram illustrates how a generative AI model processes upstream software information to create a downstream software patch.
See all 8 drawings from this filing ↓
Publication number US 2026/0259990 A1 US20260259990A1
Applicant Microsoft Technology Licensing, LLC
Filing date Feb 28, 2025
Publication date Sep 3, 2026
Inventors Ahmed Mahmoud Abdelmottaleb Mohamed BADAWI, Nicolas Jerome GUIBOURGE
US classification 726/22
Examiner RAHIM, MONJUR (Art Unit 2436)
Status when we published Examiner raised objections; the company can respond (Jun 8, 2026)
Document 20 claims

What Microsoft's auto-patch rewriter actually does

When a security hole is discovered in a popular open-source library, developers release a patch to close it. The problem is that many companies run modified versions of that library, and the official patch often can't be applied directly because the code has drifted too far from the original.

Microsoft's patent describes a system that takes that official patch, looks at the parts that failed to install (called "rejected hunks"), and feeds everything into an AI model. The model studies an example of a previous, successful patch job, then writes a brand-new version of the fix tailored to your specific codebase.

The goal is to close the gap between "a fix exists" and "your system is actually protected", a gap that can leave software exposed for weeks or months while engineers manually adapt patches by hand.

From the filing · CLAIM 1
… generating input for a generative model, the input comprising the training shot and an inference shot, the inference shot comprising the upstream source code, upstream patch, rejected hunks of the upstream patch and downstream source code; and providing the input to the generative model to generates the downstream patch.

Translation: Feeding both original and modified code pieces into an AI model so it can build a working fix for customized software.

How the model adapts an upstream fix to downstream code

The system operates in four main steps.

  • Receive upstream materials: The system ingests the original library's source code and the official security patch written against it.
  • Identify the downstream package: It finds the modified, organization-specific version of that library, the "downstream" code that a company actually runs.
  • Build the AI prompt: This is the core of the invention. The system constructs a prompt for a generative model that includes two components: a training shot (a worked example pulled from a stored library of past, successful patch translations) and an inference shot (the current problem). The inference shot bundles the original source, the original patch, the rejected hunks, the specific lines of the patch that couldn't be applied automatically, and the downstream source code.
  • Generate the downstream patch: The model reads all of this context and produces a new patch file written to match the downstream code.

The "rejected hunks" detail is the meaningful engineering choice here. Standard tools already attempt to apply patches automatically and report which sections fail. This system takes those failure reports as signal rather than a dead end, telling the model exactly where the adaptation work needs to happen.

What this means for software supply chain security

Unpatched forks of open-source libraries are one of the most consistent sources of real-world breaches. A fix can be publicly available for months while downstream users remain exposed simply because no one had the time to adapt it manually. This system, if it works reliably in practice, could compress that window from weeks to minutes.

Microsoft's run of AI-assisted security filings suggests the company is betting that AI can take over much of the drudge work in vulnerability management. For developers maintaining large software estates with dozens of custom library forks, a tool like this would change patching from a skilled, time-consuming task into something closer to a review job.

Microsoft's 376th filing in our Microsoft coverage since May joins earlier work like one predicting cyberattack targets and one giving files permanent nicknames.

Editorial take

Known security flaws in widely-used software routinely stay unfixed for months across the thousands of products built on top of them. The cost of that delay is measured in breaches, ransom payments, and compromised personal data.

One flaw in a foundational piece of software can ripple outward into hundreds of dependent products, each needing its own tailored repair. Compressing that exposure from months to days would be a meaningful win for anyone whose data sits inside those products.

The honest question is whether automatically generated fixes are trustworthy enough to deploy, because a patch that appears to close a vulnerability while leaving it open is more dangerous than no patch at all. That reliability question is the only thing that actually matters here.

Get our take in your Top Stories

Liked this breakdown? Add Patentlyze as a preferred source on Google, and our plain-English take shows up more often in your Top Stories the next time Microsoft patent news breaks.

There are more where this came from

We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.

The drawings

8 drawing sheets from US 2026/0259990 A1 · click any drawing to enlarge

AI patch generation system overview, drawing sheet 1 from US 2026/0259990 A1
Sheet 1 AI patch generation system overview
Pre-computed training shot details, drawing sheet 2 from US 2026/0259990 A1
Sheet 2 Pre-computed training shot details
Prompt structure for AI model, drawing sheet 3 from US 2026/0259990 A1
Sheet 3 Prompt structure for AI model
Patch generation and selection process, drawing sheet 4 from US 2026/0259990 A1
Sheet 4 Patch generation and selection process
Patch generator system and triggers, drawing sheet 5 from US 2026/0259990 A1
Sheet 5 Patch generator system and triggers
Patch validation and regeneration loop, drawing sheet 6 from US 2026/0259990 A1
Sheet 6 Patch validation and regeneration loop
Method for generating a downstream patch, drawing sheet 7 from US 2026/0259990 A1
Sheet 7 Method for generating a downstream patch
Computer system for patch generation, drawing sheet 8 from US 2026/0259990 A1
Sheet 8 Computer system for patch generation
Browse all the drawings 8 drawing sheets
Patent filing page

Source. Full patent text and figures from the official USPTO publication PDF.
Reader comments

Be the first to weigh in

Start the discussion

Real name or a handle, either is fine. Comments are read by a person before they appear, so allow a little time. Keep it about the filing.