destructive-confirm
v0.1.0
Published
A safety extension for Pi that requires confirmation before destructive tool actions.
Maintainers
Readme
destructive-confirm
A project-local Pi safety extension that asks for confirmation before a destructive tool action executes.
Install
This directory is already in Pi's project-extension location:
.pi/extensions/destructive-confirm/index.tsTrust the project when Pi asks, then run /reload or restart Pi.
What requires confirmation
bash:rm,rmdir,unlink,find -delete,git clean, destructive Git reset/restore/branch deletion, overwrite redirection, truncation/shredding,dd of=,teewithout append, and in-placesed/perledits.powershell:Remove-Item,Clear-Content, destructive Git actions,Set-Content, and non-appendingOut-File.write: overwriting an existing path. Creating a new file is allowed.edit: exact replacements that shorten content.
The prompt identifies the detected risk and target/command. Approval applies to only that tool invocation. The extension also instructs the model not to ask for a prose confirmation first: the guard's approve/deny dialog is the one authoritative confirmation.
Safety behavior
When Pi has no interactive UI (print or JSON mode), detected destructive actions are denied. This is an extension-level guardrail, not an OS sandbox: it cannot reliably parse every shell language, catch every indirect script, or protect against malicious installed extensions.
Configuration
There is no configuration yet. Edit index.ts's BASH_RULES or powerShellRisk() to add organization-specific commands such as deployment, database, or cloud-destruction commands.
