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

@tailrace/core

v0.2.2

Published

Agent data governance core: detection, policy engine, vault, audit. Zero runtime deps; runs on Node, Cloudflare Workers, and Vercel Edge.

Downloads

976

Readme

@tailrace/core

Agent data governance for TypeScript. In-process detection of secrets and PII, reversible workflow-scoped tokenization, and per-agent data-flow policy enforced at the model, tool, and MCP boundaries. No proxy, no sidecar, no network call in the request hot path.

This package is the foundation of Tailrace. Every @tailrace/* integration depends on it.

Packages

| Package | npm | What it is | | ----------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | @tailrace/core | npm | Detection, policy engine, vault, audit. Zero runtime deps; runs on Node, Cloudflare Workers, and Vercel Edge. | | @tailrace/adapter | npm | Shared integration helpers: wrapToolExecute, runGoverned. No host peers. | | @tailrace/ai-sdk | npm | Vercel AI SDK middleware + tool wrapper. | | @tailrace/cloudflare-agents | npm | Cloudflare Agents / AIChatAgent compose entry (identity, vault, AI SDK wraps). | | @tailrace/openai-agents | npm | OpenAI Agents SDK function tool wrappers. | | @tailrace/mcp | npm | MCP client transport wrapper. | | @tailrace/hono | npm | Hono middleware (OpenAI-compatible passthrough). | | @tailrace/cli | npm | tailrace binary: init, scan, install-hooks, hook. | | @tailrace/recognizer-ner | npm | Optional Tier 1 ONNX NER recognizer (Node only). |

All @tailrace packages on npm

Quickstart

pnpm add @tailrace/core @tailrace/ai-sdk ai @ai-sdk/openai
import { createTailrace } from "@tailrace/core";
import { withAiSdk } from "@tailrace/ai-sdk";
import { openai } from "@ai-sdk/openai";

const tailrace = withAiSdk(createTailrace()); // zero config: secrets blocked, common PII tokenized
const model = tailrace.model(openai("gpt-4o"));
// Use `model` anywhere you'd use the AI SDK model - sensitive values never leave the process.

Also see @tailrace/mcp (withMcp / wrapTransport) and @tailrace/hono (tailraceHono) for MCP transports and OpenAI-compatible gateways.

Documentation

| Resource | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | | Quickstart | Block a secret and tokenize email in five minutes | | Boundaries · Policy resolution · Detection tiers · Tokenization & the vault | The mental model, with diagrams | | Ship an agent | Clone, verify, deploy: model, tools, egress restore | | Govern MCP tool calls | Transport wrap + JSON-RPC block | | Block secrets in Claude Code | Hooks, scan, install-hooks | | Next.js · MCP · Hono · Claude Code | Integration pages |

Full docs: tailrace.dev

Install

pnpm add @tailrace/core

Zero runtime dependencies. Runs on Node 20+, Cloudflare Workers, and Vercel Edge (WebCrypto only, no node: imports).

Public API

createTailrace, definePolicy, defineRecognizer, definePatternRecognizer, memoryVault, kvVault, staticPolicy, the error classes (TailraceError and subclasses), and all public types. Everything else is internal.

import { createTailrace, definePatternRecognizer, definePolicy } from "@tailrace/core";

const employeeId = definePatternRecognizer({
  id: "employee-id",
  entity: "employee_id",
  tier: 0,
  patterns: [{ source: String.raw`\bEMP-\d{5}\b`, confidence: 1 }],
});

const tailrace = createTailrace({
  recognizers: [employeeId],
  policy: definePolicy({
    entities: { employee_id: "tokenize" },
    defaults: { action: "allow" },
  }),
});

const { output, decisions } = await tailrace.check("Assign EMP-01234", {
  boundary: { kind: "model", provider: "openai/gpt-4o" },
  identity: { agent: "default" },
  workflowId: "session-1",
});

Zero required config: createTailrace() without custom recognizers enforces the default policy (secret classes → block, common structured PII → tokenize). Pass definePolicy(...) / staticPolicy(...) to customize.

Integrations (@tailrace/ai-sdk, @tailrace/mcp, @tailrace/hono, @tailrace/cli) construct a Boundary / Identity, call check / restore, and translate PolicyViolationError into the host failure mode. They contain zero policy logic.