---
title: "Turn Sentry Issues and Alerts Into AI Coding Agent Tasks | AgentRQ Guidelines"
url: https://agentrq.com/guidelines/hooks/turn-sentry-issues-and-alerts-into-ai-coding-agent-tasks
description: "Send Sentry issues and alerts to your AI coding agent: register the sentry hook, point a Sentry integration's webhook at it, and errors become tasks."
---

![](https://agentrq.com/assets/guideline-icons/bug.svg) Checked November 30, 2026 | [All Hooks guides](https://agentrq.com/guidelines/hooks/)

# Turn Sentry Issues and Alerts Into AI Coding Agent Tasks

To hand Sentry errors to an AI coding agent, register AgentRQ's built-in **sentry** hook with the Client Secret of a Sentry internal integration, then set that integration's webhook URL to the hook's payload URL. From then on, when Sentry sees a new issue, an old one comes back or an alert rule fires, the agent in your workspace gets a task with the issue's title, culprit, level, event and user counts and a link back to Sentry, and can start on a fix while you are still reading the alert email.

This page is one of our [Hooks guidelines](https://agentrq.com/guidelines/hooks/). It follows the [Hooks docs](https://github.com/agentrq/agentrq/blob/main/docs/HOOKS.md#sentry) and was checked against AgentRQ v0.19.18 on November 30, 2026.

## The Five Steps at a Glance

| Step | Who | Where |
| --- | --- | --- |
| 1. Add the sentry hook to the server | the server's operator, once | AgentRQ admin page |
| 2. Create an internal integration and copy its Client Secret | a Sentry organization owner or manager | Sentry, **Settings → Developer Settings** |
| 3. Make an event, and a trigger that creates the task | you | AgentRQ, **Events** |
| 4. Register the hook | you | AgentRQ, **Events → Hooks** |
| 5. Give Sentry the payload URL, and pick the webhooks | the same Sentry admin | Sentry, the integration's page |

## Before You Start

- → A workspace with an agent connected, here **storefront-api**, a Go service whose Sentry project is also called `storefront-api`.
- → A Sentry organization where you can create an internal integration. Error webhooks (`error.created`) need Sentry's Business or Enterprise plan; issues, alerts and comments work on any plan.
- → A server Sentry can reach. On agentrq.com it can. Self-hosted, `AGENTRQ_BASE_URL` must be a public `https://` address: see [make the payload URL reachable](https://agentrq.com/guidelines/hooks/check-hook-deliveries-replay-rotate-and-reach-your-server#make-the-payload-url-reachable).

## What the Hook Sends

The sentry hook checks every request's **Sentry-Hook-Signature**, an HMAC-SHA256 of the body keyed with the integration's Client Secret, and turns what Sentry sends into these events. Route the ones you want and leave the rest **Not routed**:

| Sentry webhook | Hook events | When |
| --- | --- | --- |
| issue | issue.created | Sentry grouped a new issue |
| issue | issue.unresolved | A resolved or archived issue came back |
| issue | issue.assigned | Someone assigned an issue, to a person or a team |
| issue | issue.resolved, issue.archived | An issue was resolved or archived |
| error | error.created | Any error event arrived (Business plan and up) |
| Alert Rule Action | alert.triggered | An issue alert rule fired, naming the rule |
| Alert Rule Action | metric_alert.critical, metric_alert.warning, metric_alert.resolved | A metric alert changed state |
| comment | comment.created | Someone commented on an issue |

Each event has a one-line subject, such as `Sentry STOREFRONT-API-4F2: runtime error: invalid memory address or nil pointer dereference` for an issue or `Sentry alert Checkout errors: ...` for an issue alert, which makes a good task title. Its payload is plain text the agent can read: the issue's short id, project, title, culprit, level, event and user counts and its Sentry link; for a metric alert, the alert's title, description, projects and link.

For most teams, **issue.created** and **issue.unresolved** are the ones to start with: one task per new problem, and one when a fixed problem returns. **error.created** fires for every single event, so a busy project would file a task per error.

## Step 1: Add the sentry Hook to the Server

If **sentry** is already listed when you choose **Events → Hooks → New registration**, skip this step. Otherwise the server's operator adds it once: download `agentrq-hook-sentry_<version>.wasm` from the server's release on GitHub, sign in at `<AGENTRQ_BASE_URL>/admin/login` with the root access token and upload it on the **Hooks** tab. [Install a built-in hook](https://agentrq.com/guidelines/hooks/check-hook-deliveries-replay-rotate-and-reach-your-server#install-a-built-in-hook-on-a-self-hosted-server) shows how to do it from a script.

## Step 2: Create a Sentry Internal Integration

An internal integration belongs to your Sentry organization alone, and it is what lets Sentry sign its webhooks with a secret only you and AgentRQ know.

**1. In Sentry, open Settings → Developer Settings → Custom Integrations, and click Create New Integration.** Pick **Internal Integration**.

**2. Name it**, for example `AgentRQ`, and click **Save Changes**. Leave the webhook URL for step 5.

**3. Copy the Client Secret** the integration's page now shows. AgentRQ needs it in step 4.

## Step 3: Make an Event and Its Trigger

**1. Open Events and click + New Event.** Name it, for example `sentry_issue`, and create it.

**2. On the event's page, click + Add trigger.**

**3. Target Workspace:** the workspace whose agent should do the work, here **storefront-api**.

**4. Task Title:** `{{EVENT_SUBJECT}}`, so each task is named after its Sentry issue.

**5. Task Instructions:** what the agent should do, with `{{EVENT_PAYLOAD}}` where the issue goes. **+ Event payload** inserts it. For example:

text

```text
Find the cause of this Sentry issue in the code, fix it with a test
that reproduces it, and open a pull request. Link the Sentry issue
in the PR description.

{{EVENT_PAYLOAD}}
```

**6. Click Create trigger.**

One event can take several routes. If you want metric alerts handled differently, such as "look at the last deploy and tell me what changed" rather than "fix it", make a second event with its own trigger and route the metric alert events there.

## Step 4: Register the sentry Hook

Open **Events → Hooks** and click **New registration**. Name it, for example `Sentry storefront-api`, then:

**1. Pick the sentry hook.**

**2. Paste the Client Secret** from step 2 into **Client secret of the Sentry integration**. Don't click **Generate** here: Sentry makes this secret, and a generated one would never match Sentry's signature.

**3. Project slugs:** the Sentry projects this registration takes, such as `storefront-api`. Separate several with commas, or leave it empty to take every project in the organization. A request for another project is accepted and logged as **ignored**.

**4. Route issue.created and issue.unresolved** to your event.

**5. Route alert.triggered** too, if you want issue alert rules to start tasks. Leave the other events **Not routed** for now.

**6. Click Create registration.**

![Steps 1 to 6: the New registration form with the sentry hook picked, the Client Secret pasted, storefront-api as the project slug, issue.created, issue.unresolved and alert.triggered routed to sentry_issue, and the Create registration button](https://agentrq.com/assets/guidelines/hooks-sentry-1-registration.png)

**7. Click Copy URL.** The registration's page now shows its **Payload URL**, in full this once only. If you lose it, **Rotate token** makes a new one. The same page lists the routes, and later each request under **Deliveries**.

![Steps 1 to 3: the sentry registration's page, with the Copy URL button, the three routes to sentry_issue and a Published issue.created delivery](https://agentrq.com/assets/guidelines/hooks-sentry-2-payload-url.png)

## Step 5: Point Sentry at the Payload URL

Back on the integration's page in Sentry:

**1. Webhook URL:** paste the Payload URL from step 4, `agentrq_hook_token` included.

**2. Alert Rule Action:** turn it on if you routed alert.triggered or any metric_alert event. Alerts reach the hook only through this.

**3. Permissions:** give **Issue & Event** read access. The issue, error and comment webhooks need it.

**4. Webhooks:** tick **issue**, plus **error** and **comment** only if you routed their events. Sentry sends nothing for a box left unticked.

**5. Click Save Changes.**

**6. For alerts,** open an issue or metric alert rule (**Alerts → Create Alert**, or an existing rule) and add an action that sends a notification via your integration, here **AgentRQ**. Each time the rule fires, the hook gets the alert.

## Try It

The next new issue in `storefront-api` arrives as a task, under **Not started** in the workspace, and the agent picks it up. Its title is the Sentry subject, and its instructions carry your text, then the issue:

![Steps 1 and 2: the task the sentry hook created in storefront-api, titled after Sentry issue STOREFRONT-API-4F2, with the issue's project, culprit, level, counts and Sentry link in its instructions](https://agentrq.com/assets/guidelines/hooks-sentry-3-task.png)

To try it without waiting for a real error, trigger a test event from one of your services, or send one with the Sentry CLI: `sentry-cli send-event -m "AgentRQ hook test"` with `SENTRY_DSN` set to the project's DSN. A new message makes a new issue, and so an issue.created delivery.

## If No Task Appears

Open the registration in **Events → Hooks** and look at its **Deliveries**:

| What you see | Why |
| --- | --- |
| No delivery at all | Sentry did not reach the server, or the webhook is not ticked. Check the integration's **Webhook URL**, the ticked webhooks, and that `AGENTRQ_BASE_URL` is reachable from the internet. |
| rejected "Sentry-Hook-Signature does not match the client secret" | The registration's Client Secret is not this integration's. Paste it again with **Edit**. |
| ignored | Nothing is routed for that event, the issue is in a project missing from **Project slugs**, or Sentry sent something the hook does not turn into an event, such as the integration's own installation notice or a comment edit. |
| duplicate | Sentry sent the same request again, with the same `Request-ID`. It fires nothing the second time. |
| published, but no task | The event has no trigger, or the hook event is not routed to it. |

[Check hook deliveries](https://agentrq.com/guidelines/hooks/check-hook-deliveries-replay-rotate-and-reach-your-server) explains every status.

## Keep the Noise Down

Every routed request is a task, and a task is an agent's time. A few habits keep that worth it:

- → **Route issues, not errors.** Sentry already groups thousands of error events into one issue. issue.created gives one task per problem; error.created gives one per event.
- → **Let alert rules do the filtering.** An issue alert rule can require a level, a minimum number of events in an hour, an environment such as `production` or a tag. Route only alert.triggered, and only issues that pass your rule become tasks.
- → **One integration per workspace.** Use **Project slugs** to send each service's issues to the workspace that holds its code.
- → **Mind YOLO mode.** A route to an event whose trigger has [YOLO mode](https://agentrq.com/features/yolo-mode) on, which runs every command without asking, is marked with a warning. Without it, the agent still stops for your Allow or Deny before any risky command, which is the safer default for work an outside service starts.

## Let the Agent Write Back to Sentry

The hook only reads from Sentry. For the agent to comment on the issue, assign it or resolve it when the fix ships, give the workspace access to Sentry, such as Sentry's MCP server, and say so in the trigger's instructions: "When the pull request is open, comment its link on the Sentry issue." With **comment** ticked and comment.created routed, a teammate's comment on the issue can start a follow-up task too.

## FAQ

### Do I need a paid Sentry plan?

Not for issues, alerts or comments. Only the **error** webhook, and so error.created, needs Sentry's Business or Enterprise plan.

### Can one Sentry integration feed several workspaces?

Not directly: a Sentry integration has a single webhook URL, and a payload URL belongs to one registration. For several workspaces, create one internal integration per workspace, each with its own Client Secret and payload URL, and set each registration's **Project slugs** to that workspace's projects. One registration can still route to several events, and each event's trigger can name a different workspace.

### What about issues that were archived or ignored?

When an archived issue comes back, the hook fires issue.unresolved. Older Sentry versions call archiving "ignored"; the hook reports both as issue.archived.

### Does it work with self-hosted Sentry?

It reads the same webhook payloads and checks the same signature, so a self-hosted Sentry with internal integrations works too, as long as it can reach your AgentRQ server.

### Can Sentry retry a delivery and start a second task?

No. The hook uses Sentry's `Request-ID` header as the delivery's dedup key, so a request that comes again is logged as **duplicate** and fires nothing.
