Ai Assisted Post Incident Review
Overview
Your incident is resolved. The service is back up. Your team is exhausted. The last thing they want to do is write a post-incident review (PIR). So they skip it, or write a hasty 5-minute version that misses context and learnings.
This lesson teaches you to automate the PIR process so that documentation is thorough without requiring hours of manual writing.
Purpose
Post-incident reviews serve three critical functions:
- Accountability: Document what happened and how long it took
- Learning: Identify systemic issues so we don't repeat the same incident
- Improvement: Extract action items that prevent recurrence
But they take time. Manual PIR writing: 2-4 hours. Most teams skip them or write superficial versions. Then the same incident happens again 3 months later because they never documented the fix.
AI can generate draft PIRs with timelines, root cause summaries, and action items. Humans review and refine. Result: thorough documentation in 30 minutes instead of 4 hours.
Why This Matters
A company had the same database connection pool exhaustion incident three times in one year. Each time, they fixed it temporarily by increasing pool size. But they never documented the permanent fix (connection pooling library upgrade). Each incident took 4+ hours to resolve because the team forgot what they'd learned from the previous occurrence.
With AI-assisted PIR, the first incident would have generated documentation: "Root cause: connection pooling library v2.1 exhausts connections under load. Permanent fix: upgrade to v3.0. Timeline: Q2 2024." The second incident would have referenced this PIR and implemented the permanent fix immediately. The third incident would never have happened.
Core Concepts
Key insight: PIR generation has three steps
Step 1: Timeline extraction (automated)
- When did the incident start?
- When was it detected?
- When was it escalated?
- When was the engineer engaged?
- When was the root cause found?
- When was the fix applied?
- When was it verified?
- When was it resolved?
From incident logs and timestamps, AI reconstructs the timeline:
2024-05-10 02:15 - Alert fires (database latency spike)
2024-05-10 02:17 - Alert detected, incident created
2024-05-10 02:19 - On-call engineer paged
2024-05-10 02:22 - Engineer joins incident
2024-05-10 02:35 - Root cause hypothesis: recent config change
2024-05-10 02:40 - Root cause confirmed
2024-05-10 02:45 - Fix applied (rollback to previous config)
2024-05-10 02:46 - Error rate drops to normal
2024-05-10 02:50 - Incident resolved, all systems normal
Step 2: PIR draft generation (automated)
- Incident summary (what happened, how long, impact)
- Timeline (extracted above)
- Root cause (why it happened)
- Resolution (how it was fixed)
- Actions (what to do next)
Step 3: Human review and refinement
- Does the timeline match your recollection?
- Is the root cause explanation clear and accurate?
- Are the action items reasonable?
- Is the tone professional and blameless?
Only then publish.
Key insight: Blameless POV requires careful language
PIRs can destroy team morale if written with blame. "John applied a bad config change and didn't test it." Blame language causes people to hide errors, stop taking risks, and leave the company.
Blameless PIRs focus on systems, not people: "Configuration change process lacks validation step. No test environment available for DBA to safely test config. Missing monitoring alert for this class of failure."
AI can help by:
- Generating neutral language by default
- Flagging blame-like language for human review
- Reframing as systemic opportunities
Example:
Draft (blame-y): "DBA made a mistake by applying config without testing"
AI reframe: "Process improvement opportunity: Add validation step to config deployment. Add alert for connection pool exhaustion."
Key insight: Pattern extraction identifies systemic issues
Over time, PIRs reveal patterns:
- The same root cause recurring (different surface symptoms)
- Related failure modes happening across services
- Common underlying issues (missing monitoring, gaps in runbooks, dependencies not documented)
AI can extract these patterns:
Last 3 months of incidents:
1. Database connection pool exhaustion (May 10)
2. API connection pool timeout (May 23)
3. Cache connection leak (June 5)
Pattern detected: Connection pooling issues across multiple systems
Systemic opportunity: Implement connection pool monitoring across all services.
Add alerts for pool exhaustion, implement connection pool upgrade/redesign project.
Key insight: Action items need owners and deadlines
A PIR might identify 20 improvement opportunities. If none of them get assigned or tracked, nothing changes.
AI can suggest owners and timelines:
Action items:
1. Add validation to config deployment (Owner: DBA team, Target: May 20)
2. Document config change process (Owner: Technical writer, Target: May 25)
3. Upgrade database pooling library v2.1 → v3.0 (Owner: Database team, Target: June 10)
4. Monitor connection pool exhaustion (Owner: Monitoring team, Target: May 30)
Humans review and confirm owners/deadlines. Then track to completion.
Key insight: Feedback feeds continuous improvement
PIR action items should be tracked. Did we actually upgrade the database library? Did the config validation actually prevent the issue?
Action item: "Implement config validation for database changes"
Status after 1 month: ✓ Complete (deployed May 25)
Follow-up incident: "Similar config issue"
Root cause: Config was validated, but validation logic missed this edge case
Lesson: Validation rules need to be more comprehensive
Next action: Review validation rules quarterly, test against actual incident scenarios
Practical Use Cases
Use Case 1: Automated PIR for Payment Service Outage
Incident: Payment processing service down for 8 minutes. $40k in lost revenue.
STEP 1: Timeline Extraction (Automated)
Query incident logs, metrics, change logs:
02:15:00 - Monitoring: Payment service error rate 100%
02:15:02 - Alert fires: "Payment service down"
02:15:30 - Incident created: INC-2024-05-001
02:16:15 - On-call engineer paged
02:17:00 - Engineer joins incident (Slack: "I'm on it")
02:18:00 - Engineer: "Checking metrics... looks like recent deployment"
02:18:45 - Change log: payment-service v2.3 deployed 02:10 (5 min before incident)
02:20:00 - Engineer: "Initiating rollback"
02:22:00 - Deployment: payment-service rollback to v2.2 complete
02:22:30 - Monitoring: Error rate drops to 0%
02:23:00 - Incident resolved
STEP 2: Draft PIR Generation (Automated)
---
# Post-Incident Review: Payment Service Outage
Date: 2024-05-10
Duration: 8 minutes (02:15-02:23)
Severity: Critical
Impact: Payment processing unavailable, ~$40k revenue lost, 500 transactions failed
Timeline
- 02:15 - Incident detected: error rate 100%
- 02:16 - Incident created, on-call engineer notified
- 02:17 - Engineer engaged
- 02:18 - Root cause identified: recent deployment (v2.3)
- 02:20 - Rollback initiated
- 02:22 - Rollback complete, service recovered
- 02:23 - Incident resolved
Summary
Payment service v2.3 deployment caused immediate service failure. Root cause: new version introduced connection pool leak that exhausted available connections within 5 minutes. Engineers identified root cause by correlating incident timing with recent deployment, rolled back to v2.2. Service restored.
Root Cause
Payment service v2.3 introduced a connection pool leak in the database connector. Under load, connections are acquired but not properly released. After 5 minutes of operation, all 100 available connections exhausted, new requests fail with connection timeout.
Root cause analysis: Code review of v2.3 shows new connection handling logic added. Logic acquires connection for caching but doesn't release in error path. Bug in error handling.
Resolution
Rolled back payment-service from v2.3 to v2.2. Service immediately recovered.
What Went Well
- Rapid detection (2 minutes from incident to alert)
- Rapid diagnosis (3 minutes to identify deployment as cause)
- Rapid rollback (2 minutes to deploy rollback)
- Communication (engineer kept team updated)
What Didn't Go Well
- Deployment testing didn't catch connection pool leak
(Load testing in staging didn't simulate 100% concurrent connections)
- No pre-deployment validation for resource leaks
(Code review looked for logic, not for resource cleanup)
Action Items
1. Code review: Add connection pool leak detection to payment-service v2.3. Fix and retest. (Owner: Payment service team, Target: 2024-05-15)
2. Testing: Add load test that monitors connection pool exhaustion to CI/CD pipeline. (Owner: QA team, Target: 2024-05-20)
3. Monitoring: Add alert for connection pool usage >80% for all services. (Owner: Monitoring team, Target: 2024-05-17)
4. Deployment process: Add pre-deployment security and resource leak check using static analysis. (Owner: Platform team, Target: 2024-06-01)
5. Runbook: Document "Connection pool exhaustion" diagnosis and remediation. (Owner: DBA team, Target: 2024-05-12)
STEP 3: Human Review (Engineering team lead)
Review the draft:
- Timeline: ✓ Correct
- Root cause: ✓ Accurate
- What went well: ✓ Good observations
- What didn't go well: Could add "No pre-incident load testing"
- Action items: ✓ All reasonable, owners assigned
Minor edits:
- Refine language in "What Didn't Go Well" section
- Add clarity to action items (what exactly should the code review find?)
- Confirm owners can commit to deadlines
Updated draft published.
STEP 4: Action Item Tracking
1 month later: Action 1 (Fix v2.3) - Complete ✓
1 month later: Action 2 (Load testing) - In progress (85% done)
6 weeks later: Action 3 (Monitoring alert) - Complete ✓
2 months later: Action 4 (Deployment checks) - Complete ✓
...
Follow-up incident (2 months later): "Similar connection pool leak in service-b"
Lesson: Action 4 didn't catch this because static analysis tool isn't comprehensive enough
New action: Expand static analysis rules or add runtime connection pool monitoring
Continuous learning: Each incident improves the system
Results:
- PIR writing time: 30 minutes (automated draft + human review) instead of 3 hours (manual)
- Coverage: Thorough documentation of timeline, root cause, and lessons instead of sketchy notes
- Follow-up: Action items tracked to completion, preventing recurrence
- Organizational learning: Patterns identified across incidents, systemic improvements made
Use Case 2: Identifying Patterns Across Incidents
You've had PIRs for the last 3 months. AI analyzes all of them:
Incident Summary (Last 3 months):
- 12 total incidents
- 3 caused by deployment issues (v25%, 8 incidents)
- 3 caused by configuration changes (25%)
- 2 caused by capacity limits (17%)
- 4 caused by external dependency failures (33%)
Pattern 1: Deployment issues (25% of incidents)
- Payment service v2.3: Connection pool leak
- Auth service v3.1: Memory leak
- API service v1.8: Dependency version mismatch
Root cause of root causes: Insufficient pre-deployment testing
Pattern 2: Configuration changes (25% of incidents)
- Database config change caused connection timeout
- Cache config change caused eviction issues
- Load balancer config change caused routing errors
Root cause of root causes: Configuration changes not tested in staging
Pattern 3: External dependency failures (33% of incidents)
- Payment gateway downtime
- Third-party API rate limiting
- Certificate expiration (SSL handshake failures)
Root cause of root causes: No backup/fallback for external dependencies
Pattern 4: Capacity limits (17% of incidents)
- Database connection pool exhaustion
- API rate limit hit
- Disk space full
Root cause of root causes: Capacity not monitored, scaling not automated
Systemic Improvements Recommended (ranked by impact):
1. Pre-deployment testing: Eliminate 25% of incidents
- Implement load testing for all services
- Test connection pool behavior
- Test memory usage over time
- Configuration management: Eliminate 25% of incidents
- Require staging validation for config changes
- Implement config validation rules
- Add monitoring for config parameter drift - Dependency resilience: Reduce 33% of incidents (to 20%)
- Implement circuit breakers for external APIs
- Add fallback strategies
- Monitor external service health proactively - Capacity monitoring: Eliminate 17% of incidents
- Add capacity alerts for connection pools, disk, API rate limits
- Implement auto-scaling
- Weekly capacity reviews
Implementation plan (next quarter):
- Month 1: Implement pre-deployment testing (Phase 1)
- Month 2: Implement configuration validation
- Month 3: Implement dependency resilience (Phase 1)
- Month 4: Implement capacity monitoring
Expected impact: Reduce incident frequency from 4/month to 1.5/month (62% reduction)
This analysis would take 5-10 hours manually (reading all PIRs, identifying patterns, designing improvements). AI does it in 5 minutes.
Anti-Patterns
Anti-Pattern 1: "PIRs are blame documents"
You publish a PIR with blame language: "Engineer didn't test the deployment properly." The engineer reads this, feels unfairly blamed, and starts hiding problems. Next time a mistake happens, they cover it up instead of escalating.
Why it fails: Blame kills psychological safety. Teams stop taking risks. Real problems get hidden until they become disasters.
How to avoid it: Use blameless language. Focus on systems, not individuals. "Testing process didn't catch connection pool leak" not "Engineer didn't test enough."
Anti-Pattern 2: "We write PIRs but don't track action items"
You generate a PIR with 10 action items. Nobody assigns owners. Nobody tracks progress. 3 months later, none of them are done, and the same incident happens again.
Why it fails: Action items without accountability don't get done. Without tracking, you can't see progress or hold people accountable.
How to avoid it: Every action item needs an owner and a deadline. Track them in JIRA or your project management tool. Review them monthly. Link follow-up incidents back to unfinished action items.
Anti-Pattern 3: "AI generates PIRs and we publish them without review"
You automate PIR generation and publish them without human review. Sometimes the AI gets the timeline wrong, or misunderstands the root cause, or generates inappropriate language.
Your team loses trust in PIRs because they're inaccurate.
Why it fails: PIRs are organizational documents. They need to be accurate and professional. AI-generated drafts are great, but they need human review.
How to avoid it: AI generates the draft. A human (incident commander or team lead) reviews it, corrects any errors, refines language, and approves before publication.
Anti-Pattern 4: "PIRs are written for compliance, not learning"
You write PIRs to satisfy audit requirements or compliance mandates. But you don't use them to actually improve. You don't track action items. You don't identify patterns. You don't change anything.
Why it fails: PIRs become box-checking exercises. They provide no value, so team members resent writing them.
How to avoid it: Use PIRs as a learning tool. Identify patterns. Prioritize systemic improvements. Track action items to completion. Show that PIRs lead to real changes.
Anti-Pattern 5: "We stored PIRs but can't retrieve them"
You've been writing PIRs for 2 years. But they're stored in random documents, old shared drives, and Slack channels. When a similar incident happens, nobody can find the previous PIR that analyzed the same root cause.
Why it fails: Organizational memory gets lost. The same incident repeats because you can't access past learnings.
How to avoid it: Store PIRs in a central location (knowledge base, wiki, or dedicated PIR system). Tag them by root cause, service, and pattern. Make them searchable. When a new incident happens, query past PIRs for similar cases.
Human Judgment Checkpoints
Timeline accuracy: Does the generated timeline match incident logs? Any gaps?
Root cause clarity: Is the root cause explained in a way a new engineer could understand?
Blameless language: Would the people involved feel fairly treated by this PIR? Or does it place blame?
Action items: Are action items specific and measurable? Do they have owners and deadlines?
Patterns: Looking across recent PIRs, what systemic issues emerge?
Key Takeaways
Automate timeline extraction. From incident logs and timestamps, AI can reconstruct an accurate timeline in seconds. This is the most tedious part of PIR writing.
AI drafts PIRs, humans review and refine. Automation speeds up the process (30 minutes instead of 3 hours), but human review ensures accuracy, clarity, and tone.
Use blameless language focused on systems. PIRs should identify systemic opportunities, not blame individuals. This maintains psychological safety and actually improves the organization.
Every action item needs an owner and deadline. Without accountability and tracking, action items don't get done.
Identify patterns across incidents. Monthly analysis of PIRs reveals systemic issues. Use these to prioritize improvements.
Store PIRs in a searchable knowledge base. Make them retrievable so future engineers can learn from past incidents.
Track action items to completion. Link follow-up incidents back to unfinished improvements. Use this to refine your improvement process.
Skill.re