Inferensys

Prompt

Postmortem Timeline Reconstruction Prompt

A practical prompt playbook for using the Postmortem Timeline Reconstruction Prompt in production incident analysis workflows.
Elegant overhead shot of a polished wooden communal table in a sun-drenched WeWork lounge, laptops and tablets displaying AI workflow dashboards, plants and pendant lights in background.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the ideal workflow, user, and prerequisites for using the Postmortem Timeline Reconstruction Prompt, and clarifies when it should not be used.

This prompt is built for incident analysts and SREs who need to construct a blameless postmortem timeline from fragmented operational data after an incident is resolved. The core job-to-be-done is transforming a messy collection of monitoring alerts, deployment events, chat transcripts, and human action records into a single, causally-linked, and review-ready artifact. The ideal user has already completed the incident response and gathered all relevant raw event streams; they are now entering the post-hoc analysis phase and need a structured narrative, not a real-time dashboard.

You should use this prompt when you have a complete or near-complete dataset from the incident window and need to identify the sequence of events, detection-to-resolution markers, and contributing factors. The prompt assumes you can provide data sources like PagerDuty alerts, CI/CD deploy logs, Slack threads, and runbook execution timestamps. It is not designed for real-time incident command, where an on-call engineer needs to query live metrics or execute remediation steps. Do not use this prompt if your primary goal is to assign blame, as the instructions are explicitly tuned for blameless analysis and causal reasoning.

Before executing this prompt, verify that you have sanitized any sensitive data from chat logs and that timestamps across different systems are normalized to a single timezone. The output is a structured timeline meant for human review and collaborative editing, not a final, publish-ready document. If the incident involves ongoing legal review or external regulatory reporting, the generated timeline must be treated as a draft and reviewed by legal or compliance teams before any external distribution.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Postmortem Timeline Reconstruction Prompt delivers reliable value and where it introduces unacceptable risk. Use these cards to decide whether this prompt fits your incident review workflow.

01

Good Fit: Multi-Source Incident Synthesis

Use when: you have monitoring alerts, deployment events, chat logs, and human action records that need to be merged into one coherent timeline. Guardrail: require each timeline entry to cite its source, and flag entries with conflicting timestamps for human resolution.

02

Bad Fit: Single-Source or Low-Volume Incidents

Avoid when: the incident involves only one system, one alert, or a single actor. Guardrail: use a simpler incident summary prompt instead. Timeline reconstruction adds unnecessary complexity and hallucination risk when there is little to correlate.

03

Required Inputs: Timestamped Event Streams

What to watch: the prompt cannot reconstruct a timeline without timestamped events from monitoring, deployment, chat, and change management systems. Guardrail: validate that all input sources include timestamps before invoking the prompt. Reject inputs with missing or ambiguous time data.

04

Operational Risk: Causal Overreach

What to watch: the model may infer causal links between events that are merely temporally correlated. Guardrail: require the output to label causal claims as 'hypothesis' unless confirmed by explicit evidence. Human reviewers must approve all causal links before the postmortem is finalized.

05

Operational Risk: Blame Language Leakage

What to watch: even with blameless instructions, the model may attribute actions to individuals in ways that imply fault. Guardrail: add an output constraint that replaces individual names with role labels and strips judgment language. Run a second-pass review prompt to detect blame phrasing before publication.

06

Scale Limit: Long-Duration Incidents

What to watch: incidents spanning days or weeks produce event streams that exceed context windows, causing truncation and timeline gaps. Guardrail: chunk the incident into time windows, reconstruct each segment independently, then merge with a synthesis pass. Flag boundary events for manual continuity review.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

Paste this prompt into your AI system. Replace the square-bracket placeholders with your incident data.

This prompt template instructs the model to act as an incident analyst and produce a structured, blameless postmortem timeline. It is designed to synthesize heterogeneous inputs—monitoring alerts, deployment events, chat transcripts, and human action logs—into a single, causally-linked narrative. The output is a strict JSON schema suitable for direct ingestion into incident management tools or postmortem documentation systems.

text
SYSTEM: You are an incident analyst constructing a blameless postmortem timeline. Your goal is to synthesize the provided data into a unified, causally-linked sequence of events from initial detection to final resolution. Focus on factual accuracy and avoid assigning blame to individuals. If the provided data is insufficient to establish a causal link, mark the relationship as 'correlated' rather than 'caused_by'.

USER:
Reconstruct a postmortem timeline using the following inputs.

[INCIDENT_NAME]

MONITORING ALERTS:
[ALERTS_JSON]

DEPLOYMENT EVENTS:
[DEPLOYMENTS_JSON]

CHAT LOGS:
[CHAT_TRANSCRIPT_TEXT]

HUMAN ACTIONS:
[MANUAL_ACTIONS_LOG]

[OUTPUT_SCHEMA]
{
  "incident_name": "string",
  "detection_time": "ISO 8601 timestamp",
  "resolution_time": "ISO 8601 timestamp",
  "timeline": [
    {
      "timestamp": "ISO 8601 timestamp",
      "event_type": "DETECTION | DEPLOYMENT | ACTION | ESCALATION | MITIGATION | RESOLUTION",
      "description": "A concise, factual description of the event.",
      "source": "Reference to the specific input log or alert ID.",
      "causal_relationship_to_next": "caused_by | correlated | resolved_by | null"
    }
  ],
  "contributing_factors": ["string"],
  "detection_gap_seconds": "integer"
}

[CONSTRAINTS]
- The timeline must be sorted chronologically.
- Every event in the timeline must cite a source from the provided inputs.
- If a causal link is speculative, use 'correlated' and note the uncertainty in the contributing_factors array.
- The detection_gap_seconds is the difference between the earliest known symptom timestamp and the detection_time.

To adapt this template, replace the square-bracket placeholders with your actual incident data. The [OUTPUT_SCHEMA] is provided inline as a JSON schema for the model to follow; you can move this to a structured output API parameter if your platform supports it. For high-severity incidents, always include a human review step before the generated timeline is published. Validate the output against the schema programmatically, and if the model fails to cite sources for key events, re-prompt with a specific instruction to ground each claim in the provided logs.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Postmortem Timeline Reconstruction Prompt. Each variable must be populated before the prompt is assembled and sent. Missing or malformed inputs are the most common cause of incomplete timelines.

PlaceholderPurposeExampleValidation Notes

[INCIDENT_ID]

Unique identifier linking all data sources to a single incident

INC-2025-03-15-0042

Required. Must match across all input sources. Reject if null or inconsistent across sources.

[MONITORING_ALERTS]

Raw alert payloads with timestamps, severity, service, and alert description

JSON array of PagerDuty or Datadog alert objects

Required. Parse check: must contain at least one alert with a valid ISO-8601 timestamp. Reject if empty array.

[DEPLOYMENT_EVENTS]

Deployment records with service name, version, start time, end time, and status

JSON array from CI/CD pipeline or deployment tracker

Required. Each record must have a service identifier and timestamp. Null allowed if no deployments occurred during the incident window.

[CHAT_TRANSCRIPTS]

Incident response chat logs from Slack, Teams, or equivalent

Plain text or JSON with speaker, message, timestamp per entry

Required. Must contain at least one human message. Parse check: verify timestamp ordering is sequential. Flag if timestamps are missing or out of order.

[HUMAN_ACTIONS_LOG]

Manual actions taken by responders: runbooks executed, config changes, feature flags toggled

JSON array with action description, actor, timestamp, and target system

Required. Each entry must have an actor and timestamp. Null allowed if no manual actions were recorded.

[SERVICE_DEPENDENCY_MAP]

Graph or list of upstream and downstream service dependencies for affected components

JSON object mapping service names to their dependencies and dependents

Required. Must include at least the primary affected service. Schema check: each service entry must have a non-empty dependencies list.

[INCIDENT_BOUNDARY_TIMESTAMPS]

Start and end of the analysis window, typically detection time to resolution time

{"start": "2025-03-15T14:22:00Z", "end": "2025-03-15T16:45:00Z"}

Required. Both fields must be valid ISO-8601. End must be after start. Reject if window exceeds 24 hours without explicit override.

[PREVIOUS_POSTMORTEM_TEMPLATE]

Organization's standard postmortem format with required sections and terminology

Markdown template with section headers and placeholder fields

Optional. If provided, output must conform to section structure. If null, use default blameless postmortem structure.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Postmortem Timeline Reconstruction Prompt into an incident analysis application or workflow.

This prompt is designed to be the core reasoning step in a larger postmortem generation pipeline. It should not be called in isolation. The application layer must first gather and normalize all required inputs—monitoring alerts, deployment events, chat transcripts, and change logs—before assembling them into the [INCIDENT_EVIDENCE] block. The model's output is a structured timeline, but the harness is responsible for validating that structure, linking back to source evidence, and presenting it for human review before the postmortem is finalized.

Wire the prompt into a multi-step workflow: (1) a data collection phase queries your observability platform, CI/CD pipeline, and communication tools for events within the incident window; (2) a normalization step converts timestamps to UTC, deduplicates overlapping alerts, and tags each event with a source identifier; (3) the prompt is called with the assembled evidence and a strict [OUTPUT_SCHEMA] specifying the timeline JSON structure; (4) the output is validated against that schema, checking that every timeline entry has a required timestamp, source reference, and event type; (5) a post-processing step links each entry back to its original evidence record for auditability. Use a model with strong structured output support, such as GPT-4o or Claude 3.5 Sonnet, with response_format set to json_schema where available. For high-severity incidents, route the generated timeline to a human incident commander for approval before it enters the postmortem document.

Common failure modes to guard against: the model may hallucinate causal links between events that are merely temporally correlated. Mitigate this by requiring the [CONSTRAINTS] field to enforce that causal relationships must be explicitly supported by evidence, not inferred from timing alone. The model may also omit human actions that were critical to resolution. Ensure your evidence collection includes chat logs and manual intervention records. Implement a retry loop with a validator that checks for required fields and rejects timelines with missing detection or resolution markers. Log every prompt invocation, the raw output, and the validation result for post-incident review and prompt improvement. Do not treat this prompt as a replacement for human postmortem analysis—it is a synthesis tool that accelerates the timeline construction step, but the final contributing factor identification and action items require human judgment.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required fields, types, and validation rules for the structured timeline output. Use this contract to parse and validate the model response before ingestion into an incident management system or postmortem document.

Field or ElementType or FormatRequiredValidation Rule

timeline_id

string (UUID v4)

Must match regex for UUID v4. Generate if null.

incident_summary

string (1-3 sentences)

Must be non-empty. Length between 50 and 500 characters.

detection_timestamp

ISO 8601 datetime

Must parse as valid datetime. Must be before resolution_timestamp.

resolution_timestamp

ISO 8601 datetime or null

If null, incident is ongoing. If set, must parse as valid datetime and be after detection_timestamp.

events

array of event objects

Must contain at least 1 event. Max 100 events.

events[].timestamp

ISO 8601 datetime

Must parse as valid datetime. Must be within [detection_timestamp, resolution_timestamp] if resolution is set.

events[].source

enum: [monitoring, deployment, chat, human_action, system_log, other]

Must be one of the listed enum values.

events[].description

string

Must be non-empty. Max 500 characters. Must not contain unresolved placeholders.

events[].causal_link_to_next

string or null

If set, must be a non-empty string explaining how this event contributed to the next event.

contributing_factors

array of strings

Must contain at least 1 factor. Each string must be non-empty and max 200 characters.

confidence_score

number (0.0 to 1.0)

Must be a float between 0.0 and 1.0 inclusive. Flag for human review if below 0.7.

evidence_sources

array of source objects

Must contain at least 1 source.

evidence_sources[].type

enum: [alert, log_line, deploy_event, chat_message, ticket, runbook, other]

Must be one of the listed enum values.

evidence_sources[].reference

string

Must be a non-empty identifier (e.g., alert ID, log line number, commit SHA).

human_review_required

boolean

Must be true if confidence_score < 0.7 or if any event source is 'human_action' with missing causal_link_to_next.

PRACTICAL GUARDRAILS

Common Failure Modes

Postmortem timeline reconstruction fails silently when the model hallucinates causal links, misorders events, or omits human actions. These failure modes and guardrails help you catch errors before the timeline becomes part of an incident review.

01

Hallucinated Causal Links

What to watch: The model invents cause-and-effect relationships between unrelated events, especially when timestamps are close but no actual dependency exists. Guardrail: Require the model to cite a specific evidence source (alert ID, chat message, deployment event) for every causal arrow. Flag any link without a citation for human review.

02

Temporal Ordering Errors

What to watch: Events appear in the wrong sequence, particularly when multiple sources report the same incident at slightly different times or when clock skew exists across systems. Guardrail: Normalize all timestamps to a single timezone before prompting. Add an explicit instruction to sort events by normalized time and flag any timestamp that cannot be reconciled.

03

Missing Human Actions

What to watch: The timeline omits manual interventions such as rollbacks, config changes, or ad-hoc commands that operators ran during the incident. These are often the most important contributing factors. Guardrail: Include chat logs, command history, and audit trails as required inputs. Add a dedicated section in the output schema for human actions with a minimum count check.

04

Detection-to-Resolution Gap Collapse

What to watch: The model compresses the time between first detection and resolution, skipping the investigation and mitigation steps that explain why the incident lasted as long as it did. Guardrail: Require explicit markers for detection time, investigation start, mitigation start, and resolution time. Validate that each marker has a distinct timestamp and evidence source.

05

Contributing Factor Overgeneralization

What to watch: The model produces vague contributing factors like 'insufficient monitoring' or 'process gap' without linking them to specific evidence or actionable improvements. Guardrail: Require each contributing factor to reference a specific event in the timeline and include a concrete, testable prevention step. Reject factors that could apply to any incident.

06

Source Exhaustion Blindness

What to watch: The model builds a coherent timeline from partial data without signaling that key sources are missing, such as unavailable logs, silent monitoring gaps, or unrecovered chat history. Guardrail: Include a required 'evidence completeness' field in the output that lists which sources were available and which were missing. Flag timelines with missing sources for lower confidence.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the quality of a generated postmortem timeline before it is shared with stakeholders or archived. Use these checks in an automated eval harness or manual review gate.

CriterionPass StandardFailure SignalTest Method

Event Ordering

All events are in ascending chronological order with no time paradoxes.

Two events have overlapping timestamps but conflicting state descriptions, or an effect timestamp precedes its cause.

Parse all [TIMESTAMP] fields, sort, and assert that for any causal pair, cause.time <= effect.time.

Source Grounding

Every timeline entry cites at least one source from [EVIDENCE_LOG].

An entry contains a claim with no [SOURCE_ID] or cites a source not present in the input evidence set.

Extract all [SOURCE_ID] values from the output and assert they are a subset of the provided evidence IDs.

Causal Link Validity

Each causal link connects two events that exist in the timeline and describes a plausible mechanism.

A link references a non-existent [EVENT_ID] or describes a mechanism contradicted by the evidence (e.g., 'deploy caused spike' when deploy was rolled back before the spike).

For each link, assert that source_event_id and target_event_id exist in the timeline. Use an LLM judge to check mechanism plausibility against [EVIDENCE_LOG].

Detection-to-Resolution Completeness

The timeline includes a detection marker, an escalation marker (if applicable), and a resolution marker.

The timeline ends without a [RESOLUTION] event or starts without a [DETECTION] event.

Scan event types for required markers. Fail if 'detection' or 'resolution' strings are missing from the event type list.

Contributing Factor Identification

At least one contributing factor is listed and linked to a specific timeline event or phase.

The contributing factors section is empty, contains only generic statements like 'human error', or links to events not in the timeline.

Assert that the contributing_factors array is non-empty and that each factor's [RELATED_EVENT_ID] is valid.

Blameless Language

The narrative does not assign individual blame or use accusatory language.

Output contains phrases like 'engineer X failed to...', 'negligence', or names individuals in a negative context.

Run a regex or classifier check for blame patterns. Use an LLM judge to score the narrative on a blamelessness rubric (1-5 scale, pass >= 4).

Schema Adherence

Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present.

JSON parsing fails, a required field like 'events' or 'contributing_factors' is missing, or a field has an incorrect type.

Validate the output string against the [OUTPUT_SCHEMA] using a JSON schema validator. Fail on any validation errors.

Action Item Traceability

Each action item is linked to a contributing factor or a specific timeline event.

An action item is a generic recommendation like 'improve monitoring' with no link to a specific failure mode identified in the timeline.

Assert that each action item's [DERIVED_FROM] field references a valid contributing factor ID or event ID.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single incident source (e.g., one monitoring alert feed and one deployment log). Drop strict schema enforcement and accept free-text timeline output. Focus on getting the causal chain directionally correct before adding multi-source correlation.

Prompt modification

Remove [OUTPUT_SCHEMA] and replace with: Produce a chronological timeline in plain paragraphs. For each event, include a timestamp, what happened, and your confidence level (High/Medium/Low).

Watch for

  • Hallucinated timestamps when logs are sparse
  • Conflating correlation with causation without evidence
  • Missing the detection-to-resolution boundary
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.