LLM Security for TypeScript — Prompt Injection Detection, PII Protection, Cost Control, Audit Trail
AI Shield is a security library, not an MCP server. The 15 'tools' are TypeScript SDK functions exported from npm packages (ai-shield-core, ai-shield-anthropic, etc.), not MCP tool definitions. No MCP server implementation is visible in the source. Tool names lack action verbs (e.g., 'scan' is acceptable, but 'createShieldSingleton', 'shieldModel', 'createShield' are overloaded and repeated 4 times across different packages). Descriptions are present but generic (50-150 chars), lacking LLM-optimized guidance on WHEN to use each variant. Input schemas show only high-level object types ('config', 'client', 'params') without nested property definitions, type constraints, or enums. No output schemas documented. Error handling and recovery guidance absent. The library is well-engineered for its domain (LLM security) but does not expose itself as an MCP server with properly structured tool definitions.
Tool Policy Scanner — MCP Tool Permission Enforcement. Validates tool permissions, rate limits, and manifest integrity.
Create message with Shield protection (non-streaming). Scans input before and output after the API call.
Create streaming message with Shield protection. Returns a ShieldedAnthropicStream.
Wrap a GoogleGenAI client (new unified Google Gen AI SDK) with AI Shield protection.
Wrap an Anthropic client with AI Shield protection. Returns a ShieldedAnthropic instance.
Wrap a Gemini GenerativeModel with AI Shield protection. Returns a ShieldedGemini instance.
Wrap an OpenAI client with AI Shield protection. Returns a ShieldedOpenAI instance.
Create a cached shield function that reuses a single AIShield instance. Much better performance than shield() for repeated calls.
Not an MCP server. AI Shield is a TypeScript SDK library (npm packages), not an MCP server implementation. No MCP protocol transport, tool registration, or server scaffolding detected.
Overloaded tool names. 'createShield' appears 4 times (Anthropic, Gemini, GoogleGenAI, OpenAI) with identical names but different implementations. LLMs cannot distinguish between them. Should be 'createShield_anthropic', 'createShield_gemini', etc.
Input schemas lack nested property definitions. All 15 tools show only top-level object types (e.g., 'config': {type: 'object'}) without documenting required fields, nested types, or constraints. Schema score capped at 25-35 per tool.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 32 | <=2025-11-25 | v2 |
Generate content with Shield protection (non-streaming). Scans input before and output after the API call.
Generate content stream with Shield protection. Returns a ShieldedGeminiStream.
Load an ONNX-runtime-backed prompt-injection classifier. Pairs with ai-shield-core for ML-augmented detection.
Pin a server's tool manifest. Creates a ToolManifestPin with hash and known tools list.
Quick scan — one line, maximum protection. Creates a new AIShield instance on every call. For production use with multiple calls, create a single AIShield instance and reuse it.
Wrap an AI SDK language model with AI Shield protection. Shorthand for wrapLanguageModel with aiShieldMiddleware.
Verify a manifest against a pin. Detects added and removed tools.
No output schemas documented. Tools return complex objects (ShieldedAnthropic, ShieldedGemini, etc.) but no schema describes what fields agents should expect. Agents cannot plan downstream calls.
Descriptions lack LLM-optimized guidance. Most descriptions (40-150 chars) state WHAT the tool does but not WHEN to use it or how it differs from similar tools. E.g., 'createShieldSingleton' vs 'scan', when should an agent choose one over the other?