This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| mcp_audit.py — quick risk scan of the MCP servers configured for your AI agents. | |
| Third-party MCP servers are unvetted code-execution surface: they run on your | |
| machine, with your environment, the moment your agent starts. This script | |
| discovers MCP server definitions across common agent config locations and flags | |
| risky patterns: | |
| * HIGH pipe-to-shell / remote-fetch install commands |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Claude Code PreToolUse hook — block obviously destructive shell commands. | |
| A minimal, dependency-free guardrail you can drop into any Claude Code project. | |
| It inspects every Bash command BEFORE it runs and blocks a small set of | |
| high-blast-radius patterns (recursive root deletes, disk overwrites, fork bombs, | |
| pipe-to-shell installs, force-push to main, etc.). | |
| This is deliberately tiny — a starting point, not a security product. It does |