npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-provider-guard

v0.1.0

Published

A pi coding-agent extension that keeps pi off the metered anthropic provider and appends user-supplied harness policy prose to every turn.

Readme

pi-provider-guard

A pi extension that keeps pi off the metered anthropic provider and appends your own harness policy prose into every turn.

What it does

  • Captures a safe (non-metered) baseline model at session_start as the revert target of last resort.
  • On model_select, reverts an anthropic (metered) selection back to a safe model — the previous model if it was itself safe, otherwise the captured baseline — unless PI_ALLOW_METERED_ANTHROPIC is exactly 1 (any other value, 0 included, leaves the guardrail armed). The revert is attempted first and success is only reported once it lands; a failed revert, or a metered selection with no safe target at all, notifies at error level instead of leaving the user silently on the metered provider. No path ever calls setModel with an anthropic model.
  • On before_agent_start, appends your harness policy prose (loaded from config, see below) to the system prompt. With no configured prose the system prompt is returned unchanged.

Install

pi install npm:pi-provider-guard

Policy prose is user-supplied

This package ships no baked-in policy prose. The rules you want carried into every turn are read at runtime from your own config file:

~/.pi/agent/extensions/pi-provider-guard/config.json

with a prose field that is an array of strings:

{
  "prose": [
    "Your first earned rule.",
    "Your second earned rule."
  ]
}

Each string becomes a line under a fixed header (Harness policy — earned rules from operating this harness, not permission settings:) appended to the system prompt. A missing, unreadable, or malformed file — or a missing/non-array prose field — is treated as no prose: the system prompt is left untouched and turn start never fails.

Permission policy is separate

The metered-provider guardrail here is independent of pi's file/tool permission system. If you want to allow read/write/edit and deny *.env, ~/.ssh/*, etc., configure that with a permission-system extension (e.g. @gotgenes/pi-permission-system) and its own config — this package does not manage permissions.

Tests

node --test src/*.test.ts

The pure gate/prose logic (src/gate.ts, src/prose.ts) and the wired extension behavior (src/index.ts) are unit-tested with zero mocking against a fake pi.