> ## 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.

# Plugin Hook • Rust AI Agent SDK

> PluginHook: Hook points for plugin execution.

# PluginHook

> Defined in the [**plugins**](../modules/plugins) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Hook points for plugin execution.

```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: PluginHook"]
    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
```

## Fields

| Name              | Type      | Description                      |
| ----------------- | --------- | -------------------------------- |
| `Before`          | `variant` | -                                |
| `agent`           | `variant` | -                                |
| `starts`          | `variant` | -                                |
| `processing`      | `variant` | -                                |
| `BeforeAgent`     | `variant` | Before agent starts processing   |
| `After`           | `variant` | -                                |
| `agent`           | `variant` | -                                |
| `completes`       | `variant` | -                                |
| `processing`      | `variant` | -                                |
| `AfterAgent`      | `variant` | After agent completes processing |
| `Before`          | `variant` | -                                |
| `tool`            | `variant` | -                                |
| `execution`       | `variant` | -                                |
| `BeforeTool`      | `variant` | Before tool execution            |
| `After`           | `variant` | -                                |
| `tool`            | `variant` | -                                |
| `execution`       | `variant` | -                                |
| `AfterTool`       | `variant` | After tool execution             |
| `Before`          | `variant` | -                                |
| `LLM`             | `variant` | -                                |
| `call`            | `variant` | -                                |
| `BeforeLlm`       | `variant` | Before LLM call                  |
| `After`           | `variant` | -                                |
| `LLM`             | `variant` | -                                |
| `call`            | `variant` | -                                |
| `AfterLlm`        | `variant` | After LLM call                   |
| `Before`          | `variant` | -                                |
| `memory`          | `variant` | -                                |
| `operation`       | `variant` | -                                |
| `BeforeMemory`    | `variant` | Before memory operation          |
| `After`           | `variant` | -                                |
| `memory`          | `variant` | -                                |
| `operation`       | `variant` | -                                |
| `AfterMemory`     | `variant` | After memory operation           |
| `On`              | `variant` | -                                |
| `error`           | `variant` | -                                |
| `OnError`         | `variant` | On error                         |
| `On`              | `variant` | -                                |
| `workflow`        | `variant` | -                                |
| `start`           | `variant` | -                                |
| `OnWorkflowStart` | `variant` | On workflow start                |
| `On`              | `variant` | -                                |
| `workflow`        | `variant` | -                                |
| `end`             | `variant` | -                                |
| `OnWorkflowEnd`   | `variant` | On workflow end                  |
| `On`              | `variant` | -                                |
| `handoff`         | `variant` | -                                |
| `OnHandoff`       | `variant` | On handoff                       |

## Methods

### `all`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn all() -> Vec<PluginHook>
```

Get all hook types

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/plugins/mod.rs">
  `praisonai/src/plugins/mod.rs` at line 0
</Card>

***

## Related Documentation

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

  <Card title="Rust Events" icon="bolt" href="/docs/rust/events" />

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

  <Card title="Rust Plugins" icon="plug" href="/docs/rust/plugins" />
</CardGroup>
