For AI-developed malware, the workflow is straightforward. The attacker prompts an LLM to produce specific malicious functionality: a credential stealer for a particular browser, a keylogger that hides in a specific process, an injector that bypasses a particular EDR product. With safety guardrails removed (either through jailbreaks of mainstream models, or through purpose-built tools like WormGPT and FraudGPT that have no guardrails to begin with), the LLM produces working code in seconds. The attacker then compiles and tests the result, typically with significant manual debugging.
For AI-mutated polymorphism, the attacker uses an LLM to transform existing source code into many functionally equivalent variants. A 2025 framework called LLMalMorph demonstrated function-level rewrites of malware source code, with up to 31% reduction in VirusTotal detection across the resulting variants. Some PoCs, such as CyberArk's polymorphic ChatGPT-based malware and the BlackMamba keylogger, demonstrated that even less-skilled attackers can use this approach to evade signature-based AV and traditional EDR.
For runtime-LLM malware, the architecture inverts the usual model. The binary itself is small and innocuous-looking, often disguised as a benign utility. At execution time, it makes HTTP requests to a hosted LLM (Hugging Face, OpenAI, or others), sends a prompt describing what it wants to accomplish on the target system, and receives generated commands in response. LameHug, identified by Ukraine's CERT-UA in July 2025 and attributed with moderate confidence to APT28 (Fancy Bear, Russia's GRU Unit 26165), used this technique against Ukrainian government targets, querying Alibaba's Qwen 2.5-Coder model through Hugging Face's API to obtain Windows reconnaissance commands at runtime and exfiltrate documents over SSH. PromptLock demonstrated the same pattern with a locally hosted LLM for offline operation.