Skip to content

shieldkitProduction guardrails for the Vercel AI SDK

Input/output safety, structured output repair, cost budgets, audit logging, and tool policies โ€” verified with 163 automated tests

shieldkit logo

New in v0.2.0 โ€‹

  • Evasion hardening โ€” normalizeGuardText() strips zero-width characters and folds Cyrillic homoglyphs before injection and keyword guards
  • Interactive demo โ€” npm run demo runs a 9-section tour with 31 automated checks and audit evidence (mock + optional Ollama)
  • Release automation โ€” tagging v* publishes to npm and creates a GitHub Release from CHANGELOG.md

Try it locally โ€‹

bash
git clone https://github.com/sakurablush/shieldkit.git
cd shieldkit && npm ci && npm run demo

Sections 1โ€“8 use mocks only; section 9 needs Ollama. Expect Demo summary โ€” 31/31 checks passed.

ts
import { generateText } from 'ai';
import { shield } from 'shieldkit';

const model = shield(yourModel, { mode: 'balanced' });

await generateText({
  model,
  prompt: 'Hello',
  providerOptions: { aiShield: { sessionId: 'user-123' } },
});