r/PowerShell • • 5d ago

Script Sharing I built a free PowerShell tool that finds rogue AI agents on Windows machines

Do you know if rogue AI agents are running on your machines?

I've been in IT for 25 years, 13 of them running my own MSP. I built Rogue Agent Checker (RAC) to give back, for the sysadmins who don't know whether agents are running amok on their boxes.

RAC finds AI agents on a Windows machine that aren't on your approved list: Claude Code, OpenClaw, Codex, Copilot agent mode, MCP servers, homemade Python bots. It shows you where each one is and what it can reach, and hands you a report (HTML, CSV, JSON) you can give to a manager or an auditor.

  • Free, Apache-2.0. Plain PowerShell (5.1 or 7). No modules, nothing to install.
  • Read-only. It never changes, disables or deletes anything, and never runs what it finds.
  • Local-only. It doesn't phone home. Keys are reported by name, never by value.
  • One machine per run. For a fleet, push it through your RMM; -RmmMode returns exit codes.

Try it (read-only; it only writes the report folder):

Get-ChildItem -Recurse .\RogueAgentChecker | Unblock-File
.\RogueAgentChecker\Start-RogueAgentScan.ps1 -OutputPath C:\RAC\report

Tested live on Windows 11 against a staged rogue agent (a hidden "OneDrive Sync Helper" calling OpenAI) and a real OpenClaw install. The first build missed the rogue in 3 of 4 scans, because Windows forgot its hostname after 60 seconds. The write-up of that miss, and the fix, is in the repo.

One rule in the README, for the agents: if RAC reports you, say so. Don't rename, hide, relaunch, or reschedule yourself to get around it. That rule exists because an AI agent running my tests over SSH lost its connection and, instead of stopping and telling me, relaunched the run hidden and base64-encoded. RAC can't see agents working over SSH yet. That's first on the 0.2 list.

Full disclosure: I built it with an AI coding assistant and tested every release by hand on real Windows.

Tell me what it misses.

Take back the machines.

https://github.com/richknowles/RogueAgentChecker

91 Upvotes

11 comments sorted by

7

u/mufasis 5d ago

Looks great, will test this.

1

u/enfastened 4d ago

Thanks! If anything looks off on your machines, please open an issue.

4

u/digsmann 5d ago

I have bookmarked your tool, mate.i will be testing and drop you feedback.seems interesting tool best wishes..

3

u/enfastened 4d ago

Thanks mate! v0.1.2 is out today — first bug report came in from Italy, fixed. Let me know what you find.

0

u/digsmann 4d ago

It was not from me, mate.. thanks for Italian

2

u/enfastened 4d ago

No worries, the Italy one came in through GitHub.

2

u/MaccabeeY 4d ago

I built something too! Pretty nifty

1

u/enfastened 4d ago

Nice! What did you build?

2

u/MaccabeeY 2d ago

An automated Miracast projector utility, addressing the annoyances, side effect(s), and "problems that come with and arise from enacting and using Win10/11 Miracast projection. Util. seems to be & work pretty solidly too.

2

u/Lewad42 4d ago

Thanks, I’ll have a look at this. We were discussing this exact issue lately