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

@weaveintel/guardrails

v0.1.1

Published

Guardrail pipeline — evaluation chain, risk classification, cost guard, governance

Downloads

485

Readme

@weaveintel/guardrails

A safety pipeline that inspects what goes into and comes out of your LLM, and decides whether to allow, warn, or block it.

Why it exists

An LLM will happily answer a question it should refuse, leak a phone number that should have been hidden, or follow a malicious instruction that a user smuggled into pasted text. You could scatter if-checks through your app, but then every safety rule lives in a different place and nobody can say which ones actually ran. Think of this package as the security checkpoint at an airport: every request walks through the same line of scanners, each scanner reports what it found, and one clear decision comes out the other end — pass, flag, or stop.

When to reach for it

Reach for it when you send user input to a model, or model output to a user, and you need consistent, auditable safety checks in between — content moderation, prompt-injection defense, PII redaction, or risk-based escalation. If all you need is per-tenant LLM spend limits with no content rules, use @weaveintel/cost-governor instead; if you need retries and circuit breakers around flaky calls, that's @weaveintel/resilience.

How to use it

import { createGuardrailPipeline, hasDeny, getDenyReason } from '@weaveintel/guardrails';

const pipeline = createGuardrailPipeline();

const result = await pipeline.evaluate({
  text: userMessage,
  stage: 'input',
});

if (hasDeny(result)) {
  throw new Error(`Blocked: ${getDenyReason(result)}`);
}
// safe to continue to the model

What's in the box

Main entry (@weaveintel/guardrails):

  • createGuardrailPipeline / DefaultGuardrailPipeline — run the full evaluation chain; hasDeny, hasWarning, getDenyReason read the outcome.
  • createRiskClassifier, createConfidenceGate, createActionGate — classify risk and gate low-confidence or high-risk actions.
  • createCostGuard — stop a run that has spent past its budget.
  • Model-graded evaluator factories: createModerationEvaluator, createInjectionEvaluator, createLlmJudgeEvaluator, createSemanticGroundingEvaluator, createSycophancyEvaluator.
  • createGuardrailResolver (per-tenant config), createStreamingGuardrail (screen output as it streams).

Subpath exports:

  • @weaveintel/guardrails/redaction — detect and redact PII before it reaches a model or a log.
  • @weaveintel/guardrails/compliance — consent, deletion, legal-hold, data residency, and retention primitives.
  • @weaveintel/guardrails/spotlightingspotlight, fenceUntrusted, spotlightPreamble: fence untrusted text so the model can't mistake it for instructions (OWASP LLM01).

License

MIT.