3 min read
How generative AI can be used for spam and graymail detection
Mara Ellis
January 28, 2026
Large language models and NLP-driven classifiers let systems go beyond surface features like keywords and sender reputation. Instead, they can model things like intent, tone, structure, and discourse patterns in messages. That approach matches a Frontiers in Artificial Intelligence study’s framing of phishing as fast-adapting social engineering: “Phishing represents a category of cyber-attacks based on social engineering, with a significant impact on individuals and organizations, and a high capacity for reinvention by adapting its modus operandi according to technological advancements.”
Email security has also moved away from older machine-learning approaches toward deep learning and transformer-style models for a simple reason: spam and graymail constantly change shape. Modern attacks and aggressive marketing don’t repeat the same phrases over and over. They rewrite, paraphrase, and sound right. NLP models help by spotting patterns that stay consistent even when the wording changes, recycled structure, repeated phrasing, emotional pressure, and a kind of polished sameness that often shows up in automated outreach.
Spam vs. graymail
Spam and graymail are two different types of unwanted email. Spam is unwanted, mass, and often irrelevant or harmful messages that get past filters. For example, predatory invitations for academic doctors to go to conferences or write for journals.
A study from 2014 to 2015 cited in Neurology Clinical Practice found that academic doctors got an average of 2.1 of these spam invitations every day, with 16% being duplicates and 83% being of little relevance. Graymail, on the other hand, refers to unwanted but requested newsletters or notifications that spam filters don't catch completely. In 2015, these made up 20% of corporate emails that filled up inboxes along with true spam.
In medical settings, spam is a lot of sales pitches from vendors, updates on society, and publication digests that aren't useful. Graymail, on the other hand, is institutional mass distributions like departmental announcements that doctors choose to receive but later find unproductive.
The BMJ Academic spam study shows that spam is still a problem. It shows that mid-career academics get 312 spam invitations every month, mostly from predatory publishers like OMICS Group, who want them to attend conferences or journals that aren't relevant. Unsubscribing only reduced the amount of spam by 39% in the short term and 19% after a year.
How generative AI is being used to create smarter spam
Generative AI has raised the bar for spam and phishing by making fraudulent messages sound far more natural and convincing than before. Tools like ChatGPT, the antithesis in Paubox’s generative AI feature, can produce long, well-structured content that closely resembles legitimate academic and professional writing. In one proof-of-concept, a language model generated a full neurosurgery-style article, complete with abstract, methods, results, discussion, tables, and citations, in about an hour.
According to a Journal of Medical Internet Research study, “The study demonstrates the potential of current AI language models to generate completely fabricated scientific articles. Although the papers look sophisticated and seemingly flawless, expert readers may identify semantic inaccuracies and errors upon closer inspection.”
The piece initially appeared authentic, even though a closer review revealed fabricated references. The same capability translates directly to spam and phishing. Large language models can generate emails that closely mirror real workplace communication, using contextual cues, imperative language, first-person phrasing, and dense sentence structure to increase credibility and persuasive force. AI-generated phishing messages can slip past filters in major platforms like Gmail and Outlook, exposing weaknesses in systems that still rely heavily on rules or older machine-learning approaches.
The rise of ‘legitimate’ inbox exploitation
Modern phishing depends heavily on exploiting existing relationships and communication patterns, rather than relying on obvious fake senders. Healthcare research also shows that attackers often copy routine internal processes to take advantage of staff trust and time pressure. As a result, phishing today is less about malware links and more about abusing legitimate inboxes as part of the attack itself.
In January 2025, the U.S. Health Sector Cybersecurity Coordination Center warned that business email compromise had become one of the most financially damaging threats to healthcare. The agency noted that many of these incidents involve fraud sent from previously compromised, legitimate inboxes, so the emails appear to come from real internal users or trusted partners.
Defensive use of generative AI
Generative AI is increasingly used on the defensive side to strengthen spam and phishing detection by simulating realistic attack behavior. Models such as GANs can generate lifelike phishing examples that help train detection systems on how modern scams actually look, exposing weaknesses in older filters and improving resilience against changing tactics. Automated threat simulation helps systems recognize abnormal email patterns by closely imitating real attacker strategies, rather than relying on static rules.
Defensive language models also analyze how messages are written, not just what words they contain. A Scientific Reports study on the position of transformer-based and hybrid architectures, noting the effectiveness of “contextual embedding using Bidirectional Encoder Representations from Transformers (BERT), feature extraction with Convolutional Neural Network (CNN), [and] Gated Recurrent Unit (GRU) temporal dependencies,” combined with attention mechanisms to focus on key phishing cues.
Generative models like Paubox are used to create augmented training data, which helps reduce false positives, especially for graymail-like newsletters or automated business emails that often get mislabeled as malicious. Instead of reacting only after new spam appears, this approach allows systems to proactively test and harden themselves using realistic counterexamples. In healthcare and other high-volume environments, these tools can also help reduce inbox overload by more accurately separating real threats from low-value noise, supporting both security and staff workload management.
See also: HIPAA Compliant Email: The Definitive Guide (2025 Update)
FAQs
How does spam support account takeover?
Spam campaigns frequently harvest credentials that are later used for lateral movement and business email compromise.
Why is spam still relevant despite advanced filtering?
Attackers continuously adapt message content and delivery methods, keeping spam effective against static defenses.
How does defensive AI improve threat detection?
It analyzes patterns, behavior, and context rather than relying only on static rules or known signatures.
Subscribe to Paubox Weekly
Every Friday we bring you the most important news from Paubox. Our aim is to make you smarter, faster.
