Step-by-step answer
Stretch 45 min7 stepsBlock outbound actions with a hook
A PreToolUse hook that denies web tools, network commands, unlisted MCP tools and writes outside out/, logs every decision to logs/tool-audit.jsonl, and fails closed, with the rules in a pure function you can exercise without Claude Code.
Back to the exercise