Human-in-the-Loop Task Manager for AI Agents
Back to Blog
November 22, 2026 | AgentRQ Team

Wake Claude on Dependabot Alerts with AgentRQ Hooks

Dependabot is good at noticing. It finds the vulnerable package, names the advisory and tells you which version fixes it. Then the alert sits in the Security tab until somebody has time to read it, bump the dependency, run the tests and open a pull request.

That last part is exactly the work a coding agent does well. What it lacks is the alert. Claude Code does not watch your repository's Security tab, and a terminal session cannot receive a webhook.

The request behind this post is short: allow the Claude app to subscribe to Dependabot alerts and be woken as needed from them.

The short answer: put AgentRQ between GitHub and the agent. A hook receives GitHub's Dependabot webhook, checks its signature and fires an event. The event's trigger creates a task in the workspace where Claude Code runs, and the task reaches the agent through its channel the moment it is created. The agent wakes, reads the alert, bumps the package, runs the tests and opens a pull request. You get the result as a reply and approve anything risky with a button.

AgentRQ Hooks and Dependabot: GitHub raises a high-severity Dependabot alert, Command Injection in lodash, in acme/api-service and sends a signed webhook. The dependabot-alerts registration's delivery goes from queued to published and fires the dependabot.alert_created event. Its trigger creates a task in the api-service workspace, where the idle Claude Code agent wakes and moves it to Ongoing. Claude asks Authorization Required to run npm install lodash@4.17.21, the human clicks Allow Once, Claude opens PR #412, chore(deps): bump lodash to 4.17.21, and the task moves to Completed.

Why an Agent Needs a Wake-Up Call

Agents only act when asked. A coding agent is a conversation. It does nothing until a message arrives, and it does not poll GitHub on its own between messages.

Webhooks need an address. GitHub announces a Dependabot alert by sending an HTTP request to a URL. Claude Code on a laptop or a server has no URL, and should not open one.

Alerts need context to be useful. "lodash is vulnerable" is not a task. The agent needs the repository, the manifest file, the advisory and the patched version, in a form it can act on without asking.

Fixes need a human gate. Installing packages and pushing branches are the commands you want to see before they run, at least until you trust the routine.

AgentRQ already solves the first and last points for any task: work arrives in a workspace, the connected agent receives it, and approvals come back to you as buttons. Hooks add the missing piece, a public address that turns an outside request into one of those tasks.

How the Pieces Fit

Step AgentRQ feature What it does
GitHub sends the alert Hook registration A payload URL with its own token, plus the webhook secret GitHub signs with
The request is checked Hook (WebAssembly) Verifies X-Hub-Signature-256 and picks the event
The alert becomes work Event and trigger Creates a task in a workspace, with the alert in its body
The agent wakes Workspace channel Pushes the new task into the running Claude Code session
The fix is approved Authorization Required Allow Once, Always Allow or Deny, from the web, a phone or Slack
The result comes back Task reply A summary and the pull request link, with the task marked Completed

Every delivery is kept in the registration's Deliveries list for seven days by default, with its status: published, ignored, rejected or duplicate. When GitHub retries a delivery, the hook passes GitHub's delivery id along and AgentRQ records the retry as a duplicate, so one alert never makes two tasks.

Three Ways to Subscribe

The built-in github hook covers CI runs, pull requests, issues, releases and pushes. It does not read the Dependabot alerts webhook yet, so pick the route that fits your setup.

Route 1: a Dependabot hook, in real time

The cleanest route is a small hook of your own. A hook is a WebAssembly program that runs in a sandbox, a fresh one per request, with no files and no network. This one checks GitHub's signature, keeps the created and reopened alerts, and turns each into an event an agent can act on:

go
package main

import (
	"encoding/json"
	"fmt"
	"strings"

	"github.com/agentrq/agentrq/wasm-hooks/sdk"
)

var manifest = sdk.Manifest{
	Name:    "dependabot",
	Version: "1.0.0",
	Inputs: []sdk.Input{
		{Name: "webhookSecret", Label: "Webhook secret", Type: "string", Secret: true, Required: true},
	},
	Events: []sdk.Event{
		{Name: "dependabot.alert_created", Description: "Dependabot opened an alert"},
		{Name: "dependabot.alert_reopened", Description: "A fixed or dismissed alert came back"},
	},
}

type alertEvent struct {
	Action     string
	Repository struct {
		FullName string `json:"full_name"`
	}
	Alert struct {
		Number     int
		HTMLURL    string `json:"html_url"`
		Dependency struct {
			Package      struct{ Name, Ecosystem string }
			ManifestPath string `json:"manifest_path"`
		}
		Advisory struct {
			GHSAID   string `json:"ghsa_id"`
			Summary  string
			Severity string
		} `json:"security_advisory"`
		Vulnerability struct {
			FirstPatched *struct{ Identifier string } `json:"first_patched_version"`
		} `json:"security_vulnerability"`
	}
}

func main() { sdk.Main(manifest, handle) }

func handle(in sdk.In) sdk.Result {
	sig, ok := strings.CutPrefix(in.Request.Header("X-Hub-Signature-256"), "sha256=")
	if !ok || !sdk.ValidHMACSHA256(in.String("webhookSecret"), in.Request.Body, sig) {
		return sdk.Reject("X-Hub-Signature-256 does not match the webhook secret")
	}
	if in.Request.Header("X-GitHub-Event") != "dependabot_alert" {
		return sdk.Accept() // a ping, or an event this hook does not watch
	}
	var p alertEvent
	if err := json.Unmarshal(in.Request.Body, &p); err != nil {
		return sdk.Reject("the body is not JSON")
	}
	name := map[string]string{
		"created":  "dependabot.alert_created",
		"reopened": "dependabot.alert_reopened",
	}[p.Action]
	if name == "" {
		return sdk.Accept() // dismissed, fixed and the rest need no agent
	}
	a, repo := p.Alert, p.Repository.FullName
	fix := "no patched version yet"
	if v := a.Vulnerability.FirstPatched; v != nil {
		fix = "fixed in " + v.Identifier
	}
	return sdk.Accept(sdk.Out{
		Name:     name,
		DedupKey: in.Request.Header("X-GitHub-Delivery"),
		Payload: fmt.Sprintf("Dependabot alert #%d (%s) in %s: %s\n%s package %s in %s, %s\n%s",
			a.Number, a.Advisory.Severity, repo, a.Advisory.Summary,
			a.Dependency.Package.Ecosystem, a.Dependency.Package.Name, a.Dependency.ManifestPath, fix, a.HTMLURL),
		FAQ: []sdk.FAQ{
			{Q: "Which repository?", A: repo},
			{Q: "Which package?", A: a.Dependency.Package.Name},
			{Q: "Which advisory?", A: a.Advisory.GHSAID},
		},
	})
}

Build it with GOOS=wasip1 GOARCH=wasm go build -o dependabot.wasm . and upload it under Events → Hooks → Your hooks. Uploading your own hooks needs a server that allows it (AGENTRQ_HOOKS_ALLOW_USER_HOOKS=true when you self-host); otherwise ask the server's operator to add it as a built-in hook.

Then register it and point GitHub at it:

  1. Events → New event, named dependabot_alert_created. Add a trigger that creates a task in the workspace where Claude Code works on the repository, with a body such as "Fix this Dependabot alert: bump the package to the patched version, run the tests, open a pull request. {{EVENT_PAYLOAD}}".
  2. Events → Hooks → New registration, pick dependabot, Generate a webhook secret and copy it. Route dependabot.alert_created (and dependabot.alert_reopened, if you want it) to your event, then Create and copy the payload URL.
  3. In the repository or organization on GitHub, Settings → Webhooks → Add webhook: the payload URL, content type application/json, the secret, and Let me select individual events → Dependabot alerts.

Route 2: the generic hook and a scheduled check

If you cannot upload hooks, the built-in generic hook works with no code on the AgentRQ side. A scheduled GitHub Actions workflow reads the open alerts and posts each one:

yaml
name: dependabot-alerts-to-agentrq
on:
  schedule:
    - cron: "*/30 * * * *"
  workflow_dispatch:
jobs:
  send:
    runs-on: ubuntu-latest
    steps:
      - env:
          GH_TOKEN: ${{ secrets.DEPENDABOT_ALERTS_TOKEN }}
          HOOK_URL: ${{ secrets.AGENTRQ_HOOK_URL }}
          HOOK_SECRET: ${{ secrets.AGENTRQ_HOOK_SECRET }}
        run: |
          gh api "repos/$GITHUB_REPOSITORY/dependabot/alerts?state=open&per_page=100" |
          jq -c '.[] | {number, severity: .security_advisory.severity,
            package: .dependency.package.name, manifest: .dependency.manifest_path,
            summary: .security_advisory.summary, url: .html_url}' |
          while read -r alert; do
            n=$(jq -r .number <<<"$alert")
            curl -fsS -X POST "$HOOK_URL" \
              -H "Authorization: Bearer $HOOK_SECRET" \
              -H 'Content-Type: application/json' \
              -H "Idempotency-Key: $GITHUB_REPOSITORY-dependabot-$n" \
              -d "$alert"
          done

DEPENDABOT_ALERTS_TOKEN is a fine-grained token with read access to Dependabot alerts. The Idempotency-Key is the alert's number, so an alert that is still open on the next run is recorded as a duplicate and makes no second task. AgentRQ keeps those keys as long as it keeps deliveries, seven days by default, so an alert nobody fixed comes back as a fresh task a week later, which works as a reminder. Register the generic hook, route its request.received event to dependabot_alert_created, and the rest is the same as route 1. The wake-up is up to 30 minutes late instead of instant.

Route 3: no new hook, wake on Dependabot pull requests

With Dependabot security updates on, Dependabot opens the fix itself as a pull request. What it cannot do is repair the build when the new version breaks something. The built-in github hook can wake the agent for exactly that: register it, route ci.failed to an event such as dependabot_ci_failed, and set Branches to dependabot/*/* and dependabot/*/*/* so only Dependabot's branches count. A failed run on one of them becomes a task for the agent to fix the code until the update's checks pass.

What the Agent Receives

The task arrives in the workspace like any other, with the alert written out in the body:

text
Fix this Dependabot alert: bump the package to the patched version,
run the tests, open a pull request.

Dependabot alert #42 (high) in acme/api-service: Command Injection in lodash
npm package lodash in package-lock.json, fixed in 4.17.21
https://github.com/acme/api-service/security/dependabot/42

If Claude Code is running in the workspace, the task reaches its session at once through the workspace channel. That is the wake-up: an idle session gets a new message and starts working. If no session is connected, the task waits on the task board as Not started until one is, and you see it there too. With an agent started from machines, the session can stay up on a computer you own instead of a laptop that sleeps.

Features That Make It Safe to Automate

Approvals stay with you. When the agent wants to run npm install or push a branch, the task shows Authorization Required with Allow Once, Always Allow and Deny, and a notification tells you. You decide from the browser, your phone or Slack.

The route warns you about Allow all commands. A trigger can let its tasks run any command without asking, as in YOLO mode. A hook route to such a trigger is marked with a warning, because anyone who can send the hook a genuine request could then start one. For dependency fixes, leave approvals on until the routine has earned your trust.

The agent learns your routine. Save how your team handles dependency bumps as a skill: which lockfiles to update, which tests to run, how to title the pull request. The agent keeps what it learns about the repository in workspace memory, so the tenth alert goes faster than the first.

You can see what it did. Every command and file the agent touched is on the task's tool call history, next to the reply with the pull request link.

The fix can start the next step. A trigger can emit another event when its task completes. Chain a reviewer workspace or a release task after the fix with workflows, and the alert runs all the way to a reviewed pull request.

What This Unlocks

Security work stops waiting for a free afternoon. A critical alert at 3 a.m. is a pull request, with tests run, by the time you wake up. You review and merge instead of researching and typing.

The backlog shrinks instead of growing. Teams with many repositories collect dozens of low and moderate alerts that nobody gets to. Routed to an agent, each one becomes a small, reviewable pull request.

One pattern for every outside signal. The same hook, event and trigger chain wakes the agent on a failed CI run, a new issue or a release. Dependabot is one more source, not a special integration.

You keep the gate. The agent does the work, but nothing installs, pushes or merges without the approval you chose to require.

Setup Checklist

  1. Connect Claude Code to a workspace that has the repository checked out.
  2. Create the dependabot_alert_created event and a trigger that writes a task in that workspace.
  3. Register a hook: your own dependabot hook, or the generic hook with the scheduled workflow.
  4. Add the webhook (or the workflow) on GitHub, then open the registration's Deliveries to see the first request arrive as published.
  5. Save a dependency-update skill so every fix follows the same steps.

FAQ

Does the Claude Code session need a public URL?

No. GitHub calls AgentRQ's payload URL. The agent only keeps its usual connection to its workspace, and the task comes down that connection.

What happens when GitHub retries a webhook?

The hook passes GitHub's delivery id as the dedup key, so a retry is recorded as a duplicate in Deliveries and fires nothing.

Why does a wrong secret not show up as an error on GitHub?

AgentRQ answers 202 as soon as a request reaches a valid URL, before the hook checks it. A wrong signature shows up as rejected in the registration's Deliveries, with the reason.

Can one hook serve several repositories?

Yes. Add the same payload URL and secret to each repository, or once at the organization level. The repository name is in the task body, and if the trigger's body also includes {{EVENT_FAQ}}, the hook's answers to "Which repository?", "Which package?" and "Which advisory?" come with it.

What if the payload URL leaks?

Choose Rotate on the registration. The old URL stops working at once, and you paste the new one into GitHub.

Does this work with a self-hosted AgentRQ?

Yes, as long as GitHub can reach it. Set AGENTRQ_BASE_URL to the public address, or put a tunnel in front of a server on a private network.

Start Free