Windows Defender false positive: codex-x86_64-pc-windows-msvc.exe flagged as Trojan:Win32/Bearfoos.A!ml (v0.29.0)
Resolved 💬 9 comments Opened Sep 5, 2025 by stryio Closed Nov 23, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.29.0
Which model were you using?
_No response_
What platform is your computer?
windows
What steps can reproduce the bug?
While using the Codex CLI to write a Markdown document, Defender popped an alert and immediately quarantined the executable:
Threat: Trojan:Win32/Bearfoos.A!ml
Status: Quarantined
Action: Automatically removed by system
Affected item:
C:\Users\<USER>\AppData\Roaming\npm\node_modules\@openai\codex\bin\codex-x86_64-pc-windows-msvc.exe
After this, running the CLI fails because the binary has been deleted.
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
9 Comments
Confirm it’s the same detection
Alert name: Trojan:Win32/Bearfoos.A!ml (the !ml suffix means Defender’s ML heuristic, which is prone to false alarms).
Microsoft
Reddit
Restore the file (if you’re comfortable)
Windows Security → Virus & threat protection → Protection history → select the detection → Allow on device → then reinstall the CLI (npm i -g @openai/codex).
If you’d rather not allow it, skip to step 4 (WSL workaround).
(General background on similar false-positives and heuristics:
Super User
JUCE
)
Report the false positive to Microsoft (recommended)
Submit the quarantined file to Microsoft Security Intelligence as a Software developer submission. This is the standard way to get Defender signatures corrected quickly.
JUCE
Workarounds that avoid the Windows .exe entirely
Use WSL2: install and run Codex in your Linux subsystem (npm i -g @openai/codex) so Defender never touches the Windows EXE. (Codex CLI supports non-Windows environments well.)
Hacker News
Or temporarily pin an older version (e.g., npm i -g @openai/codex@0.28.x) if that version isn’t flagged on your machine. If it still flags, switch to WSL2.
(Optional) Add a targeted Defender exclusion
Exclude only the specific path to the Codex binary (e.g., %APPDATA%\npm\node_modules\@openai\codex\bin\codex-x86_64-pc-windows-msvc.exe). Do this only if you’re comfortable with the security trade-off.
I got this today, so no fix yet.
The same issue occurs again, usually when writing a document it gets quarantined by Windows Defender.
version 0.34.0
I had the same issue today too. Windows Defender quarantined it as Trojan:Win32/Bearfoos.A!ml, and it's now been removed. It seems like there's no security problem for now, but I don't feel great about it. This is safe, right...?
Yes — that’s the same detection:
⚠️
.A!ml” suffix means flagged it using its machine-learning heuristic rather than a known malware signature.@openai/codex) executable.---
✅ What This Means for You
---
🛠 Your Options
Option A — Restore and Continue (if you trust it):
``
bash
``npm i -g @openai/codex
Option B — Avoid Windows EXE entirely:
``
bash
``npm i -g @openai/codex
Option C — Use an older version (if not flagged):
Option D — Report the false positive to Microsoft:
.exeto via their [ portal](https://www.microsoft.com/en-us/wdsi/filesubmission) (choose Software developer submission).ORRRRRR
⚙️ Fix Microsoft Defender False Positive (While Staying on Windows)
Goal: Stop Defender from quarantining the Trojan:Win32/Bearfoos.A!ml false positive so the Codex CLI can run.
🛠 Step 1 — Restore the quarantined file
Open Windows Security
Go to Virus & threat protection → Protection history
Find the detection entry (Bearfoos.A!ml)
Select it → Actions → Allow on device
This tells Defender that the specific file is safe.
🛠 Step 2 — Add a targeted exclusion
Open Windows Security
Go to Virus & threat protection → Manage settings → Exclusions
Click Add an exclusion → Folder
Add this folder (default global npm install path):
%APPDATA%\npm\node_modules\@openai\codex\bin
This makes Defender ignore only that path without turning off your whole antivirus.
🛠 Step 3 — Reinstall the CLI
npm i -g @openai/codex
After this, the binary won’t get flagged or deleted anymore, and development can continue normally on Windows.
📝 (Optional) Step 4 — Report to Microsoft Security Intelligence
Submit the quarantined .exe as a false positive (software developer submission)
Submit here
This will help get the signature fixed for everyone.
✅ Result: Defender stops quarantining the file, you stay on Windows, and development can continue normally.
Thank you. I've submitted the relevant details to MS Intelligence Feed, and the VirusTotal scan results show no detections. Thanks again :)
I think this bug is likely no longer relevant. There has been no activity in over three months, so I'm going to close. If you see this with the latest version of codex, let us know.
Got a strange bug in what codex generated on my Win11 arm64 PC:
Details:
Screenshot of Microsoft Defender's report:
<img width="503" height="524" alt="Image" src="https://github.com/user-attachments/assets/a387088c-b993-43bd-ad97-7a9b114873a8" />
i got also this windows defender threat report from codex running powershell. I asked codex to explain itself and it replied with the following/
"""
That alert came from a verification command I chose badly.
What the command was trying to do:
Load the newly built Dialogotron.dll from bin\x64\Debug\net8.0-windows.
Instantiate the rule/knowledge classes from that DLL.
Call the new dialog-override resolver with your ownership-conflict sample text.
Print the resolved code/label/source so I could sanity-check the fix without deploying.
Why Defender reacted:
It used Assembly.LoadFrom(...) to load a local DLL into PowerShell.
It used reflection: GetType, CreateInstance, GetMethod, Invoke.
It piped a here-string into another PowerShell process: ... | powershell -NoProfile -Command -.
That combination looks a lot like malware behavior, even when the script is visible and local.
"""