pi: prompt before dangerous commands 0 ▲ ¬ just serendipity 🍀 1 hour ago · Tech · hide · 0 comments ♠ Previously. Problem statement: my Pi extension blocked dangerous shell commands outright, even when I had already preserved the state they could destroy. The guard parses every bash tool call with tree-sitter, catching commands such as rm -rf, terraform destroy, and destructive Git operations. Today it did exactly what I had asked: % git -C "$(brew --repo thiagowfx/pancake)" reset --hard origin/master git reset --hard is blocked - discards changes irreversibly Blocking remains the right default, but an interactive session can ask me. Pi extensions can intercept the tool_call event and open a confirmation dialog through ctx.ui. The change in dangerous-command-guard/guard.ts: - pi.on("tool_call", async (event) => { + pi.on("tool_call", async (event, ctx) => { if (event.toolName !== "bash") return; const command = event.input.command; if (typeof command !== "string") return; const blocked = await findBlockedCommand(command); - if (blocked) return { block: true, reason: blocked.reason… No comments yet. Log in to reply on the Fediverse. Comments will appear here.