---
title: "Configuring Agent Hooks"
canonical: https://trickest.com/docs/using-the-app/agent/configuring-agent-hooks
description: "Run a command, send a webhook, or run a callback when an Agent event occurs."
---

# Configuring Agent Hooks

## Before you start

An Agent hook runs an action you choose when an Agent event occurs. A hook can deny a tool call you do not want, or notify another system after an Agent event. Open **Settings > Agent > Agent hooks**. The Agent works without any hooks.

## Add a hook

Select **Add hook**.

**Event** is when the hook runs. **Matcher** is optional. Leave it empty to match every occurrence of that event. A tool name or a regular expression narrows the match.

Choose a **Runtime**:

A command runs in the workspace sandbox. The hook input arrives on stdin as JSON. For a PreToolUse hook, exit 2 denies that tool call.

An HTTP hook sends a webhook. Enter the **URL**. The host must be on this deployment's hook allowlist. **Headers** are optional. Credential headers, such as **Authorization** or **X-API-Key**, must reference a worker secret rather than contain the secret itself.

Callback requires a **Callback id**.

**Timeout (ms)** can stay at the default. Turn on **Can block** when a hook result should be able to stop the event. Leave **Enabled** on.

Select **Create**. The hook is saved.

## Change or remove a hook

The switch on the row turns the hook on or off. **Edit hook** opens the same form. Select **Save** to store the change.

**Delete hook** removes the hook.

---
_Markdown source of https://trickest.com/docs/using-the-app/agent/configuring-agent-hooks._
