agentskit.js
Security

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.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page

Ask the docs
Ask anything about AgentsKit. Answers come from the docs corpus and cite their sources.