Skip to slide
Chapter 12 · Observability, Hooks, and the Agent SDK
84 / 142

CHAPTER 12 · Observability, Hooks, and the Agent SDK · 1 / 5

Why it matters

Hooks and budgets are what make an agent safe to automate rather than babysit. A PreToolUse hook that blocks dangerous commands and a max_budget_usd cap together mean you can let an agent run unattended in CI and trust that it will not destroy anything or run up a surprise bill. Observability (the session log) is what lets you debug and audit after the fact. The general guidance from the architecture breakdown captures the spirit: default to workflows when the steps are known, use full agent loops only when exploration is needed, and measure turns and dollars from the start. Observability turns an agent from a black box into a system you can reason about, control, and trust.

← → arrow keys work too