Wake AI Agents on Dependabot Alerts with Hooks
Dependabot finds the vulnerable package, names the advisory and tells you which version fixes it. Then the alert waits in the Security tab until somebody has an hour to check it is real, bump the package, update the lockfile, run the tests and open a pull request. On a busy team, that hour does not come, and the list grows.
That hour is exactly what a coding agent is good at. What the agent lacks is the alert: Claude Code, Codex or Antigravity running in your checkout does not watch the Security tab, and a terminal session has no address GitHub could call.
This tutorial subscribes your agent to Dependabot alerts. Every open alert becomes a task in the workspace where the agent works, the agent wakes up and takes it, checks that the alert is still open and not already fixed, upgrades the package on a branch and runs the tests, then asks you before it pushes and opens the pull request. It works the same for Claude Code and for every agent that connects through the ACP Gateway, such as Codex, Antigravity, Gemini CLI, GitHub Copilot or Cursor.
The screenshots come from the AgentRQ app on December 1, 2026, fed by the exact requests the workflow in Step 4 sends.
Update, December 5, 2026: since AgentRQ v0.22.1, the built-in github hook takes GitHub's Dependabot alert webhook directly and fires dependabot.alert the moment an alert opens, with no workflow or schedule. Resolve Dependabot alerts with an AI coding agent sets that up. The scheduled route below still helps to work through alerts that were already open, or on a server with an older github hook.
What You Build
| Piece | Setting | What it does |
|---|---|---|
| api-service workspace | Working directory: your repository's checkout. YOLO mode off | Where the agent works on each alert, and asks before it pushes |
| Your agent | Claude Code, or any ACP agent, started on a machine | Wakes up when a task arrives |
| dependabot_alert event | A trigger that gives api-service "Fix Dependabot alert in api-service" | One task for every open alert, with the alert pasted in |
| generic hook registration | A token. Route: request.received to dependabot_alert | The address the workflow sends alerts to |
| GitHub Actions workflow | Every 30 minutes, one request per open alert | Reads the Dependabot alerts API and sends each alert once |
Three ideas make it work:
- → A hook gives your account an address. A hook is a URL that checks every request and turns it into one of your events. The built-in generic hook checks a shared token and passes the body through, so no code runs on the AgentRQ side.
- → An event becomes a task, and a task wakes the agent. The event's trigger creates a task in the workspace. AgentRQ hands it to whichever agent is connected there: Claude Code receives it through its channel, an ACP agent as a new prompt. The agent never polls GitHub and needs no public address.
- → You keep the gate. With YOLO mode off, git push and gh pr create wait for your Allow Once, from the browser or your phone.
Why Not GitHub's Webhook Directly?
GitHub does send a dependabot_alert webhook, but it signs it with X-Hub-Signature-256, and the generic hook checks a token in a header, which GitHub's webhooks cannot add. The built-in github hook checks that signature but does not read Dependabot alerts: it fires CI runs, pull requests, issues, releases and pushes. GitHub Actions has no Dependabot alert trigger either.
So this tutorial reads the alerts the way GitHub documents: a scheduled workflow calls the Dependabot alerts API and sends each open alert to the generic hook. It works on hosted AgentRQ with nothing to install, and the wake-up is at most 30 minutes late. If you self-host and want it instant, see Real Time on a Self-Hosted Server below.
Before You Start
- → An AgentRQ account, and a computer with a checkout of the repository, where the agent will run. See machines and the connect agents guidelines.
- → An agent that connects to AgentRQ: Claude Code over MCP, or Codex, Antigravity, Gemini CLI and the other ACP agents through the ACP Gateway. Step 1 shows each.
- → The GitHub CLI on that computer, signed in with gh auth login, so the agent can read the alert, push a branch and open a pull request.
- → What the project needs to install and test: here, Node and npm for acme/api-service.
- → Admin access to the GitHub repository, to add a workflow and its secrets, and Dependabot alerts turned on under Settings → Code security.
Step 1: Make the Workspace and Connect Your Agent
Create a workspace named api-service. Its mission tells the agent what it is for, every time it starts:
In its settings, set the Working Directory to the repository's checkout and leave YOLO mode off. Then start the agent you want to wake up on a machine: a computer of yours running agentrqd, the AgentRQ daemon. If you have none yet, open Machines, click Add machine and run the two commands it shows on the computer that has the checkout; you do this once, and the machine serves every workspace. Back in the workspace, click the start button, or Change under it to open the Start an agent form and pick the agent, its model and its effort.
Claude Code. Pick Claude Code. AgentRQ starts it on the machine with the workspace's channel turned on, which is how a new task reaches the running session. Connect Claude Code with machines shows every click.
Codex, Antigravity, Gemini CLI, GitHub Copilot, Cursor, OpenCode and other ACP agents. Pick the agent from the list, or click + and search for it: every agent in the ACP registry is there. AgentRQ runs it through the ACP Gateway, which keeps the agent's session open, hands it each new task as a prompt over ACP, and restarts the agent if it dies. Connect agents with the ACP Gateway and machines shows every click.
If the agent needs signing in, it asks in its live terminal the first time, and you sign in from there. The ACP setup page for each agent has its id and quirks. Whichever you pick, the workspace's dot turns green once it is connected, and nothing else in this tutorial changes.
Step 2: Create the dependabot_alert Event and Its Trigger
Open Events, click + New Event, and name it dependabot_alert. In its payload guidelines, say what it carries: "Sent by the dependabot-alerts GitHub Actions workflow through the generic hook, once per open Dependabot alert."
On the event's page, click + Add Trigger. 1. api-service gets the task. 2. One title for every alert: the generic hook gives no subject, so every task is called "Fix Dependabot alert in api-service", and the alert's number is in the body. 3. The alert goes here: {{EVENT_PAYLOAD}} becomes the alert the workflow sent. 4. YOLO off, so the agent asks before every command. 5. Create trigger.
The instructions are the agent's playbook for an alert. This run used:
Steps 1 and 2 matter more than they look. The workflow sends every open alert, so an alert that is already being fixed, or was fixed a minute ago, can still arrive. Checking first makes those tasks end in one line instead of a second pull request.
Step 3: Register the Generic Hook
Open Events → Hooks and choose New registration. Name it dependabot-alerts. 1. Pick the generic hook. 2. Generate a token, then Copy it: the workflow sends it, and it is never shown again. Leave Header empty, so the token goes in Authorization as a Bearer token. 3. Route request.received to dependabot_alert. 4. Create registration.
The registration's page now shows 1. the payload URL, with its agentrq_hook_token at the end. 2. Copy URL now: the full URL is shown only this once. If you lose it, Rotate token gives you a new one and the old one stops working.
The Deliveries list in the same screenshot is from later in the run: 3. a wrong token is Rejected, with the reason, 4. the right token makes a task, and 5. the same alert sent again makes no second task. Step 4 explains why.
Step 4: Send the Alerts from GitHub Actions
The workflow needs three repository secrets, under Settings → Secrets and variables → Actions:
- → AGENTRQ_HOOK_URL: the payload URL from Step 3, token included.
- → AGENTRQ_HOOK_SECRET: the token you generated in Step 3.
- → DEPENDABOT_ALERTS_TOKEN: a fine-grained personal access token for this repository with Dependabot alerts: Read-only. The workflow's own GITHUB_TOKEN cannot read Dependabot alerts.
Then add .github/workflows/dependabot-alerts-to-agentrq.yml:
Three choices in it are deliberate:
- → One request per alert, as plain text. The generic hook passes the body through, and {{EVENT_PAYLOAD}} pastes it into the task as it is. Seven readable lines are easier for the agent, and for you, than a JSON blob on one line.
- → The Idempotency-Key is the repository and the alert number. The hook records each key it has seen, so an alert that is still open on the next run, 30 minutes later, is a Duplicate and makes no second task. Keys are kept as long as deliveries, 7 days by default: an alert still open a week later comes back as a fresh task, which works as a reminder, and the playbook's first two checks keep it from becoming a second pull request.
- → Every 30 minutes. GitHub runs scheduled workflows on a best-effort basis, so a run can start a few minutes late. Run it by hand with Run workflow to send the open alerts now.
Only want the urgent ones? Add &severity=critical,high to the API URL.
Step 5: The Alert Wakes the Agent
The first run found alert #42: lodash 4.17.20 in package-lock.json, Command Injection, fixed in 4.17.21. The hook fired dependabot_alert, and the trigger created the task.
1. Agent connected: the green dot next to the workspace's name. 2. The alert, as the workflow sent it, above the playbook. 3. Not started, for a moment: AgentRQ hands a waiting task to the connected agent within a minute, and the agent moves it to Ongoing.
That is the wake-up. A Claude Code session sitting idle in its terminal gets the task as a new message and starts working. An ACP agent gets it as a new prompt from the gateway. If no agent is connected, the task waits under Not started and goes to the agent as soon as one connects, so a laptop that was asleep catches up when it wakes.
A workspace's agent works on one task at a time. When three alerts arrive together, the other two wait under Not started and are handed over one after another as each finishes.
Step 6: You Approve the Push
The agent checked that alert #42 was still open and that no pull request bumped lodash, found the two places lodash 4.17.20 came from, upgraded it on deps/lodash-4.17.21, ran the tests and committed. 1. Tested and committed, with what it did and the results. 2. The push waits for you, in an Authorization Required card with the exact command. 3. Allow Once.
After the push it asked the same way before gh pr create. The cards reach your phone through notifications, so an alert at night is a pull request waiting for one tap in the morning. Use Allow Once, not Always Allow: Always Allow saves a rule, and the next push would not ask.
The card looks the same whichever agent raised it: when Claude Code or an ACP agent asks for permission, the request comes to the task, and with YOLO off AgentRQ never answers one for you.
Step 7: The Pull Request, and the Alert Closes Itself
1. You approved twice, the two Needs input stops on the timeline, and the task is Completed. 2. The pull request, with what changed, the advisory it fixes and the test run. 3. Linked on the task: AgentRQ spots the pull request link and lists it under Links, next to the alert.
You review and merge it like any other pull request. Dependabot then sees the patched version on the default branch and closes alert #42 by itself, so the next run of the workflow no longer sends it.
Real Time on a Self-Hosted Server
On a server you run with AGENTRQ_HOOKS_ALLOW_USER_HOOKS=true, you can drop the schedule and take GitHub's dependabot_alert webhook directly, with a small hook of your own that checks GitHub's signature and fires an event for created and reopened alerts. Wake Claude on Dependabot alerts has its complete Go source, and write your own hook in WebAssembly shows how to build and upload it. Route its events to the same dependabot_alert event, add the repository webhook with Dependabot alerts ticked, and Steps 1, 2 and 5 to 7 stay exactly as they are.
Traps to Avoid
- → The agent is not connected. Tasks pile up under Not started, and nothing wakes. Check for the green dot. An agent started on a machine that stays on, such as a dev box, keeps listening when your laptop is closed.
- → The wrong token. The hook answers 202 before it checks anything, so curl in the workflow succeeds and the request shows up only as Rejected in the registration's Deliveries, with "missing or wrong token in Authorization".
- → GITHUB_TOKEN instead of a personal access token. gh api answers 403 and the workflow sends nothing. Use a token with Dependabot alerts read access.
- → A changed Idempotency-Key. Put the run id or a timestamp in it and every run makes a new task for every open alert. Keep it to the repository and the alert number.
- → One title for every task. The generic hook has no subject, so the task list shows the same title many times. The alert number is in each task's body; ask the agent to name it in its first reply.
- → Several repositories, one workspace. The workspace's working directory is one checkout. Give each repository its own workspace and registration, or point the trigger at a workspace whose agent can reach every checkout.
- → Always Allow on git push. It saves a rule by the command's first word, so every git command, push included, runs without asking from then on. Keep Allow Once for anything that leaves your machine.
Make It Yours
- → Only critical and high. Add
&severity=critical,highto the API URL in the workflow. - → One workflow for the whole organization. Call
orgs/<org>/dependabot/alertsinstead, which lists every repository's alerts with the repository in each, and send each repository's alerts to the payload URL of its own registration, routed to its own workspace. - → Group the small ones. Tell the agent to add a low-severity alert to an open deps pull request instead of opening a new one.
- → Save the routine as a skill. Which lockfiles to update, which tests to run and how to title the pull request belong in a skill the whole team shares, and what the agent learns about the repository goes into workspace memory.
- → Pair it with weekly upgrades. Alerts cover what is vulnerable today; weekly dependency upgrades with a scheduled agent keeps everything else current so the next fix is a small one.
FAQ
Does the agent need a public URL? No. GitHub Actions calls AgentRQ's payload URL. The agent keeps its usual connection to its workspace, and the task comes down that connection.
Which agents can be woken this way? Claude Code over its MCP channel, and every agent the ACP Gateway runs, such as Codex, Antigravity, Gemini CLI, GitHub Copilot, Cursor and OpenCode. The hook, event and trigger do not change with the agent; only Step 1 does.
How fast does the agent wake up? Within a minute of the task being created. The alert itself can wait up to the workflow's 30 minutes, or arrive at once with your own hook on a self-hosted server.
Will the same alert make two pull requests? Not within 7 days, because the Idempotency-Key makes a repeated alert a Duplicate. After that, the playbook's check for an open pull request ends the task in one line.
Can the agent dismiss alerts? It could, with your GitHub CLI login, but the playbook never asks it to: dismissing an alert is a judgment call. The playbook leaves a task open for you when there is no patched version or the upgrade breaks the tests.
Does Dependabot's own pull request make this redundant? Dependabot security updates open a pull request too, but they do not fix code that breaks with the new version. This setup gives the agent the alert with your repository's tests and rules, and it tells you what breaks when it cannot finish. To fix a failing Dependabot pull request instead, route ci.failed from the github hook for dependabot/* branches, as in fix a red main build.