@zenspc/pi-safety

Confirm destructive bash and git actions before Pi runs them

Packages

Package details

extension

Install @zenspc/pi-safety from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@zenspc/pi-safety
Package
@zenspc/pi-safety
Version
0.1.1
Published
Jul 18, 2026
Downloads
55/mo · 55/wk
Author
ph03nix
License
MIT
Types
extension
Size
14.7 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/safety-guard.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@zenspc/pi-safety

Confirm destructive bash and git actions before Pi runs them.

Install

pi install npm:@zenspc/pi-safety

Local development:

pi -e ./packages/pi-safety
pi install ./packages/pi-safety

What it does

Intercepts risky tool calls and asks for confirmation before allowing them.

Examples of guarded actions:

  • rm -rf and other destructive shell deletes
  • force push / hard reset / commit amend style git history rewrites
  • other high-risk bash patterns classified by the extension

Commands / config

Config file:

~/.pi/agent/safety-guard.json

Default:

{
  "enabled": true
}

Limitations

This extension is a best-effort confirmation layer, not a security product claim.

  • It confirms a fixed set of destructive or risky patterns. That set is not exhaustive.
  • Novel or rephrased commands can slip through the heuristics.
  • It can be disabled by the user via ~/.pi/agent/safety-guard.json ("enabled": false).
  • It does not isolate the filesystem, network, or credentials.
  • It does not replace code review, backups, branch protection, or OS-level isolation.
  • Like all Pi extensions, it runs with full local permissions.

Avoid treating it as "makes Pi safe" or as a complete deny-list.

Source

Extension entry:

extensions/safety-guard.ts