On Windows, some tool-generated PowerShell commands can be blocked by Defender as Trojan:Win32/ClickFix.SA!A

Resolved 💬 3 comments Opened Mar 21, 2026 by Gyropilot2 Closed Mar 21, 2026

Summary

On Windows, a tool-generated PowerShell command used during normal repo work was blocked by Microsoft Defender as:

Trojan:Win32/ClickFix.SA!A

This appears to be a false positive, but it can break the agent/tool workflow in a confusing way because the command simply fails and the user may not realize Defender intervened.

What happened

During a debugging/editing session, Defender blocked a PowerShell command line that looked roughly like this:

  • powershell.exe -Command ...
  • included inline console encoding setup such as:
  • [Console]::OutputEncoding=[System.Text.Encoding]::UTF8;
  • then ran an rg search command
  • the search argument itself contained mojibaked / garbled Unicode text

The Defender notification described the program as dangerous because it “executes commands from an attacker.”

Why this seems relevant to the tool

The command was not malicious user malware behavior. It was part of normal agent/tool-assisted repository work.

My guess is that the generated command line accidentally matched a Defender heuristic because it combined:

  • powershell.exe -Command
  • inline environment/encoding manipulation
  • a strange-looking quoted argument containing corrupted Unicode / mojibake

That combination can look a lot like obfuscated or suspicious PowerShell activity even when the intent is harmless.

Impact

This can cause tool actions to fail in a way that is hard to diagnose:

  • the command may silently fail from the user’s perspective
  • the agent may behave as if a search/edit tool is unreliable
  • the real reason is that Defender blocked the command line

In my case, this was likely entangled with a separate UTF-8 / mojibake issue, which made the command arguments look even stranger.

Environment

  • Windows
  • PowerShell 5.1
  • Microsoft Defender enabled
  • Repo work involving Markdown files and search/edit commands

Suggestion

It would help if Windows-targeted tool execution avoided command shapes that are more likely to trip Defender heuristics, especially:

  • inline powershell.exe -Command wrappers when not necessary
  • inline encoding mutations if they can be handled more safely elsewhere
  • passing visibly corrupted Unicode strings as command arguments

If possible, safer options might include:

  • relying on a UTF-8-configured shell session instead of prepending encoding tweaks per command
  • invoking tools more directly instead of wrapping everything in inline PowerShell
  • sanitizing or avoiding mojibaked search strings before command construction

Additional context

This seems related to another issue where UTF-8 Markdown content could appear as mojibake in the tool context on Windows. If the tool is already constructing commands from corrupted text, that may increase the chance of Defender false positives.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗