Audit hook template
{
"PostToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "node audit.js"
}]
}],
"UserPromptSubmit": [{
"hooks": [{ "type": "command", "command": "node audit.js" }]
}]
}What audit.js does
- Read the event JSON from stdin (event type, tool, args, file path)
- Append to `Vault/.audit/<YYYY-MM-DD>.jsonl` — one line each
- SHA-256 each line, store in `audit.log.sha`
- Optional: forward to a compliance webhook
When this matters
Law firms, healthcare, listed-company finance — "what did AI do for me" must be answerable. Hooks let you produce "30-day agent action log" on demand.