You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows Defender false positive: codex-x86_64-pc-windows-msvc.exe flagged as Trojan:Win32/Bearfoos.A!ml (v0.29.0) #3207
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 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...?
The “.A!ml” suffix means flagged it using its machine-learning heuristic rather than a known malware signature.
This type of detection is well known to produce false positives, especially with newly built binaries like the (@openai/codex) executable.
Multiple developers (like the one you quoted, “mirseo”) are reporting the same issue with version 0.34.0, which makes it even more likely this is a false positive, not an actual infection.
✅ What This Means for You
There is no confirmed security threat in the package — just that Defender is being overly cautious.
The CLI gets flagged when it writes or rebuilds parts of itself (such as when generating documents), which triggers heuristic suspicion.
🛠 Your Options
Option A — Restore and Continue (if you trust it):
Open Windows Security → Virus & threat protection → Protection history
Find the Bearfoos.A!ml entry
Click Allow on device
Reinstall:
npm i -g @openai/codex
Option B — Avoid Windows EXE entirely:
Install and run it inside (WSL2):
npm i -g @openai/codex
Defender won’t scan Linux binaries, so it won’t get quarantined.
Option C — Use an older version (if not flagged):
npm i -g @openai/codex@0.28.x
Option D — Report the false positive to Microsoft:
The “.A!ml” suffix means flagged it using its machine-learning heuristic rather than a known malware signature.
This type of detection is well known to produce false positives, especially with newly built binaries like the (@openai/codex) executable.
Multiple developers (like the one you quoted, “mirseo”) are reporting the same issue with version 0.34.0, which makes it even more likely this is a false positive, not an actual infection.
✅ What This Means for You
There is no confirmed security threat in the package — just that Defender is being overly cautious.
The CLI gets flagged when it writes or rebuilds parts of itself (such as when generating documents), which triggers heuristic suspicion.
🛠 Your Options
Option A — Restore and Continue (if you trust it):
Open Windows Security → Virus & threat protection → Protection history
Find the Bearfoos.A!ml entry
Click Allow on device
Reinstall:
npm i -g @openai/codex
Option B — Avoid Windows EXE entirely:
Install and run it inside (WSL2):
npm i -g @openai/codex
Defender won’t scan Linux binaries, so it won’t get quarantined.
Option C — Use an older version (if not flagged):
npm i -g @openai/codex@0.28.x Option D — Report the false positive to Microsoft:
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.
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.
"""
Activity
warmaster1884-crypto commentedon Sep 5, 2025
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.
joasoze commentedon Sep 10, 2025
I got this today, so no fix yet.
stryio commentedon Sep 11, 2025
The same issue occurs again, usually when writing a document it gets quarantined by Windows Defender.
version 0.34.0
mirseo commentedon Sep 11, 2025
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...?
warmaster1884-crypto commentedon Sep 11, 2025
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):
Open Windows Security → Virus & threat protection → Protection history
Find the Bearfoos.A!ml entry
Click Allow on device
Reinstall:
Option B — Avoid Windows EXE entirely:
Install and run it inside (WSL2):
Defender won’t scan Linux binaries, so it won’t get quarantined.
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.
mirseo commentedon Sep 11, 2025
Thank you. I've submitted the relevant details to MS Intelligence Feed, and the VirusTotal scan results show no detections. Thanks again :)
etraut-openai commentedon Nov 23, 2025
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.
danielkornev commentedon Feb 11, 2026
Got a strange bug in what codex generated on my Win11 arm64 PC:
Details:
Screenshot of Microsoft Defender's report:

mssveca commentedon Mar 31, 2026
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.
"""