> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks Config • AI Agent SDK

> HooksConfig: Configuration for agent hooks/callbacks.

# HooksConfig

> Defined in the [**Feature Configs**](../modules/feature_configs) module.

<Badge color="blue">AI Agent</Badge>

Configuration for agent hooks/callbacks.

Consolidates: hooks, step\_callback

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%

graph TD
    event["Event Trigger"] --> hook["Hook: HooksConfig"]
    hook --> decision{"Decision"}
    decision -- "Allow" --> proc["Process"]
    decision -- "Deny" --> block["Block"]
    style hook fill:#189AB4,color:#fff
    style event fill:#8B0000,color:#fff
    style proc fill:#8B0000,color:#fff
    style block fill:#8B0000,color:#fff
```

## Properties

<ResponseField name="on_step" type="Optional">
  No description available.
</ResponseField>

<ResponseField name="on_tool_call" type="Optional">
  No description available.
</ResponseField>

<ResponseField name="middleware" type="List">
  No description available.
</ResponseField>

<Accordion title="Internal & Generic Methods">
  * **to\_dict**: Convert to dictionary.
</Accordion>

## Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
Agent(hooks=HooksConfig(
        on_step=my_step_callback,
        on_tool_call=my_tool_callback,
        middleware=[my_middleware],
    ))
```

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/config/feature_configs.py#L713">
  `praisonaiagents/config/feature_configs.py` at line 713
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Hooks Concept" icon="anchor" href="/docs/concepts/hooks" />

  <Card title="Hook Events" icon="bolt" href="/docs/features/hook-events" />

  <Card title="Callbacks" icon="phone" href="/docs/features/callbacks" />

  <Card title="Configuration Overview" icon="gear" href="/docs/configuration/index" />

  <Card title="Agent Config" icon="robot" href="/docs/configuration/agent-config" />
</CardGroup>
