Skip to content

supply-guard.mjs

  • Event: PreToolUse Bash/PowerShell
  • Type: wall: blocks the action and says why (exits with code 2)
  • Escapes: SENZU_ALLOW_SUPPLY=1 (always with explicit approval, recorded in the devlog)

Supply-chain wall. On an install command (npm/pip/composer…) it checks the package NAMES (typosquatting, known-malware denylist) before they land; on git commit it scans what is staged (dependency manifests, skill/plugin files and .mcp.json) for install scripts with network/shell, prompt injection, exfiltration (reads secrets and opens the network), obfuscation (eval/base64/hex), hidden unicode characters and MCP servers that download and execute. BLOCKS the serious ones, WARNS about the rest. “Quoting is not doing”: it looks at what is executed, not quoted text, and also INSIDE a script the command runs (bash x.sh, python x.py…). Offline and deterministic (lists in core/hooks/data/). Cannot be turned off. Escape after verifying: SENZU_ALLOW_SUPPLY=1.

See the code of supply-guard.mjs on GitHub