r/PowerShell • u/enfastened • 17h 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;
-RmmModereturns 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\reportTested 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.