Slide 20 β Hooks: lifecycle observability
class HooksAudit(RunHooks):
async def on_tool_start(self, ctx, agent, tool):
logger.info("agent=%s tool=%s", agent.name, tool.name)
async def on_handoff(self, ctx, source, cible):
logger.info("handoff %s β %s", source.name, cible.name)
Runner.run(agent, msg, hooks=HooksAudit())
Uses: regulatory audit, latency/cost metrics, kill-switch.
Examination distinction: hook = observe Β· guardrail = block. The main safety goes into the guardrails.