Security
Six primitives for production agents: PII redaction, injection detection, rate limiting, audit log, sandbox enforcement, and HITL approvals.
Agents that reach production face threats unit tests don't cover β sensitive data leaking into logs, user inputs that hijack the system prompt, runaway API costs, and tool calls that modify infrastructure. These primitives address each class of risk at the boundary closest to where it appears.
#Primitives
- PII redaction β
createPIIRedactor+DEFAULT_PII_RULES. Recipe. - Prompt injection detector β heuristics + pluggable model classifier. Recipe.
- Rate limiting β token-bucket by user / IP / key. Recipe.
- Signed audit log β hash-chain + HMAC. Recipe.
- Mandatory sandbox β allow / deny / require / validators across every tool. Recipe.
- Human-in-the-loop approvals β pause / resume / approve with persisted state. Recipe.
#Related
Explore nearby
- PeerPII redaction
Strip emails, phones, SSNs, and API keys from messages before they reach the model or get written to logs.
- PeerPrompt injection
Detect instruction-hijacking patterns in user input, tool results, and RAG chunks before they reach the model.
- PeerInput validation
Schema validation of tool inputs and user messages β zod, JSON Schema, prompt injection, length limits, and allowlists.