Superagent SDK
Open-source SDK for AI agent safety that blocks prompt injections, redacts PII, and scans repositories for threats.
At a Glance
Pricing
MIT licensed SDK with free built-in guard model
Engagement
Available On
About Superagent SDK
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.

Community Discussions
Be the first to start a conversation about Superagent SDK
Share your experience with Superagent SDK, ask questions, or help others learn from your insights.
Pricing
Free Plan Available
MIT licensed SDK with free built-in guard model
- Guard method with default model (no API key required)
- Redact method (requires LLM provider)
- Scan method for repository analysis
- TypeScript and Python SDKs
- CLI tool
Capabilities
Key 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