Superagent SDK Make your AI apps safe. Website · Docs · Discord · HuggingFace An open-source SDK for AI agent safety. Block prompt injections, redact PII and secrets, scan repositories for threats, and run red team scenarios against your agent. Features Guard Detect and block prompt injections, malicious instructions, and unsafe tool calls at runtime. TypeScript: Python: Redact Remove PII, PHI, and secrets from text…
Superagent protects your AI applications against prompt injections, data leaks, and harmful outputs. Embed safety directly into your app and prove compliance to your customers.
An open-source SDK for AI agent safety. Block prompt injections, redact PII and secrets, scan repositories for threats, and run red team scenarios against your agent.
Features
Guard
Detect and block prompt injections, malicious instructions, and unsafe tool calls at runtime.
TypeScript:
import { createClient } from "safety-agent";
const client = createClient();
const result = await client.guard({
input: userMessage
});
if (result.classification === "block") {
console.log("Blocked:", result.violation_types);
}
Python:
from safety_agent import create_client
client = create_client()
result = await client.guard(input=user_message)
if result.classification == "block":
print("Blocked:", result.violation_types)
Redact
Remove PII, PHI, and secrets from text automatically.
TypeScript:
const result = await client.redact({
input: "My email is [email protected] and SSN is 123-45-6789",
model: "openai/gpt-4o-mini"
});
console.log(result.redacted);
// "My email is <EMAIL_REDACTED> and SSN is <SSN_REDACTED>"
Python:
result = await client.redact(
input="My email is [email protected] and SSN is 123-45-6789",
model="openai/gpt-4o-mini"
)
print(result.redacted)
# "My email is <EMAIL_REDACTED> and SSN is <SSN_REDACTED>"
Scan
Analyze repositories for AI agent-targeted attacks such as repo poisoning and malicious instructions.
评论