IBM Patents a Filter That Screens What an AI Writes Before It Reaches You
IBM's patent application describes a gatekeeper that checks an AI's words while they are being chosen, and can erase a draft that crosses a line before you ever see it.

- Publication number
- US 2026/0387322 A1(US20260387322A1)
- USPTO patent title:
- Security-Based Controlled Grammar Evaluation of Large Language Model Output
- Applicant
- International Business Machines Corporation
- Filed · Published
- Jun 3, 2025 · Dec 3, 2026
- Inventors
- Kevin EYKHOLT
- Status when we published
- Examiner raised objections; the company can respond
- Document
- 20 claims
- US classification
- 726/1
- Examiner
- LITTLE, VANCE M (Art Unit 2494)
What IBM's AI output checkpoint actually does
Today, most defenses around AI chatbots react after the fact. They try to catch a bad answer once the AI has already produced it, and people keep finding prompts that slip past them. That matters most when the AI writes computer code or can trigger other tools, because one harmful line could open a door to your data.
IBM's patent application describes a checkpoint that sits inside the writing process itself. As the AI picks each next word, the checkpoint crosses off any choice that breaks the rules, such as a banned phrase or code that doesn't belong. The approved text waits in a holding area, gets checked once more, and only then goes out to you.
If something goes wrong, the system can erase the draft back to the last clean spot and try again.
receiving an intermediate output from a large language model (LLM) module; generating a decoded output of the intermediate output using input generated by a security-based controlled grammar evaluation module; …
Translation: The system intercepts raw AI text and runs it through a safety filter before anyone sees it.
How the holding area checks text before release
The patent describes a layer wrapped around a large language model (LLM, the AI that powers chatbots and code assistants). The model produces an intermediate output, a list of possible next tokens (small chunks of text, like a word or part of a word) with a probability for each. A security-based controlled grammar evaluation module reviews that list before anything is final.
It filters in two main ways, both described in the filing:
- Language specification: a list of every token sequence allowed for a task, built by collecting sample data, cleaning out invalid strings, and listing what remains. The filing's example is Python code, where only valid Python is allowed.
- Compliance rules: static rules set in advance, like a blocklist of disallowed strings, and dynamic rules created on the fly, such as a rule that watches for overflow patterns after the code defines a buffer variable (a block of memory, a common spot for attacks).
Allowed tokens are decoded into text and stored in an output buffer (a holding area). The module validates that buffer. If it fails a check, the buffer rewinds to an earlier compliant state. If it passes, it is flushed, meaning sent on to the recipient.
A task identification module can pick a different policy depending on whether the request looks like code or translation, and feedback from the buffer can update the module's settings.
The computing device may store the decoded output in an output buffer as at least part of an output stream. The computing device may validate the output stream using the security-based controlled grammar evaluation module.
Translation: Filtered text gets temporarily saved while the system double checks that it is safe to release.
Why AI that writes code needs a gatekeeper
If you use an AI assistant at work, the useful part is a safety check that runs while the text is being written instead of after. The filing points to rules drawn from healthcare privacy (HIPAA), payment security and European data privacy law, and to redacting personal information. For a company that wants to put an AI in front of customers or let it write code, a built-in gatekeeper is easier to defend than a hope that the model behaves.
Keep expectations level. This is a published application, and the examiner's first review rejected the claims as filed, a routine step that is usually followed by amendments. The filing describes the design but does not report test results showing how well it stops real attacks.
IBM's 87th filing we've tracked since May in our AI guardrails watchlist adds to earlier work like their catch-misbehaving-AI application and their blocked-file search fix.
Source: US 2026/0387322 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 the new patents from Big Tech, carmakers and more and send you the ones worth knowing. Plain English, free, every week.
The drawings · 5 sheets
5 drawing sheets from US 2026/0387322 A1 · click any drawing to enlarge

No comments yet