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.
For the methodology behind them β threat modeling, when to apply each, team practices β see the Playbook's security pillar.
#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
Opt-in JSON Schema validation of tool inputs plus user-message limits, prompt-injection checks, and allowlists.