Skip to content
PluginStats

@zeroleaks/shield weekly downloads statistics

By zeroleaks · npm · AI SDKs

Runtime security for LLM apps and agents: prompt injection detection for user input and tool results, and leak, credential, PII, and exfiltration checks on model output

View on npm Fresh · Dec 6, 2026

@zeroleaks/shield has 5,435 recorded weekly downloads on npm, an increase of 619% over the past 30 days, ranking #1492 of 3,247 tracked listings.

Weekly downloads
5,435
Official API · Dec 5, 2026
7-day growth
+9.4%
+469 weekly downloads
30-day growth
+619%
+4.7K weekly downloads
90-day growth
+77543%
+5.4K weekly downloads
Rank
#1492
▲ 5 in 7 days

About @zeroleaks/shield

@zeroleaks/shield

Prompt injection and jailbreak detection for agents. await detect(text) checks user messages, retrieved documents, and tool results with the hosted Shield API. Provider wrappers apply the check before a model call and check its output for secrets, personal data, and prompt leaks.

Built and maintained by ZeroLeaks. See the migration guide when upgrading from synchronous detect().

Install

bun add @zeroleaks/shield
# or: npm install @zeroleaks/shield

The hosted client uses fetch and supports Node.js 18+, Bun, Deno, Cloudflare Workers, and browsers. Keep dashboard API keys in your server or Worker environment. Provider SDKs and local transformer inference are optional peer dependencies.

For optional local model inference, use a current security-patched Node.js 22 release (22.23.3 or later) or Bun 1.4.2 or later. The local model installation guide pins Transformers 3.8.1 and shows the consumer application override for Sharp 0.35.4, which includes fixes absent from Transformers' default Sharp 0.34.x dependency. The default SDK install does not include either package.

Quick start

Create a zl_live_ key in the ZeroLeaks dashboard. All hosted models require a key, including the free model. Set ZEROLEAKS_API_KEY on your server, or pass apiKey explicitly:

import { detect } from "@zeroleaks/shield";

const result = await detect(untrustedText, {
  apiKey: process.env.ZEROLEAKS_API_KEY,
});

if (result.detected) {
  throw new Error("The input was blocked.");
}

detected and flagged carry the same verdict. score is the effective binary score; shield.model_score is the model's raw score and shield.rules says whether a rule also flagged the text. The single prompt_injection category includes jailbreaks. It does not provide a separate jailbreak probability.

ModelAccess
shield (default)Free, with a dashboard key and research consent
shield-basePaid
shield-largePaid
shield-tieredPaid

Choose a model with detect(text, { model: "shield-large" }). Free access requires the dashboard research consent flow. Paid requests are excluded from research retention, including when a paid account selects shield.

Protect a model call

Reuse a hosted detector and pass its options to a provider wrapper. The wrapper blocks flagged user messages and tool results before calling the model:

import OpenAI from "openai";
import { createHostedDetector } from "@zeroleaks/shield";
import { shieldOpenAI } from "@zeroleaks/shield/openai";

const shield = createHostedDetector({ model: "shield" });
const client = shieldOpenAI(new OpenAI(), {
  detect: shield.options(),
  canary: true,
});

const response = await client.chat.completions.create({
  model: "your-model",
  messages: [
    { role: "system", content: "You are a support agent for Acme." },
    { role: "user", content: userInput },
  ],
});

For Vercel AI SDK:

import { generateText, wrapLanguageModel } from "ai";
import { openai } from "@ai-sdk/openai";
import { createHostedDetector } from "@zeroleaks/shield";
import { shieldLanguageModelMiddleware } from "@zeroleaks/shield/ai-sdk";

const shield = createHostedDetector();
const model = wrapLanguageModel({
  model: openai("your-model"),
  middleware: shieldLanguageModelMiddleware({ detect: shield.options() }),
});
const result = await generateText({ model, prompt: userInput });

Pass detect: shield.options() to the other wrappers in the same way. Omitting it preserves the wrappers' existing local detection behavior. The AI SDK middleware waits for detection before the model call. The legacy shieldMiddleware() helper provides await wrapParamsAsync(params) for hosted detection; its synchronous wrapParams() accepts only local synchronous checks.

AI SDK inspection tool

Shield 2.1.2 adds an inspection tool for AI SDK 5, 6, and 7:

import { shieldCheck } from "@zeroleaks/shield/ai-sdk/tools";

const check = shieldCheck(); // Local; no network or API key.
const result = await check.execute(
  { text: "The document's complete original text.", source: "document" },
  {}
);
if (result.detected) {
  throw new Error("The document was blocked.");
}

Use tools: { shieldCheck: shieldCheck() } with generateText or streamText for model-invoked inspection. Pair it with shieldLanguageModelMiddleware for enforced checks before model calls: the model chooses whether to call the tool and which text to submit. A negative detection is not a guarantee of safety or permission to act. Tool execution errors become AI SDK tool-error parts; application code must decide whether the agent can continue.

Configure local checks with shieldCheck({ detect: { sensitivity: "strict" } }), or opt into hosted checks with shieldCheck({ hosted: { apiKey, model: "shield" } }). Hosted checks always require complete coverage and throw on missing or truncated coverage. Local checks reject oversized input instead of silently truncating it. The executor accepts { abortSignal } as its second argument.

The new subpath requires ai 5 or later; AI SDK 7 requires Node.js 22+. Install ai and its zod peer alongside Shield. Other entry points still work without ai installed, and middleware retains SDK 4 support. See the complete AI SDK tool guide for a runnable model example, result fields, access requirements, and limitations.

Request options…

Description from the npm listing.

  • llm
  • security
  • prompt-injection
  • ai-safety
  • openai
  • anthropic
  • gemini
  • mistral
  • langchain
  • jailbreak
  • ai-agents
  • agent-security
  • mcp
  • openai-agents
  • tool-poisoning
  • guardrails
  • dlp
  • secrets-detection
  • pii
  • canary

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@zeroleaks/shield weekly downloads on npm, last 90 days: 5,435 weekly downloads as of Dec 5, 2026, +77543% over 90 days.@zeroleaks/shieldWeekly downloads on npm · Last 90 days5,435downloads / week+77543% over 90 days01K2K3K4K5K6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@zeroleaks/shield weekly downloads on npm, last 90 days: 5,435 weekly downloads as of Dec 5, 2026, +77543% over 90 days.

7/30/90-day growth

@zeroleaks/shield weekly downloads growth on npm: +9.4% over 7 days, +619% over 30 days, +77543% over 90 days.@zeroleaks/shieldWeekly downloads growth on npm5,435downloads / week now7-day growth+469 weekly downloads+9.4%30-day growth+4,679 weekly downloads+619%90-day growth+5,428 weekly downloads+77543%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@zeroleaks/shield weekly downloads growth on npm: +9.4% over 7 days, +619% over 30 days, +77543% over 90 days.

Ranking history

@zeroleaks/shield npm ranking history: currently #1492 (by weekly downloads).@zeroleaks/shieldnpm ranking · by weekly downloads · Last 90 days#1492current rank#1200#1400#1600#1800#2000#2200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 19, 2026 – Dec 6, 2026 · 43 observations · Updated Dec 5, 2026pluginstats.com
@zeroleaks/shield npm ranking history: currently #1492 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 75, #12 (overall #1,492)
All npm: every listing in weekly downloads order

Listing placement

AI SDKs378 listings · 19 pages · page 6, #8 (overall #108)
AI SDKs: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (157)
Recent weekly downloads observations for @zeroleaks/shield
Date (UTC)Weekly downloadsChange vs. previous
5,435+685
4,750+574
4,176+606
3,570+59
3,511-84
3,595-1.2K
4,789-177
4,966+214
4,752+229
4,523+214
4,309+870
3,439+721
2,718+1.7K
1,042—

Similar npm AI SDKs plugins

All 20 @zeroleaks/shield alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@zeroleaks/shield. First seen Oct 19, 2026; last successful collection Dec 6, 2026. See the methodology.