AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Nov 6, 2026, 06:00 JST

Claude Code routine auto-investigates Sentry alerts

Send on LINE
Claude Code routine auto-investigates Sentry alerts

3 Key Points

  1. What happened

    A Sentry alert rule fires into an Internal Integration, which sends a signed webhook through a Cloudflare Workers relay that verifies Sentry-Hook-Signature and fires a Claude Code routine via API.

  2. Why it matters

    The routine re-reads the Sentry issue and logs, and if it is a bug, reads the repository code to pinpoint the cause — a setup that aims to cut the manual triage work of opening Sentry and logs each time an alert arrives.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

The setup starts from a concrete irritation: when a Sentry alert lands in Slack, telling whether it is an attack, a user action or a bug means opening Sentry and the logs, or handing them to an AI, every time. The pipeline automates that first pass. The relay is deliberately small — it verifies the HMAC-SHA256 signature in Sentry-Hook-Signature, filters to metric_alert (excluding resolved), event_alert and issue-creation events, and uses the Cache API for best-effort deduplication so the same alert does not fire repeatedly. It also trims the payload to fixed fields such as type, title, project, time and URL rather than passing Sentry's body through. Because the routine's fire API is not idempotent, retries are limited to 429, 5xx and network failures.

The security design assumes log contents are hostile: request paths and error messages are writable by outsiders, so the routine is built as if instructions could be planted there. Tool access is limited by configuration to Read, Glob and Grep — no shell, git or file editing — and Sentry connectors allow only read tools. For Slack, only slack_send_message is permitted. The stated aim is that even a planted instruction cannot rewrite and push code or delete an issue.

A separate cron-driven audit covers the whole log set on a schedule so alert-setting gaps are less likely to go unnoticed. On fixed runs it always posts results; on other runs it posts only when urgency is high.

FAQ
How does the routine get triggered without a person starting it?
A Sentry alert rule fires into an Internal Integration, which sends a signed webhook to a Cloudflare Workers relay. The relay verifies Sentry-Hook-Signature with the Client Secret and calls the Claude Code routine's fire API.
What safety limits are placed on the routine?
The routine is restricted to Read, Glob and Grep tools — no shell, git or file editing. Sentry write tools are disallowed, and for Slack only slack_send_message is permitted.
What happens if a log message contains an injected instruction?
The design assumes request paths and error messages can be written by outsiders and may carry injected instructions. Even then, the routine cannot rewrite and push code or delete issues, according to the setup.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleMeta's Muse AI agent adds real-time voice and animated avatars