New: Decision Runtime — closed-set judgments for Agent OS. Read the guide →
HazelJS LogoHazelJS

Agent Gatekeeper

Agent Gatekeeper (@hazeljs/agent-gatekeeper) authorizes every tool invocation: allow, deny, or require-approval. The CLI can validate and simulate policies without executing tools.

01How to use it

Attach policies to the runtime/tool path; use hazel gatekeeper validate|simulate|explain for offline checks. Full guide: Agent Gatekeeper.

02Policy 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',
    ),
  ],
});