Expand description
Agent lifecycle hooks for customization.
Hooks allow you to intercept and customize agent behavior at key points:
AgentHooks::pre_tool_use- Control tool execution permissionsAgentHooks::post_tool_use- React to tool completionAgentHooks::on_event- Log or process eventsAgentHooks::on_error- Handle errors and decide recovery
§Built-in Implementations
DefaultHooks- Tier-based permissions (default)AllowAllHooks- Allow all tools without confirmationLoggingHooks- Debug logging for all events
Structs§
- Allow
AllHooks - Hooks that allow all tools without confirmation
- Default
Hooks - Default hooks implementation that uses tier-based decisions
- Logging
Hooks - Hooks that log all events (useful for debugging)
Enums§
- Tool
Decision - Decision returned by pre-tool hooks
Traits§
- Agent
Hooks - Lifecycle hooks for the agent loop. Implement this trait to customize agent behavior.