guardrails-notify
Pi extension that sends cmux, terminal, and native notifications when guardrails waits for approval.
Package details
Install guardrails-notify from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:guardrails-notify- Package
guardrails-notify- Version
0.1.0- Published
- Jun 4, 2026
- Downloads
- 38/mo · 9/wk
- Author
- jpballares
- License
- MIT
- Types
- extension
- Size
- 9.2 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/guardrails-notify.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
guardrails-notify
A Pi package that displays notifications when the Guardrails extension is waiting for user approval.
What it does
This extension listens on Pi's shared extension event bus for Guardrails approval events:
guardrails:action:promptedguardrails:action:blocked
When approval is requested, it:
- rings the terminal bell when stdout is a TTY,
- shows a Pi UI warning notification,
- sets a temporary Pi status message,
- sends one external notification through the first available backend.
External notification backend order in auto mode:
cmux notify- terminal OSC notification escapes for supported terminals such as Ghostty, iTerm2, WezTerm, and foot
- native OS fallback:
osascripton macOS ornotify-sendon Linux
The status message is cleared when Guardrails emits a blocked event or when a tool result is received.
Requirements
- Pi coding agent
- Node.js 20 or newer
- Optional:
cmux, a terminal with OSC notification support,osascript, ornotify-send
The extension searches for cmux in this order:
CMUX_BINenvironment variablecmuxonPATH~/Applications/cmux.app/Contents/Resources/bin/cmux/Applications/cmux.app/Contents/Resources/bin/cmux
Notification backend selection
By default, the extension uses GUARDRAILS_NOTIFY_BACKEND=auto.
Supported values:
auto- use the first available external backendcmux- use onlycmux notifyterminal- use only terminal OSC notification escapesnative- use onlyosascripton macOS ornotify-sendon Linuxoff,none,false, or0- disable external notifications
Example:
GUARDRAILS_NOTIFY_BACKEND=terminal pi
Install
From npm:
pi install npm:guardrails-notify@0.1.0
From a local checkout:
pi install /absolute/path/to/guardrails-notify
For one-off testing without installing:
pi -e /absolute/path/to/guardrails-notify
Publish
npm pack --dry-run
npm publish
If the npm package name is already taken, rename the package in package.json or publish under a scope:
{
"name": "@your-scope/guardrails-notify"
}
Then publish with:
npm publish --access public
Notes
This package only reacts to events. It does not implement Guardrails approval logic by itself. Another extension must emit the Guardrails events listed above.