Case Library / Phishing / GTIG Discloses PROMPTFLUX: First "Just-in-Time" Self-Obfuscating AI Malware Using the Gemini API

GTIG Discloses PROMPTFLUX: First "Just-in-Time" Self-Obfuscating AI Malware Using the Gemini API

Google's Threat Intelligence Group disclosed PROMPTFLUX, a VBScript dropper that calls the Gemini API mid-execution to have an LLM rewrite and re-obfuscate its own source code hourly, making it the first documented "just-in-time" self-modifying AI malware, though GTIG assessed it as an experimental, not-yet-operational prototype.

Share:

Reviewed by the Social Engineering Examples team.

What Happened

In its November 5, 2025 "GTIG AI Threat Tracker" report, Google's Threat Intelligence Group disclosed that it had identified, first observed in early June 2025, an experimental VBScript dropper malware family it named PROMPTFLUX. Unlike conventional malware that hardcodes its evasion logic, PROMPTFLUX calls the Gemini API mid-execution and asks the LLM to generate new obfuscation/antivirus-evasion code on demand, then saves the freshly obfuscated version of itself to the Windows Startup folder for persistence. GTIG described this as the first documented example of "just-in-time" AI-assisted malware: code that uses an LLM to dynamically rewrite its own behavior during execution rather than relying on static, pre-written logic. The same report also disclosed four other AI-enabling malware families (PROMPTSTEAL, PROMPTLOCK, FRUITSHELL, QUIETVAULT) as part of a broader finding that threat actors were moving from using AI for productivity/coding help toward embedding live AI calls inside malware itself. Google stated PROMPTFLUX remained in a development/testing stage, had not been shown capable of compromising any real victim system, and that it had disabled the Gemini assets (API keys, projects, accounts) associated with the activity.

How the Attack Worked

PROMPTFLUX is a VBScript dropper that first decodes and executes an embedded decoy installer to mask its activity (GTIG cited a lure filename pattern like "crypted_ScreenRec_webinstall"). Its distinguishing feature is a "Thinking Robot" module: using a hardcoded Gemini API key, it sends a POST request to the Gemini API endpoint specifying the "gemini-1.5-flash-latest" model (the "-latest" tag keeps it pinned to the current stable release so the malware survives model deprecation). The prompt is narrow and machine-parsable: it asks the LLM to return only new VBScript antivirus-evasion/obfuscation code, no explanation or formatting, and the malware logs every AI response to "%TEMP%thinking_robot_log.txt." A self-replacement function (AttemptToUpdateSelf) existed in the analyzed sample but was commented out/disabled, though its presence plus the active response-logging indicated the author's intent to build a fully metamorphic script. GTIG also found variant samples where the "Thinking Robot" function was replaced by a "Thinging" function that instructs Gemini (prompted to act as an "expert VBScript obfuscator") to rewrite the malware's entire source code on an hourly cadence, each time re-embedding the original decoy payload, the hardcoded API key, and the self-regeneration logic, creating a recursive, self-sustaining mutation cycle. The malware also attempted to spread by copying itself to removable drives and mapped network shares. GTIG noted the code family showed signs of being in active development/testing (incomplete features commented out, a mechanism limiting the number of Gemini API calls) rather than a finished operational tool.

The Lure & the Tell

Lure: a decoy/installer file with names such as "crypted_ScreenRec_webinstall" (mimicking a screen-recording software installer) used to entice a victim into executing the dropper, a broad, non-geography-specific social-engineering pretext designed to work on many kinds of users rather than a bespoke targeted lure. The "tell": GTIG could find no evidence the current sample ever succeeded in compromising a real network or device. Key giveaways researchers used included the malware's self-limiting mechanism on Gemini API calls, disabled/commented-out self-update code, and the diagnostic log file it left in %TEMP%, all pointing to a tool still being tested rather than one already weaponized in a live intrusion.

Outcome

Not a completed breach. GTIG explicitly assessed PROMPTFLUX as being in a development-or-testing phase: some features were incomplete/commented out (including the core self-replacement function) and a mechanism existed to cap the number of Gemini API calls the malware could make. GTIG stated the current samples did not demonstrate an ability to compromise a victim network or device. Google's response was to disable the API keys, projects, and accounts tied to the activity, and to use the findings to strengthen Gemini's classifiers and the model's refusal behavior against this abuse pattern going forward. No named victim, breach, or financial loss was attributed to PROMPTFLUX itself.

Why It Matters

PROMPTFLUX is significant as a proof-of-concept demonstration, documented by a major cloud/AI provider rather than alleged by a third party, that malware can outsource its own code-mutation and evasion logic to a live LLM API call instead of hardcoding it, producing a metamorphic payload that changes every run (or, in the "Thinging" variant, every hour) without any human attacker intervention. Even though GTIG assessed it as experimental and non-operational at disclosure, it establishes a template threat actors (financially motivated or state-sponsored) could mature: signature-based antivirus becomes structurally weaker against payloads that regenerate via API call, and defenders must add new detection surfaces (outbound calls to generative-AI endpoints, hardcoded-API-key artifacts, anomalous Startup-folder writes) that traditional malware analysis did not need to watch. It also illustrates a new AI-provider responsibility: Google's mitigation was not a patch to a victim's network but disabling of its own API assets and hardening of Gemini's model/classifiers, making the LLM vendor itself a first-line defender against its API being used as a real-time malware-development oracle.

Defenses

GTIG's own writeup doubles as the defense playbook: (1) Google disabled the Gemini API keys, projects, and accounts associated with the PROMPTFLUX activity and applied the findings to harden Gemini's classifiers/model against being used this way going forward (per the companion "Advancing Gemini's Security Safeguards" work). (2) Detection guidance for defenders emphasizes behavioral/heuristic monitoring rather than static signatures, since the payload is designed to mutate every run/hour: watch for VBScript processes making outbound HTTPS POSTs to generativelanguage.googleapis.com or other LLM API endpoints, unexpected script-writing to the Startup folder, and log artifacts like a "thinking_robot_log.txt" style file in %TEMP%. (3) Restrict or monitor egress from user endpoints to generative-AI API domains as a network control. (4) AI providers should rate-limit/anomaly-detect abusive API-key usage patterns (repetitive obfuscation-style prompts) and enforce prompt/output content policies; GTIG notes it disabled the assets and improved model refusal behavior for this exact abuse pattern. (5) For social-engineering-flavored prompt injection observed elsewhere in the same report (actors posing as CTF students/security researchers to jailbreak Gemini), model providers are tightening guardrail training against pretext-based prompts.

Sources
Attack Chain & Defense
The sequence the attacker ran
How it could have been stopped
1
Reconnaissance and tooling setup: consistent with GTIG's broader finding that threat actors are experimenting with commercially available LLM APIs rather than building bespoke AI, the operator likely provisioned or obtained a Gemini API account and hard-coded a live API key into the malware so it could query the model unattended at runtime.
Countering Stage 1: abuse of a commercial LLM API via a stolen or self-registered account and key is mostly outside a downstream network defender's visibility, so the realistic control sits with the AI provider, rate-limiting and anomaly-detecting suspicious API-key usage patterns (e.g., repetitive obfuscation-style prompts) and enforcing output content policies, which is exactly the mitigation GTIG describes Google applying.
2
Lure and dropper construction: the operator built a VBScript dropper wrapped around a decoy installer using a broad, non-targeted software lure name such as "crypted_ScreenRec_webinstall," consistent with GTIG's assessment that the geography- and industry-agnostic naming is typical of financially motivated, mass-distribution tooling rather than a bespoke spear-phishing lure.
Countering Stage 2: generic, geography-agnostic decoy-installer lures are hard to pre-empt individually, but application allowlisting and blocking unsigned or unexpected installer downloads from non-corporate sources reduces the odds a stray installer ever reaches execution.
3
Initial execution: a victim, or in GTIG's analysis, a test/sandbox environment, runs the decoy installer, which decodes and silently launches the embedded VBScript dropper in the background.
Countering Stage 3: endpoint controls that treat VBScript execution from a freshly downloaded installer as suspicious by default, such as disabling the Windows Script Host for standard users or requiring signed scripts, block the dropper before it can run.
4
Persistence: the dropper writes itself, and later each freshly AI-regenerated version, to the Windows Startup folder so the mutated payload re-executes on every reboot.
Countering Stage 4: monitoring and alerting on unexpected writes to the Startup folder and other autorun locations is a long-standing persistence indicator that applies directly here, regardless of how the payload was generated.
5
Runtime LLM query for evasion ("Thinking Robot"): using the hard-coded API key, the dropper sends a narrow, machine-parsable POST request to the Gemini API asking for new antivirus-evasion and obfuscation VBScript code, logging each response locally, effectively outsourcing malware authorship to the model rather than a human operator.
Countering Stage 5: network egress monitoring or allowlisting that flags or blocks scripting-engine processes (e.g., wscript.exe, cscript.exe) making outbound HTTPS calls to generative-AI API domains such as generativelanguage.googleapis.com catches the malware at the exact moment it reaches out for AI-generated evasion code.
6
Recursive self-rewrite ("Thinging" variant): on an hourly cadence, the malware has the LLM regenerate its entire source file, each time re-embedding the original decoy payload, the hard-coded API key, and the self-regeneration logic, producing a metamorphic file that changes every cycle without further attacker involvement.
Countering Stage 6: because the payload mutates on a recurring timer, defenders should shift from static signature matching to behavioral detection, flagging the pattern of a script that rewrites and re-saves its own source file, rather than trying to fingerprint any single generated variant.
7
Propagation: the malware attempts to copy itself to removable drives and mapped network shares, extending its reach beyond the initially infected host in pursuit of broader, opportunistic distribution.
Countering Stage 7: standard removable-media and network-share hygiene, disabling autorun, restricting write access to shares, and endpoint detection tuned to mass file-copy behavior, limits how far the malware can spread once a single host is infected.
8
Objective completion (not yet achieved): per GTIG's analysis, the intended end state is a fully autonomous, continuously mutating dropper resilient to signature-based detection long enough to support follow-on compromise; GTIG assessed that the samples it found had not reached this state, found no evidence of a successful victim compromise, and disabled the associated Gemini API assets before that end state was reached.
Countering Stage 8: this stage describes an end state rather than a discrete attacker action, so the defense is the cumulative effect of the controls above; GTIG's own case shows that effect working, the malware was identified, analyzed, and its supporting Gemini assets disabled before it ever demonstrated an ability to compromise a real victim network or device.
Quick Facts
Victim
No specific named victim; GTIG reports no confirmed compromise of any victim network or device. Impact was limited to Google disabling the actor's own Gemini API assets (keys/projects/accounts) used to build and test the malware.
Location
Global / unspecified. No named country or victim organization is given; GTIG describes the lure filenames as "geography- and industry-agnostic," implying opportunistic, broadly targeted distribution rather than a specific location.
Date
2025-06 (first identified by GTIG) / 2025-11-05 (publicly disclosed)
Impact
None reported/quantified. GTIG states PROMPTFLUX's "current state ... does not demonstrate an ability to compromise a victim network or device," and no ransom, theft, or breach loss figure is associated with it. (Contrast: the related PROMPTSTEAL/LAMEHUG family, attributed to Russia's APT28/FROZENLAKE and used operationally against Ukraine's security and defence sector, did achieve real data exfiltration per CERT-UA's July 2025 alert, but that is a distinct, already-operational malware family, not PROMPTFLUX itself.)
Status
Confirmed
Case Type
Research / Advisory
Sector
Cybersecurity Industry
Related

Related Cases

Susie Wiles AI Voice Impersonation via Hacked Contact List (2025)

An unidentified impersonator used an AI-cloned voice and a hacked personal-contacts list to pose as White House Chief of Staff…

Incident 2025Read →

PROMPTSTEAL/LAMEHUG: APT28's LLM-Powered Malware Against Ukraine

Google's GTIG and Ukraine's CERT-UA documented PROMPTSTEAL (aka LAMEHUG), Russian APT28 malware that queries an LLM (Qwen2.5-Coder via the Hugging…

Incident 2025Read →

WPP Deepfake CEO Scam Attempt

Fraudsters built a fake WhatsApp profile of WPP CEO Mark Read and staged a Microsoft Teams call using an AI…

Incident 2024Read →