Stop AI agents from taking down your server
muster guard reads every shell command your coding agent is about to run and stops the ones that act on the whole machine.
An AI assistant was helping fix one app on a shared production server. It suggested pm2 kill. That stops the PM2 daemon — and with it every app it runs. Fifteen apps went down, most of them nothing to do with the task. Then a pm2 save wrote the empty process list over the one PM2 restores after a reboot.
Each command is a reasonable thing to type on a laptop running one app. On a shared server each one acts on everything. The narrow command — pm2 restart <name> — would have done the job.
Install
First the Muster CLI, which needs Node 20 or later and no administrator rights:
curl -fsSL https://muster.thebotss.com/cli.sh | shirm https://muster.thebotss.com/cli.ps1 | iexThen add the guard to your agent. It merges into your settings, keeps the original as a .bak, and is safe to run twice.
muster guard install --claudemuster guard install --cursorAdd --project to install for the current folder only. Check it is working — this should say DENY and exit with status 2:
muster guard check "pm2 kill"To take it out again, removing only its own entry:
muster guard uninstall --claudeWhat it refuses
These act on everything on the machine, or cannot be undone. The agent is told no, and given the narrower command to use instead. If it really is what you want, run it yourself in your own terminal.
| Command | Why |
|---|---|
pm2 kill | Stops the PM2 daemon and every app on it, not just yours. |
pm2 restart all | Restarts every app under PM2. The same goes for stop all, delete all and reload all. |
pm2 save --force | Can write an empty process list over the one PM2 restores at boot. |
pm2 resurrect | Replaces what is running with the last saved list, which may be stale or empty. |
fuser -k 3000/tcp | Kills whatever holds the port without saying what it is. |
kill $(lsof -t -i:3000) | The same thing, spelled differently. |
pkill -f node | Every Node process on the machine is somebody's app. |
kill -9 -1 | Signals every process the user can reach. |
sudo systemctl restart nginx | Every site on the box goes through it. Reload instead. |
docker system prune -af | Deletes other apps' stopped containers and images, and their data with --volumes. |
docker rm -f $(docker ps -aq) | Removes every container on the machine. |
rm -rf /var | Also /, ~, $HOME, /etc, /home, /opt, /srv, and --no-preserve-root anywhere. |
iptables -F | Deletes every firewall rule. So does ufw disable. |
psql -c "DROP DATABASE prod" | DROP DATABASE / SCHEMA / TABLE through psql or mysql -e. |
git push --force origin main | Rewrites shared history on main or master. |
terraform destroy | Deletes everything in the state. |
kubectl delete ns production | A namespace takes everything in it along. |
What it asks you about
These act on one named thing and lose something. They are often exactly right, so you decide.
| Command | Why |
|---|---|
pm2 save | Any app that is stopped right now stays stopped after the next reboot. Check pm2 ls first. |
pm2 delete api | One named app, but it will not come back by itself. |
git reset --hard | Throws away uncommitted work. |
rm -rf ./dist | Often exactly right. A person should still see it. |
sudo systemctl restart myapp | Your own service: fine, once someone has looked. |
reboot | Takes every app down until the machine is back. |
npm publish | Public, and cannot be quietly undone. |
How it reads a command
It parses the command the way a shell would, so it is not fooled in either direction. Wrapping a command does not hide it:
| Command | Why |
|---|---|
ssh ubuntu@prod 'pm2 kill && pm2 save' | The remote command is read too — that is how a command reaches a server. |
sudo bash -c 'pm2 restart all' | sudo, env, nohup, bash -c, sh -c, eval, $(...) and backticks are all read through. |
And mentioning a command is not running it:
| Command | Why |
|---|---|
pm2 restart api | Restarting your own app by name is the narrow version of all of the above. |
git commit -m "never run pm2 kill" | Text that mentions a command is not the command. |
grep -rn "rm -rf" docs/ | Searching for it is not running it. |
For agents: a read-only MCP server
muster mcp gives Claude Code, Cursor or any MCP client a way to ask Muster before acting: check_command (the guard, as a tool), and — with a Muster API token — list_apps, app_readiness and is_safe_to_deploy, which answers yes only when every check on the real server was verified, and “unknown” when any was not. None of its tools runs a command, writes a file or touches a server.
muster mcp install --claudemuster mcp install --cursorWhat it does not do
- It is a seatbelt, not a sandbox. It reads command text. A command assembled at run time, decoded from base64, or hidden inside a script file can get past it. It is built to stop the ordinary, well-meant command that takes a server down — the kind that actually happens.
- When it cannot read a command completely and the command mentions something dangerous, it asks you rather than letting it through.
- It sees what goes through the agent's shell tool (Bash and PowerShell in Claude Code, the terminal in Cursor). If the hook cannot run at all, your agent's own approval settings apply as before.
- It keeps no log of what it blocked. Commands can contain passwords, and a file of them would be a file of secrets.
- No account, no network: the check runs on your machine.
Part of Muster
The guard is the free part. Muster checks a deploy against the real server — the database is reachable, the environment is complete, migrations are applied, backups restore — and refuses to send traffic until every one of those holds.