01What it is
Agent security is least-privilege control of tools and secrets, plus an audit trail. HazelJS focuses on fail-closed authorization in the tool path — honest about what the open-source stack covers and what it does not.
02Problem it solves
- Agents with broad tool access can mutate money, data, or infra accidentally
- Secrets in env files leak into prompts and logs without a node-scoped store
- Sensitive ops need human gates that survive process restart
- Operators need explainable allow/deny decisions before an incident
03How you use it today
- Tool authorization (allow / deny / require-approval)
- Least privilege via explicit policies and Skillgate skill sets
- Secrets: hazel secret set/delete/has against hazeld EncryptedFileSecretStore
- Isolation: agents run in your Node process / local node — design isolation accordingly
- Audit trails: AgentRun timelines and CLI logs
- Sensitive operations: Gatekeeper + HITL approval queues
- Cross-agent calls: still go through tool authorization
- Inspect policies: hazel gatekeeper validate | simulate | explain
04Where it sits in the stack
Agent security complements app-level HTTP controls in the security guide. Content/PII filters live in @hazeljs/guardrails when you opt in. Governance overview: AI agent governance.
05Boundaries
- No claim of prompt-injection immunity
- Not a hosted compliance or pentest product
- Process isolation is your deployment concern — agents share the Node process by default
06FAQ
- Where do secrets live?
- Local hazeld EncryptedFileSecretStore via hazel secret set/delete/has — not a cloud vault by default.
- How do I test a policy safely?
- hazel gatekeeper validate | simulate | explain inspects decisions without executing tools.
- Related article?
- How to secure AI agent tool calls.
07Gatekeeper policy sketch
typescript
import { AgentGatekeeper, fromFunction } from '@hazeljs/agent-gatekeeper';
const gatekeeper = new AgentGatekeeper({
policies: [
fromFunction('refunds.create', async (ctx) =>
ctx.amount > 50 ? 'require-approval' : 'allow',
),
],
});