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

# Inference hooks

> Choose a security check, decide when to block an agent, and review findings across your workspace.

Workspace admins can use inference hooks to check an agent’s work as it runs. For example, a hook can stop an agent before it sends an API key to a tool. If you just want a record of what happened, you can send events to your own endpoint instead.

| Provider | What you can do |
| - | - |
| [Dust](https://docs.dust.tt/docs/user-documentation/admins/admin-governance/inference-hooks/dust-checks.md) | Flag or block prompt injection and sensitive data using Dust’s built-in checks. |
| [Custom webhook](https://docs.dust.tt/docs/user-documentation/admins/admin-governance/inference-hooks/custom-webhook.md) | Send events to your security or tracing system without interrupting the agent. |
| [Datadog AI Guard](https://docs.dust.tt/docs/user-documentation/admins/admin-governance/inference-hooks/datadog-ai-guard.md) (private beta) | Use your Datadog policies to flag or block activity and review findings in Datadog. |

## Credits

Only Dust’s **Prompt injection** check uses workspace credits. The sensitive data check and custom webhooks use none. During the beta, Dust doesn’t charge for the Datadog hook. Datadog bills separately. See [Inference hook credits](https://docs.dust.tt/docs/user-documentation/admins/usage-seats-and-credits/credits.md#inference-hook-credits) for rates.

## Create a hook

Open **Admin > Security > Inference Hooks**. Select **Add your first hook** or **Add hook**, give it a name, and choose a provider. The hook starts running when you select **Create**. If you don’t see the provider you need, email [inference-hooks@dust.com](mailto:inference-hooks@dust.com).

Hooks apply across your workspace. To skip runs by members of a group, add it to **Excluded groups**. Those exclusions don’t apply to runs without a user, such as runs started by a trigger or an API key. Some built-in Dust features, including Sidekick, don’t run hooks.

## Monitor or block

Start in **Monitor** to see what the hook flags while your agents keep working. Switch to **Block** when you want the agent to wait for the check. If the hook blocks a batch of proposed tool calls, none of those calls run. It can’t undo a call that already ran, so keep your tool permissions and approvals in place.

In **Block** mode, you also choose what happens if the provider fails or times out. You can let the agent continue without a check or stop it until someone tries again. Custom webhooks only monitor. Your endpoint’s response can’t block a run.

## Choose what to send

For Datadog and custom webhooks, choose which steps to send under **Events**. Dust’s built-in checks choose their own steps and context.

| Event in Dust | What happens at this step | Custom webhook `type` |
| - | - | - |
| Before agent loop | The user has sent a request. The agent hasn’t started work. | `user_request` |
| Before tool calls | The agent has chosen tools and arguments. The tools haven’t run yet. | `tool_inputs` |
| After tool calls | The tools have returned results. The agent hasn’t used them yet. | `tool_outputs` |
| After agent loop | The agent has finished its answer. | `final_answer` |

Tool calls can repeat within one turn. If the agent runs two separate searches, a webhook listening for **After tool calls** receives two `tool_outputs` events.

Under **Evaluation context**, choose how much conversation history the provider receives with each event:

| Setting | What Dust sends |
| - | - |
| This step only | Just the content at this step, such as the tool results. |
| Current turn | This step plus the conversation since the agent’s last answer, including tool calls and results. |
| Full conversation | This step plus the earlier messages the agent still has in context. Dust can’t restore history that was removed or summarized. |

Start with the least history your provider needs. Monitor mode still sends the content you select.

## Review findings

If someone reports a blocked run, ask for the **Dust reference** in their error message. Search for it in **Admin > Security > Inference Hooks > Evaluations** to see which check stopped the agent and why.

**Flagged** means the agent continued. **Blocked** means it stopped. If the provider failed, the error entry tells you whether the agent continued unchecked. You won’t see every successful check or webhook delivery here.

Use **Pause** in the hook’s menu to stop checks temporarily and **Resume** to start them again. **Archive** retires the hook but keeps its past evaluations.

## Troubleshooting

If a hook flags legitimate work, switch it to **Monitor** while you review the finding. For provider errors, check the error details for invalid credentials, rate limits, or timeouts. If you expected a finding but don’t see one, check the hook’s status, events, and excluded groups.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.