Shield SDK
Installation
Install @zeroleaks/shield via npm or bun. Optional peer dependencies for provider wrappers.
Installation
Install @zeroleaks/shield with your preferred package manager:
npm install @zeroleaks/shieldbun add @zeroleaks/shieldPeer Dependencies
Provider wrappers require the corresponding LLM client. All are optional; install only what you use:
| Provider | Peer Dependency |
|---|---|
| OpenAI | openai |
| Anthropic | @anthropic-ai/sdk |
| Groq | groq-sdk |
| Vercel AI SDK | ai |
Example: if you use the OpenAI wrapper only:
npm install @zeroleaks/shield openaiTypeScript
TypeScript support is included. No separate @types package is required. Types are exported from the main entry point and subpaths:
import { harden, detect, sanitize } from "@zeroleaks/shield";
import type { HardenOptions, DetectResult, SanitizeResult } from "@zeroleaks/shield";
// Provider-specific types
import { shieldOpenAI } from "@zeroleaks/shield/openai";
import type { ShieldOpenAIOptions } from "@zeroleaks/shield/openai";Import Paths
- Core API �
@zeroleaks/shield(harden, detect, sanitize, errors) - OpenAI �
@zeroleaks/shield/openai - Anthropic �
@zeroleaks/shield/anthropic - Groq �
@zeroleaks/shield/groq - Vercel AI SDK �
@zeroleaks/shield/ai-sdk