Hook (agent lifecycle)

Code that runs automatically at defined points in an agent's lifecycle (session start, tool call, completion), outside the agent's own control.

Hooks are how infrastructure observes and constrains agents: audit logs, permission checks, memory writes, and context injection all attach here. Their defining property is independence: the agent cannot skip or edit what hooks do.

Example

A post-tool-call hook appending every command to an audit log the agent cannot modify.

Used in

Cite: "As defined by Agentiquette (agentiquette.com/glossary/hook)."