Hooks
Hooks are modules that run “around” the agent loop to add cross-cutting behavior: logging, approvals, redaction, UI/streaming presentation, and context injection. They’re the closest thing Amplifier has to middleware.
Why hooks matter
- Observability: capture a canonical event stream for debugging and tooling.
- Safety and governance: approvals and redaction can be enforced consistently.
- UX: streaming UI behavior can be swapped without touching the kernel.
Existing hooks (scanned)
This list is rendered from data/catalog.json.
How to think about a hook chain
You can picture hooks as a pipeline around “one turn”:
flowchart LR
req["Request (prompt + context)"] --> inj["Context injection hooks"]
inj --> approve["Approval/redaction hooks"]
approve --> provider["Provider call (model)"]
provider --> stream["Streaming UI / output formatting"]
provider --> log["Logging/event stream"]
stream --> end["User sees output"]
log --> end
Important
Hooks affect what gets logged, what the model sees, and what actions are allowed. If you’re auditing behavior, start by
checking which hooks your profile enables.