Agent Hooks
Put standard checkpoints around an agent. Watch an interceptor judge every stage of a run, block a reply that leaks a password, and see how evaluate_only mode records the same verdict without blocking.
12 minPro
Checking your access…
Inside this lesson
- An animation you play, pause and step through, with each part saying what it is doing.
- The real code beside it, with the lines for each step lit up.
- Practice mode, where you route each message yourself, and a short quiz.
- About 12 minutes.
Written from the official documentation
In this module: Middleware and safety
- Middleware: agent, function and chatCode that wraps each run, each tool call and each model call.Pro
- Guardrails: stop, override and handle errorsEnding a run early, replacing results and catching failures.Pro
- Middleware scope, shared state and runtime contextAgent level or run level, and passing values through a run.Pro
- Agent safety and Purview policiesTrust boundaries, input checks and policy enforcement.Pro
- Agent security with FIDESLabels on content that block prompt injection and data leaks.Pro
- Agent HooksInterceptors that allow, deny or change what an agent does.Pro