Stop maintaining runbooks. Generate them at page time from the alert payload.
Most on-call runbooks are lies. They were written eighteen months ago by an engineer who has since left, they reference a load balancer that was replaced during the last migration, and the one command that actually mattered was never written down because the person who knew it just typed it from memory every time. We all know this. We still page people at 3am and point them at a wiki page nobody has opened since the last audit.
I spent the last few weeks attacking this from a different angle. Instead of trying to keep a library of static runbooks fresh, I started generating them on demand from the alert payload itself. The alert already contains almost everything you need. A CloudWatch alarm tells you the metric, the namespace, the exact dimensions, the threshold, the evaluation window, the datapoints that breached, the account and the region. A PagerDuty incident carries the service, the escalation policy, the priority and the full trigger log entry. A Datadog monitor gives you the query, the scope and the tags. That is dense, structured, high signal context. It is exactly the kind of input a language model reasons over well.
The pipeline is boring in the best way. Alert fires. Webhook or SNS topic hands the JSON to a small script. The script normalises the payload into a common shape, merges it with a static environment context file that describes your org, your clusters, your escalation tiers and your hard rules, and sends the whole thing to Claude with a strict output contract. Ninety seconds later the responder has a document with a summary, immediate actions, a ranked table of diagnostic commands, escalation criteria, three hypothesised root causes with remediation and rollback for each, and a pre-filled post-mortem template.
The part that surprised me was the diagnostic ordering. I asked the model to sort commands by information gain per second rather than by category, and to state which hypothesis each command discriminates between. That single instruction turned a generic checklist into something that reads like a decision tree. For a checkout API 5xx alarm it opened with the target group health check and the deployment history, not with CPU graphs, because CPU is almost never the discriminator on a sudden error rate spike.
Two things I got wrong early. First, I let the model invent resource names. It produced beautiful runbooks full of ARNs that did not exist. The fix was a hard rule in the system prompt: emit a TODO token for anything you cannot source from the payload or the context file, and list every token at the bottom. Second, I briefly wired the output into an auto-remediation path. Do not do this. The runbook is a draft for a human. Mark destructive steps, require a second pair of eyes, and keep the model firmly on the advisory side of the line.
Cost is roughly two to four cents per runbook at current Sonnet pricing. Against thirty to sixty minutes of an engineer's night flailing for context, that is not a close call.
What is the most out of date thing sitting in your runbook wiki right now, and when did you last actually open it during a real incident?
3-minute video version: https://youtu.be/DxjH2HcUVAw
0
0 comments
Richard Skacel
2
Stop maintaining runbooks. Generate them at page time from the alert payload.
powered by
AI for Cloud Engineers
skool.com/cloud-cost-optimization-3746
Claude Code & AI agents for cloud engineers. Automate AWS, Azure, GCP, K8s and Terraform without deleting prod. Free scripts, real labs.
Build your own community
Bring people together around your passion and get paid.
Powered by