# Superagent SDK > Open-source SDK for AI agent safety that blocks prompt injections, redacts PII, and scans repositories for threats. Superagent SDK is an open-source safety library for AI applications that provides runtime protection against prompt injections, data leaks, and harmful outputs. The SDK offers four core methods that teams embed directly into their applications to guard inputs, redact sensitive data, scan for security threats, and run red team scenarios. - **Guard** - Detects and blocks prompt injections, malicious instructions, and unsafe tool calls at runtime with 98% threat detection accuracy using a free built-in model that requires no API keys - **Redact** - Automatically removes PII, PHI, and secrets from text including emails, SSNs, phone numbers, and credit card numbers while keeping application workflows intact - **Scan** - Analyzes repositories for AI agent-targeted attacks such as repo poisoning, backdoors, and malicious instructions embedded in code - **Test** - Runs red team scenarios against production agents to discover vulnerabilities before attackers do (coming soon) - **Multi-Provider Support** - Works with any LLM provider including OpenAI, Anthropic, Google, Bedrock, Groq, and Fireworks AI - **Open-Weight Models** - Run guard models on your own infrastructure with 50-100ms latency using models from 0.6B to 4B parameters available on HuggingFace - **File Analysis** - Analyze PDFs, images, and URLs directly with parallel processing for low latency on large inputs - **IDE Integrations** - Includes examples for Cursor IDE hooks and Claude Code hooks to guard prompts in real time Install via npm with `npm install safety-agent` or Python with `pip install safety-agent`. The default guard model requires no API keys to get started. The SDK is MIT licensed with 6,400+ GitHub stars and an active community on Discord. ## Features - Prompt injection detection and blocking - PII and PHI redaction - Secret and credential removal - Repository security scanning - Red team testing scenarios - Multi-provider LLM support - Open-weight guard models - PDF and image analysis - URL content scanning - Custom classification prompts - TypeScript SDK - Python SDK - Command-line interface - MCP server integration - Cursor IDE integration - Claude Code hooks - Parallel processing for low latency - No API keys required for guard - Self-hosted model deployment - GGUF models for CPU inference ## Integrations OpenAI, Anthropic, Google AI, AWS Bedrock, Groq, Fireworks AI, Cursor IDE, Claude Code, Claude Desktop, HuggingFace, llama.cpp ## Platforms DEVELOPER_SDK, API ## Pricing Open Source ## Links - Website: https://www.superagent.sh/open-source/superagent-sdk - Documentation: https://docs.superagent.sh/sdk - Repository: https://github.com/superagent-ai/superagent - EveryDev.ai: https://www.everydev.ai/tools/superagent-sdk