token-phish-blocker

Always-on anti-hedging policy for the Pi coding agent — auto-fix instead of caveat, with a mandatory audit trail and a live status-line counter.

Packages

Package details

extension

Install token-phish-blocker from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:token-phish-blocker
Package
token-phish-blocker
Version
1.1.2
Published
Aug 12, 2026
Downloads
588/mo · 11/wk
Author
uxbychris
License
MIT
Types
extension
Size
1.3 MB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ],
  "image": "https://raw.githubusercontent.com/getdatasurge/token-phish-blocker/main/assets/preview.png"
}

Security note

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

README

Always-on anti-hedging policy for the Pi coding agent — auto-fix instead of caveat.

npm version pi.dev catalog MIT license CI

Install

pi install npm:token-phish-blocker

Or browse it on the pi.dev package catalog.

From git, if you're not using npm:

pi install git:github.com/getdatasurge/token-phish-blocker

Try it once without installing:

pi -e npm:token-phish-blocker

What it does

Agents love to hedge: "one caveat — I didn't handle the empty-array case," "just a heads up, I didn't wire up error logging." That's a fixable gap phrased as commentary instead of fixed.

Token Phish Blocker injects a 4-rule policy into the system prompt on every turn: stop hedging, fix trivial and blocking issues before calling the task done, stay inside the current task's blast radius, and log every such auto-fix through a mandatory tool call. The log call drives a live counter in the footer, so the policy being "on" is directly observable — not just asserted.

That's the whole thing. 30 seconds, no config, no runtime deps.

The four rules

Rule What it means
1. No hedging Banned caveat phrasing ("one thing I didn't do", "just a heads up", ...) — fix it instead of mentioning it.
2. Auto-implement Trivial fixes and fixes that block the task from actually working land before you say "done" — no permission-asking.
3. Stay in scope Auto-fixes are limited to the blast radius of the current task. Anything bigger still gets surfaced, plainly.
4. Log every auto-fix Every rule-2 fix calls token_phish_blocker_log with a one-line description — mandatory, and it's the audit trail.

Full text: docs/POLICY.md.

The audit trail

Every auto-fix appends a tab-separated line to ~/.pi/agent/token-phish-blocker.log:

ISO-timestamp<TAB>cwd<TAB>description

Example:

2026-08-12T03:14:07.221Z	/home/user/projects/api	added missing null check in parseConfig() that would have crashed on empty input

The status line

The moment a session starts, the footer shows the counter at zero — that's your proof the policy is injected and active:

🎣 TPB · 0 fixes

Each token_phish_blocker_log call ticks it up live, so by the end of a session you can see exactly how many caveats became fixes instead:

🎣 TPB · 3 fixes
Situation What you see
Fresh session 🎣 TPB · 0 fixes — policy injected, nothing logged yet
After auto-fixes 🎣 TPB · N fixes, updating the moment each fix lands
Headless (pi -p "...") No status line — the audit log still gets every entry
TPB_NO_STATUS=1 Counter hidden — policy and audit log keep working

Nothing to install or configure — the status-line helper ships inside the extension and registers itself on session start.

Customizing the policy

Copy docs/POLICY.md to ~/.pi/agent/token-phish-blocker-policy.md and edit it. The override file replaces the built-in policy verbatim. Delete it to fall back to the built-in policy.

FAQ

Does it work in omp? Yes — omp install npm:token-phish-blocker.

Does it phone home? No. Zero network calls, zero runtime dependencies. The only writes are to the local log file.

How do I turn it off? pi remove npm:token-phish-blocker, or disable it per-project via pi config.

How do I hide the status counter? Set TPB_NO_STATUS=1 in your environment. The policy injection and audit log keep working.


MIT © getdatasurge · issues