pi-reply-guard

Checks each final reply against a list of skills with a classifier model and asks the agent to rewrite failures.

Packages

Package details

extension

Install pi-reply-guard from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-reply-guard
Package
pi-reply-guard
Version
0.2.1
Published
Oct 8, 2026
Downloads
not available
Author
amalavet
License
MIT
Types
extension
Size
24.3 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/reply-guard.ts"
  ]
}

Security note

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

README

pi-reply-guard

Checks each agent reply against a list of skills. A classifier model (Jev by default) determines if the reply adheres to the skill on a scale of 0-1. If a reply does not adhere to the skill, the agent is prompted to edit their reply to adhere to the skill.

https://github.com/user-attachments/assets/c8c65cf3-3030-44af-88e1-03f897d86447

Install

pi install npm:pi-reply-guard

Or install from GitHub:

pi install git:github.com/amalavet/pi-reply-guard

Configure

Run /reply-guard in Pi to open the settings menu. Select a setting to change it, or choose “Edit JSON” to edit the full configuration. Each change saves to ~/.pi/agent/reply-guard.json and applies to the next reply:

{
  "skills": {
    "i-have-adhd": 0.3,
    "ste-plain-writing": 0.5
  },
  "model": "openrouter/typesafe/jev-1.13",
  "maxRewrites": 2,
  "inject": false,
  "preload": true,
  "debug": false,
  "showVerdicts": true
}

Install the skills separately. Names must match installed skills. No skills are bundled or enabled by default. Missing or unreadable skills are skipped.

Key Default Meaning
skills {} Installed skill name that replies must adhere to, with a threshold (0-1) to pass. A reply passes when the probability that it meets the skill is at or above the threshold
model openrouter/typesafe/jev-1.13 Classifier model, provider/id
maxRewrites 2 How many time the agent will attempt to rewrite it's response to match the spec. When this is exceeded, the final reply will be given even if it does not pass the guard.
inject false Set to true to add the full text of the failed skills to each rewrite request.
preload true Adds the full text of the guarded skills to the context once, at the first prompt of each session.
debug false When this is enabled, you can view the raw requests to jev, the prompts to the agent, and the failed replies.
showVerdicts true By default the guard will show a block containing a short result of the reply guard. You can set this to hide that block.