IBM Files Patent for Checking AI-Written Code Without Ever Running It
IBM's patent application describes a way to catch a bad AI-written command without ever running it. In one example from the filing, an AI asked to remove a user from a group wrote a command that added the user instead.

- Publication number
- US 2026/0367884 A1(US20260367884A1)
- Applicant
- International Business Machines Corporation
- Filed · Published
- May 19, 2025 · Nov 19, 2026
- Inventors
- Brad Lee BLANCETT, Pooja AGGARWAL, Oishik CHATTERJEE, Ting DAI, Prateeti MOHAPATRA, Arthur DE MAGALHAES, Chad HOLLIDAY, Steven Paul BARBIERI, Eugen POSTEA
- Status when we published
- Waiting for an examiner
- Document
- 20 claims
- US classification
- 717/104
What IBM's code-checking patent actually does
Imagine you ask an AI assistant to remove a user named test from a group on your company's server, and it hands back a command that does the opposite: it adds the user. Paste that in without reading it closely and you've made a mess.
IBM's patent describes a checker that catches this kind of slip. Instead of running the command to see what happens, which can be risky on a real server, a second AI reads the code, describes in plain words what it does, and compares that description to what you asked for. When the two don't match, it explains why.
That explanation becomes feedback, and the feedback is used to rewrite the original instructions given to the AI, so the next attempt is more likely to get it right.
… determining, using the machine learning component, a functional correctness of the generated code by performing a semantic validation operation without executing the generated code or comparing the generated code to a ground truth reference; …
Translation: The system checks if the code works by analyzing its meaning instead of running it or checking an answer key.
How the AI grades code it never runs
The system starts with a task described in plain language, such as fetch a list of top memory processes. An AI model (a large language model, or LLM, the software behind chatbots) writes the code. A machine learning component then works out what that code actually does and describes it.
Next comes the step claim 1 centers on, called semantic validation (judging whether code does what it is meant to do, rather than just whether it is well formed). It happens without running the code and without comparing it to a known right answer. The filing describes gathering similarity evidence and difference evidence between the request and the code, then ranking it. One ranking method counts how often each point appears across repeated analyses. Another predicts sample output and checks it against what the evidence implies.
The findings become a reasoning explanation, which feeds a feedback step. Feedback can use retrieval-augmented generation (RAG, where the AI is handed details about the error and possible fixes along with the question). The result is a refined prompt for the next round of code.
The filing also describes splitting big tasks into small steps, dropping steps that can't be automated, and pulling in missing system details. It focuses on system administration and shell scripts.
A refined prompt is generated by refining a prompt using the generated feedback to improve subsequent code generation by the LLM.
Translation: It uses the lessons learned from checking the code to write better instructions for the AI next time.
Why this matters for AI-written server scripts
If you ever rely on AI to write commands for a computer you care about, the big worry is a confident wrong answer. The filing says testing generated code usually means running it in a carefully set up test environment, which is slow and costly, and that running code you don't trust carries security risks of its own. Checking by reading avoids both.
The filing aims at system administration and shell scripts, where a bad command can disrupt a server. It also says the checker improves over time: each mistake feeds back into the instructions the AI sees next, which could cut the manual review that eats up the time AI coding tools are meant to save.
That makes this IBM's 83rd filing we've tracked since May in the AI safety guardrails race, following its work on auto-patching chatbot attacks and stress-testing bots with rewritten prompts.
Source: US 2026/0367884 A1 at the USPTO (PDF). Full patent text and figures are in the official publication.
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 IBM patent news breaks.
We read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.
The drawings · 14 sheets
14 drawing sheets from US 2026/0367884 A1 · click any drawing to enlarge
Show the other 6 sheets

No comments yet