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

@kiranpg/pi-sentry

v0.1.1

Published

A Pi extension that blocks sensitive file reads and redacts secrets before they reach the model or session history.

Downloads

51

Readme

pi-sentry

CI npm version

pi-sentry is a pi extension that helps protect credentials and secrets.

By default, it redacts secrets from inputs, tool output, and session history. In strict mode, it also blocks risky file reads, searches, commands, and tool calls. You can turn it off when needed.

Overview

pi-sentry protects against:

  • Sensitive file reads: in strict mode, blocks access to files and directories like .env, .npmrc, .aws/credentials, .kube/config, .ssh/, .docker/config.json, private keys, Terraform state/vars, and service-account JSON files.
  • Sensitive shell commands: in strict mode, blocks commands that may expose secrets, such as cat .env, echo $OPENAI_API_KEY, scripts that echo secret env vars, rg token ~/.aws/credentials, printenv, gh auth token, and kubectl config view --raw.
  • Secrets in tool calls: in strict mode, blocks tool calls that contain secret-like values.
  • Sensitive path search: in strict mode, blocks grep searches that target sensitive paths or globs.
  • Secrets in tool output: redacts secrets from tool output, including stderr and error details.
  • Session history: redacts secrets from session text, tool-call arguments, and tool result details.

pi-sentry redacts common secret formats:

  • JSON: { "token": "..." }
  • YAML/env: AWS_SECRET_ACCESS_KEY=..., password: ...
  • snake_case and camelCase keys: db_password, dbPassword, stripeApiKey
  • provider tokens: OpenAI, Anthropic, OpenRouter, Google, GitHub, etc.
  • bearer tokens and JWTs
  • passwords in URLs, including database URLs
  • private key blocks, including env values like PRIVATE_KEY=...
  • session cookies, such as SESSION_COOKIE=...

Install

Install from npm:

pi install npm:@kiranpg/pi-sentry

Install from GitHub:

pi install git:https://github.com/kirang89/pi-sentry.git
# or pin a tag/commit
pi install git:https://github.com/kirang89/[email protected]

Try it without installing:

pi -e npm:@kiranpg/pi-sentry
# or
pi -e git:https://github.com/kirang89/pi-sentry.git

Reload an active Pi session with /reload after installing.

Usage

Use /sentry inside the agent to view or change the mode:

  • /sentry shows the current mode.
  • /sentry strict blocks risky actions and redacts secrets.
  • /sentry redact-only allows actions but redacts secrets. This is the default.
  • /sentry off disables pi-sentry.

Config

Create ~/.pi/agent/pi-sentry.json to add custom path rules:

{
  "allowPaths": [".env.local.example"],
  "blockPaths": ["private/**", "*.secret.json"]
}
  • allowPaths allows paths that pi-sentry would otherwise block.
  • blockPaths blocks paths that pi-sentry would otherwise allow.
  • User rules override built-in rules.
  • If a path matches both allowPaths and blockPaths, pi-sentry blocks it.
  • Plain filenames like .env match any path segment.
  • Glob patterns support *, **, and ?.

Run /reload after changing this file.

Development

npm install
npm run lint
npm run typecheck
npm test

Release

Releases are version-tagged. The release workflow validates that the pushed tag matches package.json:

git tag v0.1.0
git push origin v0.1.0

For the first npm publish, publish the scoped package locally with npm while logged in as the package owner:

npm publish --access public --provenance

After the package exists on npm, configure npm Trusted Publishing for .github/workflows/release.yml and remove token-based publishing from the workflow.