Inferensys

Prompt

Configuration Drift Incident Postmortem Prompt

A practical prompt playbook for SRE teams using AI to generate structured, evidence-grounded postmortems from configuration-drift incidents. Includes a copy-ready template, variable definitions, output schema, evaluation rubric, and failure mode analysis.
AI evaluator reviewing output quality on laptop, comparison metrics visible, casual evaluation session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise conditions, required inputs, and inappropriate use cases for the Configuration Drift Incident Postmortem Prompt.

This prompt is designed for Site Reliability Engineers (SREs) and platform engineering teams who need to produce a blameless, structured postmortem after a confirmed configuration-drift incident. The core job-to-be-done is transforming raw forensic evidence—such as chat transcripts, monitoring alerts, Infrastructure-as-Code (IaC) diffs, and audit logs—into a coherent document that identifies the root cause, assesses customer impact, and defines actionable prevention items. It is not a real-time diagnostic tool; it assumes the incident is resolved and the system is stable.

To use this prompt effectively, you must provide a complete incident context. This includes a detailed timeline of events, relevant chat logs (e.g., Slack, PagerDuty transcripts), specific monitoring alerts that fired, and the exact IaC or configuration diffs that represent the drift. The prompt is engineered to correlate these inputs, distinguishing between a manual emergency fix that was never codified and a failure in an automated reconciliation loop. Do not use this prompt during an active incident when the root cause is still unknown or when the system is in a degraded state; it requires a post-resolution context to avoid hallucinating a timeline or misattributing cause. Similarly, avoid using it for simple, single-resource drifts that don't warrant a full postmortem process.

Before executing this prompt, validate that your input data is complete and redacted. Remove any secrets, PII, or sensitive credentials from chat logs and diffs before they enter the model's context window. The output is a structured markdown document, but it is a draft that requires human review. An SRE must verify the model's root cause analysis against their own understanding of the system and ensure that all proposed prevention items are practical and prioritized correctly. The next step after generation is to circulate this draft for stakeholder review, not to publish it directly.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Configuration Drift Incident Postmortem prompt works and where it introduces operational risk.

01

Good Fit: Structured Incident Retrospectives

Use when: You have a complete incident timeline, chat logs, and change records from a confirmed configuration drift event. The prompt excels at synthesizing these sources into a blameless postmortem with root cause analysis, detection gaps, and actionable prevention items. Guardrail: Ground every section in explicit source references to prevent hallucinated timelines or causes.

02

Bad Fit: Real-Time Incident Response

Avoid when: The incident is still active and you need immediate remediation steps. This prompt is designed for post-incident analysis, not live triage. Using it during an active event will produce a speculative narrative rather than actionable commands. Guardrail: Route active incidents to a runbook or remediation prompt first; only invoke this postmortem prompt after the incident is closed.

03

Required Inputs: Evidence Grounding

What to watch: The prompt requires a detailed incident timeline, chat transcripts, change records, and monitoring alerts. Without these, the model will fabricate plausible but incorrect sequences of events. Guardrail: Validate that all required input fields are populated before generation. If evidence is missing, flag the section as incomplete rather than synthesizing filler content.

04

Operational Risk: Blame Language Leakage

What to watch: Even with blameless instructions, the model may attribute actions to specific individuals from chat logs, undermining psychological safety. Guardrail: Implement a pre-processing step to anonymize names and roles in source material, and add explicit output constraints prohibiting individual attribution in the final postmortem.

05

Operational Risk: Detection Gap Speculation

What to watch: The model may invent monitoring gaps or suggest detection mechanisms that don't exist in your observability stack, creating false remediation items. Guardrail: Cross-reference suggested detection improvements against your actual monitoring inventory. Flag any recommendation that references non-existent tooling for human review before the postmortem is finalized.

06

Operational Risk: Severity Inflation

What to watch: The model may overstate incident impact or severity to match the formal tone of a postmortem, leading to misallocated remediation resources. Guardrail: Require explicit severity scoring against your organization's incident classification rubric. If the model's impact assessment doesn't cite specific metrics from the timeline, escalate for human review.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt template for generating a structured postmortem from a configuration-drift incident, with placeholders for incident-specific data.

This prompt template is designed to be pasted directly into your AI system. It enforces a structured output, evidence grounding, and a clear separation of facts from interpretation. Before execution, replace every square-bracket placeholder with data from your incident: the timeline, chat logs, monitoring alerts, and the specific systems affected. The prompt is built to produce a consistent postmortem that an SRE team can immediately review, rather than a generic summary that requires heavy editing.

text
You are an SRE postmortem analyst. Your task is to generate a structured incident postmortem for a configuration-drift event.

You must ground every finding in the provided evidence. Do not invent details. If evidence is missing for a section, state 'Insufficient evidence provided' and explain what is needed.

[INCIDENT_SUMMARY]: A brief, factual description of the incident, including the service(s) affected, the duration of user impact, and the triggering detection method.

[TIMELINE]: A chronologically ordered list of events from the incident. Each event must include a timestamp, the actor or system, the action taken, and the observed effect. Source these from the provided chat logs and monitoring data.

[ROOT_CAUSE]: A detailed analysis of the root cause. Distinguish between the direct trigger (the specific configuration change) and any contributing factors (e.g., insufficient testing, lack of guardrails, manual intervention).

[IMPACT_ASSESSMENT]: Quantify the blast radius. Include the number of users affected, the duration of the outage or degradation (MTTD/MTTR), and any data loss, financial impact, or SLA breach.

[DETECTION_GAP_ANALYSIS]: Identify gaps in monitoring, alerting, and testing that allowed the drift to reach production or delayed its detection. Explain why existing checks failed to catch the change.

[PREVENTION_ITEMS]: A list of concrete, actionable, and trackable action items to prevent recurrence. Each item must have an owner and a proposed implementation approach. Categorize items as 'Immediate Fix', 'Process Change', or 'System Hardening'.

[OUTPUT_SCHEMA]:
{
  "incident_summary": "string",
  "timeline": [{"timestamp": "string", "actor": "string", "action": "string", "effect": "string"}],
  "root_cause": {"direct_trigger": "string", "contributing_factors": ["string"]},
  "impact_assessment": {"affected_users": "number", "duration_minutes": "number", "mttd_minutes": "number", "mttr_minutes": "number", "data_loss": "string", "sla_breach": "boolean"},
  "detection_gap_analysis": [{"gap": "string", "why_it_failed": "string"}],
  "prevention_items": [{"action": "string", "owner": "string", "category": "Immediate Fix | Process Change | System Hardening", "implementation_approach": "string"}]
}

[CONSTRAINTS]:
- Do not assign blame to individuals. Focus on systems and processes.
- Use precise timestamps (UTC) from the evidence.
- If a metric is unknown, use null, not a guess.
- The postmortem must be self-contained and understandable without external context.

[EVIDENCE]:
- Incident chat logs: [CHAT_LOG_TEXT]
- Monitoring alerts: [ALERT_LOG_TEXT]
- IaC change history: [IAC_DIFF_TEXT]
- Live state snapshot: [LIVE_STATE_TEXT]

To adapt this template for your own runbooks, replace the evidence placeholders with your actual data sources. For high-severity incidents, add a [HUMAN_REVIEW] step before the final postmortem is published. The structured [OUTPUT_SCHEMA] is critical for programmatic consumption; ensure your application harness validates the JSON against this schema and rejects malformed responses. For recurring use, wire this prompt into a system that automatically fetches chat logs and IaC diffs from your incident management and version control APIs.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated before the prompt is sent to the model. Incomplete or poorly formatted inputs produce unreliable postmortems.

PlaceholderPurposeExampleValidation Notes

[INCIDENT_TIMELINE]

Chronological sequence of events during the incident, including detection, escalation, and resolution times

14:03 UTC - Monitoring alert fired for prod-us-east-1; 14:07 - On-call acknowledged; 14:12 - Rollback initiated

Must contain at least 3 timestamped events. Parse each line for ISO-8601 or UTC timestamp prefix. Reject if timeline is empty or contains only a single event.

[CHAT_TRANSCRIPT]

Full incident chat log from Slack, Teams, or PagerDuty containing responder discussion and decisions

Copy-pasted channel export with timestamps and usernames preserved

Must exceed 200 characters. Strip attachment URLs and bot messages before injection. Reject if transcript contains only automated alerts with no human discussion.

[DRIFT_DETECTION_SOURCE]

Tool or system that first identified the configuration drift

Terraform plan diff, AWS Config rule, custom drift-detector cronjob

Must match one of the allowed enum values: terraform, cloudformation, pulumi, aws_config, gcp_config, azure_policy, custom_detector, manual_observation. Reject unknown sources.

[DRIFTED_RESOURCES]

List of specific resources that diverged from desired state, with before and after property values

aws_iam_role.pipeline_role: assume_role_policy.Statement[0].Principal.Service changed from codepipeline.amazonaws.com to ec2.amazonaws.com

Must be a non-empty list. Each entry requires resource identifier, property path, expected value, and observed value. Reject if any entry is missing the observed value field.

[DESIRED_STATE_SOURCE]

Git commit SHA or artifact reference representing the intended configuration at time of incident

main branch commit a1b2c3d, Helm release chart version 2.4.1, Terraform state snapshot s3://bucket/state.json

Must be a non-empty string. Validate format: Git SHA (40-char hex), semver tag, or valid S3/GCS/ABS URI. Reject if source is 'unknown' or 'not tracked'.

[INCIDENT_SEVERITY]

Declared severity level of the incident per organizational taxonomy

SEV2 - Partial service degradation affecting <25% of users

Must match severity enum: SEV0, SEV1, SEV2, SEV3. Reject if severity does not align with impact description in [IMPACT_ASSESSMENT].

[IMPACT_ASSESSMENT]

Measurable impact on users, revenue, or dependent services during the incident window

API error rate increased from 0.1% to 4.7% for 23 minutes; 1,200 failed checkout attempts

Must contain at least one quantified metric with duration. Reject if impact is described only qualitatively without numbers or time ranges.

[POST_INCIDENT_ACTIONS]

List of remediation actions already taken before postmortem generation

Reverted IAM role policy to last known good version; deployed hotfix v2.4.2; added drift alert for assume_role_policy changes

Must be a non-empty list. Each action requires a description and completion status. Reject if all actions are marked 'pending' with no completed remediation.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Configuration Drift Incident Postmortem Prompt into a reliable, auditable application workflow.

This prompt is designed to be called after an incident closes, not during active triage. The harness must assemble a structured input payload from your incident management system (e.g., PagerDuty, FireHydrant, Jira) and chat transcripts (Slack, Teams). The prompt expects a timeline of events, a list of detected drift findings, and relevant chat logs. Do not pass raw, unprocessed logs—pre-process them into a chronological timeline with timestamps, actor identities, and actions taken. The model performs best when the input is already organized; it should not be asked to reconstruct a timeline from scattered fragments.

Implement a validation layer that checks the model's output against a strict JSON schema before the postmortem is accepted. Required fields include incident_id, timeline (array of events with timestamp, action, actor), root_cause (object with primary_cause and contributing_factors), impact (object with duration_minutes, affected_services), detection_gap (string), and prevention_items (array of strings). If the output fails schema validation, retry up to two times with a more explicit error message appended to the prompt. After two failures, route the raw output to a human reviewer in a draft queue rather than publishing an incomplete postmortem. Log every attempt, the validation errors, and the final disposition for auditability.

For model selection, use a model with strong structured output capabilities and a large context window (e.g., Claude 3 Opus or GPT-4 Turbo) because incident timelines and chat logs can be lengthy. Enable structured output mode if the provider supports it (e.g., JSON mode or function calling with a strict schema) to reduce post-generation repair. If your incident data contains sensitive information—PII in chat logs, internal IP addresses, or secret names—run a redaction step before the prompt assembly. The prompt template's [REDACTED_LOG] placeholder should receive sanitized text. Never pass raw secrets or customer data into the model context. Store the final approved postmortem in your incident knowledge base and link it back to the source incident for future reference and pattern analysis.

IMPLEMENTATION TABLE

Expected Output Contract

The model must return a valid JSON object matching this schema. Validation should reject outputs that deviate from these rules.

Field or ElementType or FormatRequiredValidation Rule

postmortem_id

string (slug)

Must match pattern ^PM-[0-9]{4}-[a-z0-9]+$. Reject if missing or malformed.

incident_summary.title

string

Length 10–120 characters. Must not be generic placeholder text like 'Incident Summary'. Reject if empty or over length.

incident_summary.start_time

ISO 8601 datetime

Must parse as valid datetime. Must be before end_time. Reject if unparseable or inverted.

incident_summary.end_time

ISO 8601 datetime

Must parse as valid datetime. Must be after start_time. Reject if unparseable or inverted.

timeline

array of objects

Minimum 1 entry. Each entry must have timestamp (ISO 8601), event (string 10–500 chars), source (enum: 'automated_detection','human_report','log_evidence','chat_log'). Reject if empty or any entry fails enum check.

root_cause.primary_cause

string

Length 20–500 characters. Must reference a specific configuration artifact or automation failure. Reject if vague (e.g., 'human error' without detail).

root_cause.contributing_factors

array of strings

If present, each string must be 10–200 characters. Null allowed. Reject if array contains empty strings.

detection_gap.time_to_detect_minutes

integer

Must be >= 0. Reject if negative or non-integer. Set to 0 if detection was immediate.

prevention_items

array of objects

Minimum 1 entry. Each entry must have action (string 20–300 chars), owner (string matching team slug pattern ^team-[a-z-]+$), priority (enum: 'critical','high','medium','low'). Reject if empty or any field fails validation.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when generating a postmortem from a configuration-drift incident and how to guard against it.

01

Hallucinated Timeline Events

What to watch: The model invents specific timestamps, commands, or user actions not present in the provided incident timeline or chat logs. This is common when the prompt implies a level of detail the source material lacks. Guardrail: Require the model to cite a source log line or chat message for every timeline entry. Implement a post-generation validator that flags any event without a corresponding source reference.

02

False Root Cause Attribution

What to watch: The model confidently asserts a single root cause based on correlation rather than evidence, ignoring the possibility of multiple contributing factors or an unknown cause. Guardrail: Structure the output schema to require a 'confidence' field for the root cause and a separate 'contributing factors' list. Add an eval check that fails the postmortem if the root cause is stated with high confidence but lacks direct evidence from the provided logs.

03

Generic Prevention Items

What to watch: The model generates vague, unactionable prevention items like 'improve monitoring' or 'add more tests' instead of specific, trackable remediation tasks tied to the incident's details. Guardrail: Add a constraint in the prompt requiring each prevention item to be a specific, verifiable action (e.g., 'Add a CloudTrail alert for manual S3 policy modifications on production buckets'). Use a rubric to score actionability during evaluation.

04

Ignoring Detection Gaps

What to watch: The postmortem focuses heavily on the fix but glosses over the detection gap analysis, failing to answer how long the drift existed before it was noticed and why. Guardrail: Dedicate a required, non-negotiable section in the output schema to 'Detection Gap Analysis.' The prompt must explicitly instruct the model to calculate time-to-detect from the provided timeline and analyze the monitoring signals that were missed or absent.

05

Blameless Language Drift

What to watch: The model slips into accusatory language (e.g., 'the engineer mistakenly ran...') instead of focusing on systemic failures, especially when the source chat logs contain frustrated or blaming language. Guardrail: Include a strong, positive instruction in the system prompt: 'Use blameless language. Frame all actions in terms of system failures, process gaps, or tooling limitations, never individual error.' Use an LLM judge to score the output for blamelessness.

06

Inconsistent Severity Assessment

What to watch: The model misjudges the incident's severity, either downplaying a critical outage or overstating a minor blip, leading to an inappropriate level of postmortem rigor and misallocated remediation effort. Guardrail: Provide a clear severity level definition matrix in the prompt context. Ask the model to first classify the incident against this matrix based on user impact and duration before writing the rest of the report, and include this classification in the output.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each generated postmortem against these criteria before accepting it for human review. A passing score is 80/100 or higher.

CriterionPass StandardFailure SignalTest Method

Timeline Completeness

All events from [INCIDENT_TIMELINE] are present in chronological order with UTC timestamps

Missing events, out-of-order entries, or timestamps in wrong timezone

Parse output JSON; diff event IDs against input timeline; validate ISO-8601 timestamps

Root Cause Accuracy

Root cause matches the [KNOWN_ROOT_CAUSE] and cites specific config key or resource that drifted

Vague root cause, wrong resource blamed, or no config key cited

String match root cause field against ground truth; require at least one specific config key reference

Impact Quantification

Impact section includes duration, affected services, and user-facing symptom from [IMPACT_SUMMARY]

Missing duration, missing service names, or impact described as 'unknown' without justification

Schema check for duration_seconds, affected_services array, user_impact string; all must be non-null

Detection Gap Analysis

Identifies time delta between drift occurrence and detection with specific monitoring gap

Detection gap left blank, says 'N/A' without evidence, or blames humans without system gap

Assert detection_gap_minutes > 0; require at least one monitoring tool or alert name mentioned

Prevention Items Specificity

At least 3 prevention items, each with owner, action type, and link to a drift class from [DRIFT_CLASSIFICATION]

Generic items like 'improve monitoring', missing owners, or fewer than 3 items

Count prevention_items array; each must have owner, action, drift_class fields; reject empty owner

Evidence Grounding

Every claim in root cause and timeline sections cites a source from [EVIDENCE_LOG] or [CHAT_TRANSCRIPT]

Unsupported claims, hallucinated events, or citations to sources not in provided evidence

Extract all citation references; cross-check against evidence log IDs; flag orphans for human review

Action Item Assignability

All action items have a single named owner, a deadline, and a verifiable completion condition

Action items assigned to teams not individuals, missing deadlines, or vague completion criteria

Schema validate each action item for owner (string, not 'TBD'), deadline (ISO-8601 date), and acceptance_criteria (non-empty)

Severity Classification Consistency

Severity level matches [SEVERITY_CLASSIFICATION] and justification references defined severity policy

Severity mismatched with policy, no justification, or severity inflated/downplayed relative to impact

Compare severity field to expected value; assert justification field references policy document or criteria

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Add strict JSON output schema, required fields, evidence grounding rules, and eval checks. Wire the prompt into an incident management pipeline that feeds structured incident data, audit logs, and chat transcripts as [CONTEXT].

  • Set [OUTPUT_SCHEMA] to a typed JSON object with fields: incident_id, severity, timeline[] (with timestamp, event, source), root_cause (with drifted_resource, expected_state, actual_state, change_source), detection_gap_minutes, impact (with services_affected, duration_minutes, customer_impact), prevention_items[] (with action, owner, type).
  • Add [CONSTRAINTS]: "Every timeline event must cite a source log entry or chat message. Every prevention item must map to a root cause finding."
  • Implement a retry loop: if the output fails schema validation, feed the validator errors back into the prompt as [REPAIR_CONTEXT].

Watch for

  • Silent format drift when the model nests objects differently across runs.
  • Missing human review gate before the postmortem is published to stakeholders.
  • Prevention items that are generic ("improve monitoring") instead of specific ("add alert on desired_count drift for ECS service X with threshold 1").
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.