Command-line interface
Create a secure starter configuration:
bash
npx @agent-utils/agent-guard initCheck a policy decision
bash
agent-guard check ./src/index.ts --operation read
agent-guard check ../secrets/.env --operation readExit codes are 0 for allow, 1 for deny, and 2 for ask.
Diagnostics
bash
agent-guard doctor
agent-guard adapters list
agent-guard policy validate
agent-guard audit --tail 50
agent-guard audit --agent codex --decision deny --since 2026-10-01 --jsonAgent hooks
Install or remove project-level hooks without replacing unrelated hook entries:
bash
agent-guard adapters install claude-code
agent-guard adapters install cursor
agent-guard adapters install codex
agent-guard adapters uninstall cursorCommit the generated project hook configuration if you want it shared with the repository. The hook command reads the host JSON event on stdin and is normally invoked by the generated configuration, not by hand.
Run a command
bash
agent-guard run -- npm testrun does not sandbox the child process. Only operations performed through integrated Agent Guard SDK or MCP APIs are enforced.