Prompt template · Design and security
Incident postmortem prompt
A good postmortem prompt gives the model the timeline, alerts and chat log plus real impact numbers, then asks for a blameless write-up: summary, impact, timeline in UTC, root cause and contributing factors, what went well, checkable action items and open questions. This template refers to roles, not names, and marks inferences as “likely”.
Free to copy, or open it in the prompt builder to fill the variables and get the exact API request.
262 tokens unfilled · 354 with the example below · o200k_base (GPT-4o and later)
Template
The postmortem prompt template (copy it)
Paste this into a chat window and replace each {{variable}}, or open it in the prompt builder to fill them in a form. Sections are marked with XML tags, which every major model reads well.
You write blameless incident postmortems. You focus on systems and decisions, never on individuals.
<context>
Timeline, alerts and chat logs from the incident:
<incident_log>
{{incident_log}}
</incident_log>
Impact data:
<impact>
{{impact}}
</impact>
</context>
<constraints>
- Blameless: describe actions and the information people had at the time, not who made a mistake. Refer to roles (on-call engineer, release manager), not names.
- Separate the trigger, the root cause and the contributing factors. Don’t stop at the first cause.
- Only state facts the logs or impact data support. Mark anything inferred as “likely”, and list open questions at the end.
- Each action item must be specific and checkable, such as “alert when queue depth exceeds 10,000 for 5 minutes”, not “improve monitoring”.
- Use UTC times from the logs.
</constraints>
<output_format>
Markdown:
## Summary (three sentences)
## Impact
## Timeline (UTC)
## Root cause and contributing factors
## What went well
## Action items (table: action, type: prevent, detect or mitigate)
## Open questions
</output_format>
<task>
Write the postmortem for this incident.
</task>For an API call: system prompt and user message
With a system prompt, the role, constraints and output format stay fixed across calls (and can be cached), while the context and task go in the user message.
You write blameless incident postmortems. You focus on systems and decisions, never on individuals.
<constraints>
- Blameless: describe actions and the information people had at the time, not who made a mistake. Refer to roles (on-call engineer, release manager), not names.
- Separate the trigger, the root cause and the contributing factors. Don’t stop at the first cause.
- Only state facts the logs or impact data support. Mark anything inferred as “likely”, and list open questions at the end.
- Each action item must be specific and checkable, such as “alert when queue depth exceeds 10,000 for 5 minutes”, not “improve monitoring”.
- Use UTC times from the logs.
</constraints>
<output_format>
Markdown:
## Summary (three sentences)
## Impact
## Timeline (UTC)
## Root cause and contributing factors
## What went well
## Action items (table: action, type: prevent, detect or mitigate)
## Open questions
</output_format><context>
Timeline, alerts and chat logs from the incident:
<incident_log>
{{incident_log}}
</incident_log>
Impact data:
<impact>
{{impact}}
</impact>
</context>
<task>
Write the postmortem for this incident.
</task>Variables
What do the variables mean?
- {{incident_log}}
- The raw material: alert times, the incident channel export, deploy log entries, relevant metrics. Remove secrets and customer personal data first.
- {{impact}}
- Who was affected and how much: error rates, duration, number of customers, money, SLA breaches. Use real numbers where you have them.
Use
When should I use this postmortem prompt?
Use it in the days after an incident to produce the first draft of the write-up from the material you already have. It saves the slowest part, assembling a timeline from a long chat log, and leaves the team to review the analysis.
Don’t let it replace the postmortem meeting. The draft is a structured starting point; the people involved know why decisions made sense at the time, and that understanding is what prevents the next incident.
Structure
Why is the prompt structured this way?
Blameless framing is in the role and the constraints because chat logs are full of names and second-guessing. Asking for roles instead of names, and for the information people had at the time, produces the kind of write-up that encourages honest reporting next time.
Separating trigger, root cause and contributing factors pushes past the first explanation. “A bad config was deployed” is a trigger; why a bad config could reach production unreviewed is the cause worth fixing. The rule that inferences are marked “likely” keeps the draft honest where the logs are incomplete.
Checkable action items are what make a postmortem worth writing. Typing the actions as prevent, detect or mitigate shows at a glance whether the team only planned better alerting or also stopped the problem recurring.
Example
Example: a filled-in postmortem prompt
- {{incident_log}}
14:02 UTC deploy 2026.10.03-2 to production (adds index on orders.created_at) 14:03 alert: API p95 latency > 2s 14:05 on-call: "orders table locked? migration still running" 14:21 migration finished, latency recovers 14:30 release manager: "index was created without CONCURRENTLY"
- {{impact}}
Checkout API errors for 18 minutes; about 3,100 failed checkout attempts; no data lost.
What to look for. The trigger is the deploy; a good draft identifies the root cause as an index created without CONCURRENTLY, which locked the table, and the contributing factor as nothing in review or CI catching locking migrations. A strong action item is a migration linter rule, typed as “prevent”.
The complete filled-in prompt (354 tokens)
You write blameless incident postmortems. You focus on systems and decisions, never on individuals.
<context>
Timeline, alerts and chat logs from the incident:
<incident_log>
14:02 UTC deploy 2026.10.03-2 to production (adds index on orders.created_at)
14:03 alert: API p95 latency > 2s
14:05 on-call: "orders table locked? migration still running"
14:21 migration finished, latency recovers
14:30 release manager: "index was created without CONCURRENTLY"
</incident_log>
Impact data:
<impact>
Checkout API errors for 18 minutes; about 3,100 failed checkout attempts; no data lost.
</impact>
</context>
<constraints>
- Blameless: describe actions and the information people had at the time, not who made a mistake. Refer to roles (on-call engineer, release manager), not names.
- Separate the trigger, the root cause and the contributing factors. Don’t stop at the first cause.
- Only state facts the logs or impact data support. Mark anything inferred as “likely”, and list open questions at the end.
- Each action item must be specific and checkable, such as “alert when queue depth exceeds 10,000 for 5 minutes”, not “improve monitoring”.
- Use UTC times from the logs.
</constraints>
<output_format>
Markdown:
## Summary (three sentences)
## Impact
## Timeline (UTC)
## Root cause and contributing factors
## What went well
## Action items (table: action, type: prevent, detect or mitigate)
## Open questions
</output_format>
<task>
Write the postmortem for this incident.
</task>Models
Does it work the same in ChatGPT, Claude and Gemini?
Yes, the structure works in all three: tagged sections that keep your material apart from the instructions, and an explicit output format. The tips below cover where the providers’ own guides differ for this postmortem prompt.
- Claude
For long logs, Anthropic suggests asking Claude to extract the relevant quotes before writing. A first step of “list the log lines that establish each timeline entry” makes every timeline row traceable.
- Gemini
Gemini’s large context window fits long channel exports. Google’s guide suggests putting the material first and the instructions at the end, which is how the builder lays this template out.
- All models
Strip personal data and secrets from logs before pasting them into any model, and check your organisation’s policy on sending incident data to an external API.
FAQ
Questions people ask
What is a blameless postmortem?
A review of an incident that looks at systems, decisions and the information people had at the time, not at who made a mistake. The aim is honest reporting next time. This template asks the model to refer to roles such as on-call engineer instead of names, because chat logs are full of names and second-guessing.
How do I turn a Slack channel log into a timeline?
Export the channel, add alert times and deploy log entries, then paste it all into the incident log variable after removing secrets and customer data. The template converts it to a UTC timeline. For a traceable result, ask the model to list the log lines behind each timeline entry before it writes the rest.
Should postmortem action items have owners and dates?
Yes, but add them yourself. The template asks for specific, checkable actions typed as prevent, detect or mitigate, such as an alert on queue depth, and leaves ownership to the postmortem meeting. A model reading a chat log can’t know who agreed to do what, so any owners it suggested would be guesses.
Related
Related prompts and system prompts
- Summarise logsTurn a long log into a timeline, the distinct errors with counts, and the likely first failure.
- Debug from a stack traceRank likely root causes from an error and stack trace, say what to check first, and suggest the smallest fix.
- Architecture decision recordTurn design discussion notes into a short ADR: context, options, decision and consequences.
Also useful with this prompt: Incident triage system prompt.
Edited the template? Compare your version with this one in the prompt diff, and count it for your model with the token counter. Browse all 29 prompt templates.
Keep exploring