Building an AI Incident Copilot: How I Automated the First 15 Minutes of Every Production Incident

Sudhakararao Sajja ยท article ยท 2026-07-07 source โ†— Reader ๐Ÿ–ฅ๏ธ

Capacity to Verify AI OutputData SovereigntyGuardrailsHuman-in-the-LoopIronies of AutomationSRE & Incident ResponseAI Workflow Patterns
The mechanical, judgment-free first phase of incident response โ€” SSHing in, pulling logs from multiple sources, scanning for known failure patterns, and mapping them to the Four Golden Signals โ€” is repetitive search rather than debugging, so it can be automated into a deliberately read-only, locally-run CLI that hands the responder a structured incident brief in under a minute, reserving the actual diagnosis and any state-changing action for the human.

practical ยท build log / how-to โ€” a first-person 'how I built it' walkthrough of an open-source CLI (incopilot): architecture, module pipeline, setup commands, and design-decision rationale, ending with a roadmap โ€” A ~820-word single-practitioner build log for an open-source Python tool that automates first-pass incident triage. It is prescriptive and rationale-driven ('why Python', 'why read-only', 'why local'), grounded in the author's own on-call experience rather than in measured outcomes โ€” the test of every claim is 'does this get you to diagnosis faster', asserted, not demonstrated. The 'AI' framing is largely aspirational: the shipped version is deterministic pattern-matching, with LLM summarization named only as a future roadmap item.

Structure

PartRole
Opening pain narrative: the 2am on-call ritual (alert fires, SSH in, pull logs, guess what to check), 15-45 minutes of repetitive, stressful, automatable toil per incident, multiplied into thousands of lost engineering hoursmotivation / problem framing
'Why the first 15 minutes are the hardest': the first phase is searching, not debugging; logs contain the answer almost every time; automated search can do in <60s what a human does in 15 minutescore thesis / warrant
Architecture: four modules โ€” collectors (journalctl / docker / files), analyzer (pattern detection + line normalization), reporter (Four Golden Signals map -> report.md + report.json), config (patterns, golden-signal map, safe-command list)mechanism / how-it-works
Setup + output: two-minute install, sample-log quick test, systemd/docker runs; every run emits report.md (paste into incident doc / Slack / PagerDuty) and report.json (POST to webhook / attach to JIRA / pipe downstream)how-to / demonstration of the deliverable
Design decisions worth explaining: Python (to bolt on LLM summarization later), read-only (cannot make a bad incident worse; runnable by any on-call engineer), local execution (no external API calls; data residency / security-sensitive environments)rationale / defense of constraints
What to improve next: per-service pattern packs (nginx, postgres, Java, Node), Slack/Teams webhook posting, unit tests + CI, optional LLM summarization layerroadmap

Key terms

Propositions

Arguments

The mechanical first-pass of production-incident triage should be automated into a read-only, locally-run CLI so responders start from a structured brief and reserve their judgment for diagnosis and action.
Explicit premises:
Implicit premises:
Inferences:

Narratives

Questions addressed

Gaps

Related documents