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

@techs/pi-decision

v0.2.2

Published

Tool guardrail for pi with Jev, OpenAI and OpenRouter Decisions providers

Readme

@techs/pi-decision

English | 简体中文

A Pi tool_call guardrail extension with Jev, OpenAI Decisions and OpenRouter judgment providers; Jev remains the default. Before each tool call, it assesses six risk dimensions: destructive, secretExposure, privacyExposure, externalSideEffect, privilegeEscalation, and scopeViolation. You can disable or customize built-in dimensions and add your own. The risk policy comes from the provider-neutral core; select PI_DECISION_PROVIDER=jev|openai|openrouter. The agent's main model still generates responses, and Pi's own permission rules continue to apply.

export AI_GATEWAY_API_KEY=your_gateway_key
pi install npm:@techs/pi-decision

The default shadow mode observes asynchronously without blocking tools. Configure credentials for Pi's main model separately. Judgments are written to $XDG_STATE_HOME/dsh-decision/pi-audit.jsonl, or ~/.local/state/dsh-decision/pi-audit.jsonl when XDG state is unset.

The OpenAI integration requires version 0.2.1 or newer. After pnpm install && pnpm run build:

export PI_DECISION_PROVIDER=openai
export OPENAI_API_KEY=your_openai_key
pi -e ./packages/pi-decision

OpenAI uses the native Decisions API. Jev's calibrated thresholds do not transfer to OpenAI; start in shadow and evaluate the new provider.

| Environment variable | Default | Purpose | | ------------------------------- | --------------------------- | --------------------------------------------------------------- | | PI_DECISION_PROVIDER | jev | Select jev or openai independently of the main model | | OPENAI_API_KEY | None | Required when provider is openai | | PI_DECISION_OPENAI_BASE_URL | https://api.openai.com/v1 | Versioned Decisions API root | | PI_DECISION_OPENAI_MODEL | gpt-6-luna | Decisions model | | PI_DECISION_OPENAI_TIMEOUT_MS | 8000 | Request and response-body timeout | | AI_GATEWAY_API_KEY | None | Vercel AI Gateway key; takes priority over JEV_API_KEY | | JEV_API_KEY | None | Fallback key; required for the direct backend | | PI_DECISION_JEV_BACKEND | vercel | vercel for Gateway; direct for api.typesafe.ai | | PI_DECISION_ENFORCEMENT | shadow | shadow observes; enforce applies judgments (experimental) | | PI_DECISION_TOOLS | All tools | Comma-separated exact tool names, such as bash,write | | PI_DECISION_ON_FAILURE | allow | Stance when a judgment request fails: allow, ask, or deny | | PI_DECISION_OUTBOUND | redact | Mask recognizable secret patterns; raw sends unchanged input | | PI_DECISION_RISKS | None | JSON custom risk dimensions, like dsh guardrail.customRisks | | PI_DECISION_AUDIT | on | Set to off to disable audit records | | PI_DECISION_AUDIT_PATH | XDG state path | Audit JSONL path |

OpenRouter Decisions

Set PI_DECISION_PROVIDER=openrouter, OPENROUTER_API_KEY, and an explicit PI_DECISION_OPENROUTER_MODEL such as baseten/elephant-1 (paid; check current catalog pricing). Optional PI_DECISION_OPENROUTER_BASE_URL defaults to https://openrouter.ai/api/alpha; PI_DECISION_OPENROUTER_TIMEOUT_MS defaults to 8000. No Jev or OpenAI key is read in this mode. For registry installation, use version 0.2.1 or newer; build first when loading from this checkout. See the adapter guide and free-model verification.