Inferensys

Prompt

Incident Timeline Extraction Prompt Template

A practical prompt playbook for using the Incident Timeline Extraction Prompt Template in production AI workflows. Designed for SRE teams who need to turn chaotic incident data into a normalized, time-ordered event log ready for root cause analysis.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Incident Timeline Extraction prompt.

This prompt is built for SRE and on-call engineering teams who need to reconstruct a single, coherent incident timeline from multiple unstructured sources. Use it when you have chat transcripts, monitoring alerts, and deployment records that describe the same incident window and you need a normalized, time-ordered event log. The primary job-to-be-done is post-hoc analysis: turning the chaotic, multi-source record of an incident into a structured chronology that can be used for postmortem drafting, contributing factor analysis, and remediation planning.

The ideal user is an engineer who has already gathered the raw text from each source and is ready to pass it to the model. The prompt assumes you are not feeding it live data streams or real-time monitoring output. It is not a replacement for a real-time monitoring system, a logging platform, or an observability tool. It is a post-incident analysis tool that works on a defined window of time after the incident has been declared over or stable. The required context includes the incident's start and end time, the raw text from each source, and any known constraints such as timezone or clock skew between systems.

Do not use this prompt when you need real-time alert correlation, when the raw data volume exceeds the model's context window without summarization, or when the sources contain conflicting timestamps that require deterministic reconciliation rather than probabilistic ordering. The prompt is also unsuitable for incidents where legal or regulatory requirements demand a fully auditable, human-authored timeline without AI intermediation. In those cases, use this output as a draft for human review, not as the final record. Before running the prompt, ensure you have stripped any sensitive PII or credentials from the source text that should not be passed to the model.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Incident Timeline Extraction prompt works and where it introduces risk. Use these cards to decide whether this prompt fits your incident response workflow.

01

Good Fit: Multi-Source Incident Reconstruction

Use when: you have chat transcripts, monitoring alerts, and deployment records that need to be merged into a single normalized timeline. Guardrail: the prompt excels at reconciling timestamps and flagging gaps, but requires at least two distinct source types to add value over manual sorting.

02

Bad Fit: Single-Source Chronologies

Avoid when: you only have one data source, such as a single Slack channel or one monitoring dashboard. Guardrail: the extraction and normalization overhead adds latency without meaningful reconciliation benefit. Use a simpler log-parsing prompt instead.

03

Required Inputs: Timestamped Raw Data

Risk: the prompt cannot invent timestamps or resolve relative time references without anchor points. Guardrail: every input source must include at least one absolute timestamp. Pre-process relative references like '5 minutes ago' into absolute times before calling the prompt.

04

Operational Risk: Conflicting Accounts

Risk: different sources may report contradictory event sequences, and the model may silently choose one version. Guardrail: the output schema must include a conflicts array that surfaces disagreements with both accounts preserved. Human reviewers must resolve conflicts before the timeline is treated as authoritative.

05

Operational Risk: Missing Gaps

Risk: the model may produce a continuous timeline even when significant time gaps exist between events, hiding missing data. Guardrail: the prompt must be instructed to insert explicit [GAP] markers when the interval between adjacent events exceeds a configurable threshold. Validate gap presence in eval checks.

06

Process Fit: Post-Incident Review Only

Avoid when: you need real-time timeline construction during an active incident. Guardrail: this prompt is designed for post-incident analysis with complete data. For live incidents, use a streaming event correlation prompt that handles partial data and updates incrementally.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt with square-bracket placeholders for extracting a normalized, time-ordered incident timeline from unstructured sources.

This template is designed to be pasted directly into your AI harness, whether that's a Python script, a LangChain node, or an internal tool. It accepts raw incident data—chat transcripts, monitoring alerts, deployment records—and produces a structured, time-ordered event log. The prompt enforces strict timestamp normalization, gap detection, and conflict flagging, making it suitable for post-incident review and postmortem drafting. Before running, replace every square-bracket placeholder with the actual values for your incident and organization.

text
You are an SRE incident analyst. Your task is to extract a normalized, time-ordered timeline of events from the provided incident data.

## INPUT DATA
[INCIDENT_DATA]

## OUTPUT SCHEMA
Return a JSON object with the following structure:
{
  "incident_id": "string",
  "generated_at": "ISO 8601 timestamp",
  "timeline": [
    {
      "timestamp": "ISO 8601 timestamp in UTC",
      "source": "string (e.g., 'slack_transcript', 'pagerduty_alert', 'datadog_monitor', 'deployment_log')",
      "event_type": "string (e.g., 'alert_fired', 'human_observation', 'deployment_started', 'mitigation_applied', 'resolution_confirmed')",
      "description": "string (concise, factual description of the event)",
      "actor": "string or null (the system or person who triggered the event)",
      "evidence": "string (verbatim quote or data point from the input that supports this event)",
      "confidence": "string (HIGH | MEDIUM | LOW)"
    }
  ],
  "gaps": [
    {
      "start": "ISO 8601 timestamp or null",
      "end": "ISO 8601 timestamp or null",
      "description": "string (what is missing, e.g., 'No data between alert fire and first human response')"
    }
  ],
  "conflicts": [
    {
      "event_ids": ["index of first conflicting event", "index of second conflicting event"],
      "description": "string (explanation of the contradiction, e.g., 'Deployment log shows rollback at 14:05, but Slack transcript claims rollback at 14:12')"
    }
  ]
}

## CONSTRAINTS
- All timestamps must be normalized to UTC ISO 8601 format (e.g., '2025-03-15T14:05:00Z').
- If a source provides a timestamp in a different timezone, convert it and note the original timestamp in the evidence field.
- Sort the timeline array strictly by timestamp ascending.
- If an event's exact timestamp is ambiguous, set the timestamp to the earliest possible time based on context, set confidence to LOW, and explain the ambiguity in the evidence field.
- Deduplicate events that appear in multiple sources. Merge them into a single event, list all sources, and keep the highest-confidence timestamp.
- Flag any period longer than [GAP_THRESHOLD_MINUTES] minutes without an event as a gap.
- Flag any direct contradiction between sources as a conflict.
- Do not infer events that are not explicitly supported by the input data. If the data is insufficient, record a gap.
- Do not assign blame or speculate on root cause. This is a fact-extraction task only.

## EXAMPLES
[FEW_SHOT_EXAMPLES]

## RISK LEVEL
[RISK_LEVEL]

To adapt this template, start by replacing [INCIDENT_DATA] with the raw text from your incident sources. This can be a concatenation of Slack transcripts, PagerDuty alert payloads, Datadog monitor snapshots, and deployment logs. The model will parse timestamps from these heterogeneous formats. Next, set [GAP_THRESHOLD_MINUTES] to a value appropriate for your incident response SLA—typically 5, 10, or 15 minutes. If you have high-quality examples of correctly extracted timelines from past incidents, insert them into [FEW_SHOT_EXAMPLES] as JSON objects matching the output schema. This significantly improves extraction accuracy, especially for event_type classification. Finally, set [RISK_LEVEL] to HIGH, MEDIUM, or LOW based on the incident's severity. For HIGH risk incidents, the generated timeline must be reviewed by a human incident commander before it is used in any postmortem or external communication. For LOW risk, the timeline can feed directly into automated postmortem drafting, but a human should still spot-check the gaps and conflicts arrays before finalization.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the Incident Timeline Extraction prompt needs to work reliably. Validate these before sending the prompt to avoid hallucinated timestamps, missing events, or misordered chronologies.

PlaceholderPurposeExampleValidation Notes

[INCIDENT_SOURCES]

Raw, unstructured text from all data streams to be analyzed

ChatOps transcript, PagerDuty alert log, deployment bot messages, monitoring email alerts

Must be a non-empty string. Check for minimum length (>50 chars). If multiple sources, concatenate with source labels before insertion.

[START_TIME]

The earliest boundary for the timeline to prevent inclusion of irrelevant historical events

2025-03-15T14:00:00Z

Must be ISO 8601 format. Parse and confirm it is before [END_TIME]. If null, the model will infer the start, which risks including pre-incident noise.

[END_TIME]

The latest boundary for the timeline to cap the analysis window

2025-03-15T15:30:00Z

Must be ISO 8601 format. Parse and confirm it is after [START_TIME]. If null, the model will use the last event in [INCIDENT_SOURCES], which may be unreliable.

[TIMEZONE]

The canonical timezone for all output timestamps to ensure consistency across globally distributed teams

America/New_York

Must be a valid IANA timezone string (e.g., 'UTC', 'America/Los_Angeles'). Reject free-text like 'EST'. If omitted, default to 'UTC' and log a warning.

[OUTPUT_SCHEMA]

The strict JSON schema defining the expected structure of each timeline event

{ "type": "object", "properties": { "timestamp": {"type": "string"}, "event": {"type": "string"}, "source": {"type": "string"}, "confidence": {"type": "number"} }, "required": ["timestamp", "event", "source"] }

Must be a valid, parseable JSON Schema object. Validate with a JSON Schema validator before sending. A missing or invalid schema will result in unstructured output.

[CONSTRAINTS]

Hard rules for the extraction process to enforce data quality and handling of ambiguity

Do not infer events not explicitly mentioned. If two sources conflict on a timestamp, flag both with a 'conflict' tag. Mark any gap > 5 minutes as 'gap'.

Must be a non-empty string. Review constraints for logical contradictions (e.g., 'never infer' and 'fill small gaps'). The model's adherence to these constraints is a primary evaluation criterion.

[SYSTEM_CONTEXT]

Static information about the system architecture to help the model interpret service names and metric labels

Service 'checkout-api' depends on 'payment-gateway' and 'inventory-svc'. 'payment-gateway' is a third-party dependency.

Optional but strongly recommended. If provided, must be a non-empty string. This context drastically reduces hallucinated service names. If null, the model will extract names from sources, which may include ephemeral pod IDs.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Incident Timeline Extraction prompt into a production SRE workflow with validation, retries, and human review gates.

This prompt is designed to be called as part of a post-incident review pipeline, not as a real-time chat interaction. The primary input is a concatenated text blob containing chat transcripts (Slack, Teams, PagerDuty), monitoring alert payloads, and deployment event logs. Before calling the model, you must normalize timestamps to UTC and deduplicate overlapping sources at the application layer. The model's job is to produce a single, ordered JSON array of events—it should not be asked to resolve timezone offsets or deconflict raw source data. Expect to run this prompt once per incident, with the output feeding directly into a postmortem drafting tool or a timeline visualization dashboard.

Wire the prompt into an async job queue with a timeout of at least 60 seconds for large incident transcripts. Implement a validation layer that checks the output JSON against a strict schema: every event must have a non-null timestamp (ISO 8601), a source field matching one of the provided source identifiers, and a description string under 500 characters. Reject outputs with duplicate timestamps that lack distinct source attribution. If validation fails, retry once with the same input and an explicit error message appended to the prompt context indicating which validation rule was violated. After two failures, escalate to a human reviewer via your incident management tool and log the raw model output for debugging. For model choice, use a model with strong structured output capabilities and a context window large enough to hold your worst-case incident transcript plus the prompt template—typically 32K tokens minimum for multi-hour incidents.

Do not use this prompt for real-time incident response or live chat ingestion. The extraction is a post-hoc analysis step. If your incident involves regulated data (PII in chat logs, healthcare information, financial transaction details), you must redact sensitive fields before they reach the model and flag the output for human review before it enters any permanent record. Build an eval harness that tests the prompt against at least five historical incidents with known timelines, measuring timestamp recall (did we miss events?), ordering accuracy (are events in the correct sequence?), and hallucination rate (did the model invent events not present in the source material?). Run these evals whenever you change the prompt template, the model version, or the input normalization logic. The output of this prompt is evidence for root cause analysis, not the final answer—always treat it as a structured draft that requires SRE confirmation before it becomes the official incident record.

IMPLEMENTATION TABLE

Expected Output Contract

Schema contract for the normalized incident timeline. Use this table to validate the model's output before ingesting it into your incident management system or postmortem draft.

Field or ElementType or FormatRequiredValidation Rule

timeline

Array of event objects

Must be a non-empty JSON array. Parse check: JSON.parse succeeds and returns an array with length > 0.

timeline[].timestamp

ISO 8601 string

Must parse as a valid date. Chronological order check: for all i, timeline[i].timestamp <= timeline[i+1].timestamp. No future timestamps allowed unless explicitly noted in [CONTEXT].

timeline[].event_type

Enum string

Must be one of: 'alert', 'deployment', 'config_change', 'human_action', 'observation', 'escalation', 'mitigation', 'resolution', 'unknown'. Schema check: reject any value outside this enum.

timeline[].source

String

Must reference a source identifier from [CONTEXT] (e.g., 'pagerduty_alert_123', 'slack_thread_456', 'deploy_log_main'). Citation check: source must exist in the provided input material.

timeline[].description

String

Must be a non-empty string between 10 and 500 characters. Must not contain unresolved placeholders or hallucinated details not present in the source material.

timeline[].confidence

String

Must be one of: 'high', 'medium', 'low'. If source is ambiguous or conflicting, confidence must be 'low' or 'medium'. Confidence threshold check: events with 'low' confidence should be flagged for human review before inclusion in a postmortem.

timeline[].conflicting_sources

Array of strings or null

If multiple sources disagree on this event, list the conflicting source identifiers. If no conflict, value must be null or an empty array. Null allowed.

gaps

Array of gap objects

Must be an array. Each gap object must contain 'start_time' (ISO 8601), 'end_time' (ISO 8601), and 'description' (string). Gap check: if the timeline has any interval > 5 minutes with no events, a gap entry must be present. Human review required if gaps exist during the incident's critical window.

PRACTICAL GUARDRAILS

Common Failure Modes

Incident timeline extraction is brittle when input data is messy, contradictory, or incomplete. These are the most common failure modes and how to prevent them before they corrupt your postmortem.

01

Timestamp Ambiguity and Timezone Drift

What to watch: The model misinterprets timestamps due to missing timezone offsets, UTC/local time confusion, or relative timestamps ('5 minutes ago'). This produces a chronologically incorrect timeline that misleads root cause analysis. Guardrail: Normalize all timestamps to UTC with explicit offsets before prompt injection. Include a [TIMEZONE] variable and reject entries with unresolvable timestamps, flagging them for human clarification.

02

Conflicting Event Accounts

What to watch: Chat transcripts and monitoring alerts describe the same event differently (e.g., 'DB was down' vs 'DB was slow'). The model picks one account arbitrarily or merges them into a confusing hybrid. Guardrail: Instruct the model to detect and isolate conflicting accounts into a dedicated conflicting_events array with source attribution. Do not resolve conflicts automatically; flag them for the post-incident review lead.

03

Missing Temporal Gaps

What to watch: The model produces a seamless timeline by omitting periods with no data, creating a false sense of continuity. Critical silent failures or observation gaps become invisible. Guardrail: Require the output schema to include explicit gap entries with start and end timestamps when no events are recorded for more than a configurable threshold (e.g., 5 minutes). Validate gap coverage in eval.

04

Hallucinated Causal Links

What to watch: The model infers causation from temporal proximity ('A happened, then B happened, so A caused B') and states it as fact. This contaminates the root cause analysis before it begins. Guardrail: Constrain the prompt to produce a strictly chronological event log. Forbid causal language in the timeline output. Add a separate, optional hypothesized_relationships field with explicit confidence scores and evidence grounding.

05

Low-Information Event Contamination

What to watch: Chat noise ('looking into it', 'ack'), duplicate alerts, and automated status page updates flood the timeline, burying the signal events that matter. Guardrail: Pre-filter input with a deduplication and salience step. Include a severity or relevance field in the output schema and instruct the model to drop or de-prioritize events below a threshold. Use a separate prompt for noise reduction before timeline construction.

06

Entity Resolution Failure

What to watch: The same service, host, or component is referred to by multiple names ('auth-svc', 'authentication service', 'login pod', 'pod-1234'). The model treats them as separate entities, fragmenting the incident narrative. Guardrail: Provide an [ENTITY_MAP] variable with canonical names and aliases. Instruct the model to normalize all entity references to canonical names. Add an eval check for entity consistency across the output.

IMPLEMENTATION TABLE

Evaluation Rubric

Score each criterion on a pass/fail basis before shipping the Incident Timeline Extraction prompt. Run these checks against a golden set of incident transcripts to ensure the prompt handles timestamp normalization, gap detection, and conflicting accounts reliably.

CriterionPass StandardFailure SignalTest Method

Timestamp Normalization

All timestamps converted to UTC ISO 8601 format with source timezone preserved in a separate field

Mixed timezone formats in output; missing source timezone annotation; ambiguous timestamps without offset

Parse every timestamp in output; confirm UTC conversion matches source offset; check for ISO 8601 compliance

Chronological Ordering

Events appear in strict ascending time order with no timestamp inversions

Event at index N has a later timestamp than event at index N+1; duplicate timestamps without tie-breaking rationale

Iterate output array; assert timestamp[i] <= timestamp[i+1] for all i; flag equal timestamps without ordering notes

Event Completeness

Every discrete incident-relevant event from source material appears in the timeline

Source material contains an event not present in output; output contains fabricated events not grounded in source

Diff extracted events against source annotations; require citation to source passage for each output event

Gap Detection

Gaps longer than [GAP_THRESHOLD] minutes are explicitly marked with a gap reason or unknown indicator

Consecutive events with time delta exceeding threshold but no gap marker; gap markers without time bounds

Calculate time deltas between consecutive events; assert gap markers present where delta > threshold; verify gap time bounds match delta

Conflicting Account Resolution

Conflicting timestamps or event descriptions are flagged with both accounts preserved and conflict noted

Only one account of a conflict appears; conflict present in source but not flagged in output; resolution asserted without evidence

Cross-reference source accounts that describe same event differently; assert output contains conflict flag and both versions

Source Citation

Each timeline event includes a source reference field pointing to the originating document, message, or alert

Events missing source reference; source reference points to non-existent document; citation format inconsistent across events

Check every output event for non-null source field; validate source identifiers against input manifest; confirm consistent citation format

Event Granularity Consistency

Events maintain consistent granularity level; no mixing of high-level summaries with low-level raw log lines without explicit nesting

Single timeline entry summarizes multiple distinct events; raw log line appears adjacent to synthesized event without relationship marker

Review output for granularity shifts; assert parent-child relationship markers where nested events exist; flag unexplained granularity jumps

Missing Data Handling

Unknown or unavailable fields are explicitly marked as null or 'unknown' rather than hallucinated or omitted

Required field contains plausible but unsupported value; field absent when source lacks data instead of marked unknown

For each event field, check source for supporting evidence; assert unknown fields are explicitly marked; verify no invented values

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single chat transcript. Use a frontier model with a large context window. Skip strict schema validation initially—focus on whether the model can identify discrete events, assign timestamps, and order them correctly.

Replace the [OUTPUT_SCHEMA] placeholder with a simple JSON array of {timestamp, event, source, confidence} objects. Add a note: If a timestamp is ambiguous, mark it as [APPROXIMATE] and include the original text in the evidence field.

Watch for

  • Events extracted out of chronological order
  • Chat messages treated as events instead of the incidents they describe
  • Missing timezone normalization when sources use different zones
  • The model inventing timestamps for events mentioned without time references
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.