This prompt is designed for SRE, security, and operations engineers who need to convert narrative incident reports—postmortem drafts, on-call handoff notes, or ticketing system free-text—into a predictable, machine-readable JSON record. The core job is strict schema field extraction: pulling out the incident type, severity, a temporally ordered timeline of events, affected systems, and resolution steps from prose that is often messy, incomplete, or written under time pressure. The primary consumer is a downstream ingestion pipeline (e.g., an incident database, a dashboard, or an automated analysis tool) that breaks when fields are missing, mistyped, or hallucinated.
Prompt
Incident Report Structured Extraction Prompt

When to Use This Prompt
Define the job, reader, and constraints for structured incident report extraction.
Use this prompt when you have a single, self-contained incident narrative and you need a typed record that can be inserted directly into a system of record. It is appropriate for post-incident review workflows, automated incident metric aggregation, and on-call tooling that enriches alerts with structured context. The prompt expects a narrative text block as input and returns a JSON object with fields for incident_id (if available), incident_type (from a defined enum), severity (with an explicit level mapping), status, affected_systems (as a list of canonical system names), timeline (an ordered array of events with timestamps, actions, and observations), resolution_steps, and contributing_factors. Every field includes null handling instructions so the model distinguishes between 'not mentioned' and 'explicitly absent.'
Do not use this prompt for real-time alert triage where latency is critical and the model call adds unacceptable delay. It is not a replacement for a human-authored postmortem; it extracts and structures what is already written. Avoid this prompt when the input spans multiple documents or requires cross-referencing external system logs—this is a single-document extraction task. If the incident report contains regulated data (e.g., PII in security incidents), ensure redaction occurs before the text reaches the model, and always route the structured output through a human review step before it lands in an immutable system of record. For high-severity incidents, the extracted severity field should be treated as a suggestion, not an automated declaration—human confirmation is required before paging or escalation actions fire.
Use Case Fit
Where this prompt works and where it does not. Use these cards to decide if the Incident Report Structured Extraction Prompt is the right tool for your pipeline.
Good Fit: Narrative Postmortems
Use when: SRE teams write freeform incident narratives covering timeline, impact, and resolution. Guardrail: The prompt expects a chronological sequence of events; ensure the input text contains explicit or relative timestamps.
Bad Fit: Real-Time Alert Storms
Avoid when: Ingesting raw, unstructured alert streams or chat transcripts with high noise and overlapping threads. Guardrail: Use a triage classifier first to isolate single-incident narratives before extraction.
Required Inputs
Risk: Missing fields cause downstream ingestion failures. Guardrail: The prompt requires at least one narrative block and an optional known system list. Validate that incident_description is non-empty before calling the model.
Operational Risk: Hallucinated Timelines
Risk: The model may invent specific timestamps or reorder events to create a cleaner narrative. Guardrail: Require confidence flags on every timeline event and post-process to flag events without explicit temporal anchors.
Operational Risk: Schema Drift
Risk: Model output structure changes subtly across model versions, breaking strict JSON parsers. Guardrail: Implement a JSON Schema validator in the application layer and trigger a repair prompt on validation failure.
Boundary: Multi-Team Handoffs
Risk: A single incident report may describe actions across multiple teams, confusing the affected_systems field. Guardrail: Provide a known system list as a constraint input to prevent the model from hallucinating team names.
Copy-Ready Prompt Template
A reusable prompt for extracting structured incident records from narrative reports, with placeholders for input, schema, and constraints.
This prompt template is designed to convert a free-text incident narrative into a strict, machine-readable JSON record. It forces the model to extract key fields—incident type, severity, affected systems, a temporally ordered timeline, and resolution steps—while explicitly handling missing or ambiguous information. Use this as the core instruction block in your extraction pipeline, replacing the square-bracket placeholders with your specific input text, desired output schema, and operational constraints.
textYou are an incident data extraction system. Your task is to read the provided incident report narrative and extract structured information into a strict JSON schema. [INPUT] [OUTPUT_SCHEMA] [CONSTRAINTS] ### Extraction Rules 1. **Temporal Ordering:** Extract all events into a `timeline` array. Each event must have a `timestamp` (ISO 8601 if possible, otherwise the original text), an `event` description, and the `system` affected. Order events chronologically. If a timestamp is missing or relative ("30 minutes later"), set the `timestamp_confidence` field to `"low"` and use the best available text. 2. **Null Handling:** If a field specified in [OUTPUT_SCHEMA] is not present in the report, set its value to `null`. Do not invent information. If a field is present but its value is ambiguous, set the value to `null` and add a note to the `extraction_notes` array explaining the ambiguity. 3. **System Identification:** List all affected systems in the `affected_systems` array. Use the exact names from the report. If a system is implied but not named, do not guess; add a note to `extraction_notes`. 4. **Resolution Steps:** Extract the steps taken to resolve the incident into the `resolution_steps` array. Preserve the order of actions as described. 5. **Confidence Scoring:** For the top-level `severity` and `incident_type` fields, include a `confidence` score ("high", "medium", "low") based on how explicitly the information is stated in the report. ### Output Format Return ONLY a single valid JSON object conforming to the provided schema. Do not include any text outside the JSON object.
To adapt this template, replace the placeholders with your specific operational context. [INPUT] should contain the raw incident report text. [OUTPUT_SCHEMA] must be a strict JSON Schema definition that includes fields for incident_type, severity, affected_systems, timeline, resolution_steps, and extraction_notes. The [CONSTRAINTS] placeholder is where you inject business logic, such as allowed values for severity (e.g., "enum": ["SEV1", "SEV2", "SEV3"]) or required system name formats. For high-stakes environments like security or SRE, always route outputs with confidence scores of "low" for critical fields to a human review queue before automated ingestion.
Prompt Variables
Required and optional placeholders for the Incident Report Structured Extraction Prompt. Each variable must be supplied or explicitly set to null before the prompt is assembled and sent to the model.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[INCIDENT_REPORT_TEXT] | Raw narrative text of the incident report to be extracted | At 14:32 UTC, monitoring alerted on high latency in the checkout service. The on-call engineer identified a slow database query affecting the orders table... | Required. Must be a non-empty string. Reject if only whitespace or under 20 characters. Truncate to model context window minus 500 tokens for instruction overhead. |
[OUTPUT_SCHEMA] | JSON schema definition that the extracted output must conform to | { "type": "object", "properties": { "incident_type": { "type": "string", "enum": ["outage", "degradation", "security", "data_loss", "other"] }, "severity": { "type": "string", "enum": ["SEV1", "SEV2", "SEV3", "SEV4", "SEV5"] }, ... }, "required": ["incident_type", "severity", "timeline"] } | Required. Must be valid JSON Schema draft-07 or later. Validate with a JSON Schema parser before prompt assembly. Reject if schema contains circular references or unsupported keywords for the target model. |
[TIMESTAMP_FORMAT] | Expected format for all timestamp fields in the output | ISO 8601 with timezone offset, e.g., 2024-01-15T14:32:00Z | Required. Must be a parseable format string. Validate that the format is compatible with the downstream ingestion system. Common values: ISO 8601, Unix epoch milliseconds, or RFC 3339. |
[SYSTEM_CONTEXT] | Known information about the environment, services, or teams involved | Services: checkout, orders-db, payment-gateway. Teams: platform-sre, checkout-eng. Environment: production-us-east-1. | Optional. If null, the model extracts system names from the report text only. If provided, use to disambiguate shorthand names. Must be a string or null. Validate that it does not contain PII or secrets. |
[SEVERITY_THRESHOLD] | Minimum severity level that triggers a required human review flag in the output | SEV2 | Optional. Must be one of the enum values from [OUTPUT_SCHEMA] severity field. If null, no automatic review flag is set. Validate against the schema enum before prompt assembly. |
[MAX_TIMELINE_EVENTS] | Maximum number of timeline events to extract before truncation | 20 | Optional. Must be a positive integer between 1 and 100. If null, default to 25. Validate as integer. If the report contains more events, the model should return a |
[REQUIRED_FIELDS] | List of field names that must have non-null values for the extraction to be considered complete | ["incident_type", "severity", "affected_systems", "timeline"] | Required. Must be an array of strings matching top-level property names in [OUTPUT_SCHEMA]. Validate that all listed fields exist in the schema. If a required field cannot be extracted, the model must return |
[UNKNOWN_VALUE_POLICY] | Instruction for how the model should represent values it cannot determine from the text | Use null for missing values. Use 'unknown' only for enum fields where the value is present but unrecognized. Do not hallucinate. | Required. Must be one of: 'null_for_missing', 'unknown_string', or 'omit_field'. Validate against allowed policy strings. This variable directly controls null handling behavior and must match downstream ingestion expectations. |
Implementation Harness Notes
How to wire the Incident Report Structured Extraction Prompt into a production incident management pipeline.
This prompt is designed to be called as a single step within an incident management or SRE automation pipeline. The primary input is an unstructured narrative incident report, which may come from a chat transcript, an email thread, a monitoring alert description, or a manually written postmortem draft. The application layer is responsible for assembling the final prompt by injecting the raw report text into the [INCIDENT_REPORT] placeholder and providing the expected [OUTPUT_SCHEMA] as a strict JSON schema. The model should be instructed to output only valid JSON that conforms to this schema, with no surrounding markdown or explanatory text. For production use, prefer models with strong JSON mode or structured output capabilities, such as gpt-4o or claude-3.5-sonnet, and enable their native constrained decoding features to prevent schema drift.
After the model responds, the application must validate the output before ingestion. First, confirm that the JSON is parseable and that all required fields defined in your schema are present. For fields marked as nullable in the schema, verify that the model returned null rather than an empty string or a placeholder like 'N/A'. Second, validate the temporal ordering of the timeline_events array: each event must have a timestamp in ISO 8601 format, and the array should be sorted chronologically. If the model's output fails structural validation, implement a retry loop (maximum 2 retries) by appending the validation error message to the prompt as a [PREVIOUS_ERROR] context and re-requesting the corrected JSON. If the output fails validation after retries, log the raw response and route the incident to a human review queue for manual structuring.
For high-severity incidents (e.g., severity: critical or severity: major), always require a human-in-the-loop approval step before the structured record is written to the system of record. The extracted fields should be presented in a review UI that highlights fields with low confidence or those that were inferred from ambiguous language. The confidence_notes field in the output schema is critical here; it should contain a brief explanation for any field where the model is uncertain. Wire this prompt into your observability stack by logging the full prompt, the raw model response, validation results, and the final approved record. This trace is essential for debugging extraction failures and for demonstrating auditability during post-incident reviews. Do not use this prompt for real-time alert triage where latency is critical; it is best suited for post-hoc report structuring where correctness and completeness outweigh speed.
Common Failure Modes
Incident report extraction breaks in predictable ways. These are the most common failure modes and how to guard against them before they reach downstream systems.
Temporal Ordering Collapse
What to watch: The model flattens a multi-hour incident into a single event or reorders timeline entries incorrectly, especially when timestamps are relative ('30 minutes later') or interleaved across systems. Guardrail: Require explicit sequence_index and timestamp_iso fields in the output schema. Add a validation check that timestamps are monotonically increasing and flag gaps larger than a threshold for human review.
Severity Inflation or Deflation
What to watch: The model misclassifies incident severity by over-indexing on emotional language ('catastrophic failure') or under-indexing on technical impact ('minor degradation' for a full outage). Guardrail: Provide a strict severity enum with objective criteria (e.g., 'SEV1: customer-facing outage > 10% traffic') in the prompt. Add a post-extraction rule that escalates any incident with 'total outage' language to human review regardless of model-assigned severity.
Affected System Hallucination
What to watch: The model invents affected systems not mentioned in the report, especially when the narrative describes cascading failures but only names the root system. Guardrail: Require source-span citations for every system listed in affected_systems. If no explicit mention exists, the field must be null or populated only from a pre-approved system inventory passed as context, never inferred.
Resolution Step Fragmentation
What to watch: The model breaks a single resolution action into multiple redundant steps or merges distinct actions into one vague entry, losing the granularity needed for postmortem analysis. Guardrail: Include few-shot examples showing correct step boundaries. Add a deduplication check on the output that flags steps with overlapping descriptions or identical timestamps for manual merge review.
Null vs. Missing Field Confusion
What to watch: The model fills null fields with plausible defaults (e.g., 'unknown' strings, epoch timestamps) instead of leaving them empty, or leaves required fields empty when the information is present but phrased indirectly. Guardrail: Explicitly define null semantics in the prompt: null means 'not present in source,' not 'unknown.' Add a post-extraction validator that rejects records where required fields are null and flags optional fields with placeholder values for review.
Multi-Team Handoff Omission
What to watch: The model captures only the initial responding team and misses escalation handoffs, leaving the incident ownership chain incomplete. Guardrail: Add a dedicated ownership_timeline array field with team, timestamp, and action keys. Include a validation rule that the last ownership entry must match the team that declared resolution, and flag gaps where no handoff is recorded between distinct team mentions.
Evaluation Rubric
Use this rubric to test the Incident Report Structured Extraction Prompt against real and adversarial inputs before deploying to production. Each criterion targets a specific failure mode common in temporal event extraction.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Schema Compliance | Output is valid JSON matching the [OUTPUT_SCHEMA] exactly; no extra or missing top-level keys. | JSON parse error, missing required fields like | Validate output against the JSON Schema using a programmatic validator. Run over 100 varied inputs. |
Temporal Ordering | All | Timestamps are out of sequence, duplicated, or cannot be parsed into a valid ISO 8601 datetime. | Sort extracted timestamps and compare to the original order. Flag if |
Null Handling for Missing Data | Fields not present in the source text are | Missing severity is output as 'Unknown', an empty string for | Use a set of reports with deliberately omitted fields (e.g., no severity, no resolution). Assert output values are exactly |
Entity Grounding | All | Output contains a system name not mentioned in the report, or a generic placeholder like 'Monitoring System'. | Use substring search to verify each extracted entity exists in the source text. Fail if a match is not found. |
Severity Normalization |
| Output contains a non-standard severity like 'P1', 'Sev 2', 'major', or a hallucinated level. | Assert the output string is an exact, case-sensitive match to the allowed enum list. Run against reports with ambiguous severity language. |
Timeline Event Completeness | The | A key event like 'deployed fix' or 'alert fired' is missing from the timeline, or two events are incorrectly merged. | Manually annotate 20 golden reports with expected timeline events. Compare extraction count and event descriptions. |
Resolution Step Sequence |
| Steps are out of order, contain speculative future actions, or include a generic 'monitor' step not in the text. | Check that each step's text is a near-exact match to a sentence in the source. Verify order matches the report's narrative flow. |
Hallucination Resistance | Output contains no information not explicitly stated in the [INPUT] text, including inferred root causes. | A | Use adversarial inputs with explicit 'unknown' statements. Assert that corresponding output fields are |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model and lighter validation. Focus on getting the schema shape right before adding production constraints.
- Remove strict enum constraints on
severityandstatus; accept free-text with a normalization note. - Drop
confidencefields from the output schema to reduce complexity. - Use a single example incident rather than few-shot demonstrations.
- Accept
[TIMELINE_EVENT]objects without requiringtimestampnormalization.
Watch for
- Missing schema checks causing downstream ingestion failures.
- Overly broad
incident_typevalues that break routing rules. - Timeline events appearing out of order when the source report is ambiguous.
- Hallucinated
affected_systemswhen the report only mentions symptoms.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us