AI agent workflow · Reliability operations
Prepare evidence-backed incident postmortems
For engineering teams that review resolved incidents, this guide defines a repeatable evidence-collection and drafting job that preserves what each source proves and leaves root cause and action ownership to human review.
This workflow connects
1 · Services and tools
How the services work together
The outcome belongs to the complete service chain—not any one integration. Each service contributes a specific input, action, or destination and needs an explicit AgentUse connection.
Sentry
Retrieve bounded issue and event evidence for the incident window
Sentry Web API through a read-only wrapper
Retrieve bounded issue and event evidence for the incident window
Sentry Web API through a read-only wrapper
GitHub
Recover commits, pull requests, releases, deployments, and CI evidence linked to the incident window
GitHub MCP server in read-only mode plus a read-only deployments REST wrapper
Recover commits, pull requests, releases, deployments, and CI evidence linked to the incident window
GitHub MCP server in read-only mode plus a read-only deployments REST wrapper
Slack
Read the approved incident channel and preserve timestamped decisions, observations, and mitigations
Slack MCP server
Read the approved incident channel and preserve timestamped decisions, observations, and mitigations
Slack MCP server
Linear
Read the incident record and reconcile proposed follow-up actions with existing engineering work
Linear MCP read-only endpoint
Read the incident record and reconcile proposed follow-up actions with existing engineering work
Linear MCP read-only endpoint
Postmortem artifact
Save the evidence manifest, normalized timeline, postmortem draft, and terminal receipt as a viewable result
AgentUse artifact tools
Save the evidence manifest, normalized timeline, postmortem draft, and terminal receipt as a viewable result
AgentUse artifact tools
2 · Agent architecture
See which AgentUse agent owns each stage
The workflow is a bounded investigation of one incident, not an autonomous remediation system. A single agent reads the approved evidence surfaces and produces one review artifact for the incident owner.
One read-only agent owns the full evidence manifest and draft, which avoids lossy handoffs across a tightly related timeline. Deterministic code should normalize timestamps and identifiers; the model should label evidence and explain uncertainty.
incident-postmortem-preparer
managerCollect one resolved incident's approved evidence, normalize a chronology, separate verified facts from hypotheses, and draft the postmortem without declaring root cause or changing operational systems.
3 · Map the workflow
Describe the job before choosing tools
The useful unit is a reviewable postmortem whose statements can be traced back to operational evidence. The agent reduces collection and chronology work while keeping causal conclusions, accountability, and follow-up commitments with the incident team.
Scope
Start from an explicit resolved incident ID, owner, UTC window, affected systems, and approved Slack, Sentry, GitHub, and Linear boundaries.
Collect
Paginate each source to completion and retain stable IDs, URLs, timestamps, authorship, and per-source errors in an evidence manifest.
Normalize
Convert source timestamps to UTC, preserve the original time, and order observations, decisions, changes, alerts, and mitigations without inventing missing events.
Correlate
Link events only through explicit IDs, references, or corroborated time and system evidence, while labeling temporal proximity as a hypothesis.
Reconcile
Compare proposed follow-up actions with existing Linear issues so the draft distinguishes covered, duplicate, new, and unresolved work.
Draft
Prepare the impact, detection, response, timeline, contributing factors, recovery, lessons, and action proposals with source citations and confidence labels.
Review
Save the artifact for the incident owner, who confirms root cause, impact, wording, owners, and any external or tracker action.
4 · Audit permissions
Find the real permission ceiling of every connector
Start with the connected identity and token scopes, then inspect the tools the MCP server actually exposes. Labels, folders, and prompt instructions express workflow intent; only credentials, resource ACLs, tool filtering, and runtime policy can enforce it.
Sentry API
Partially enforcedWorkflow intent
Credential ceiling
Exposed operations
- • List organization issues with project, environment, and time filters
- • Retrieve issue detail
- • List a named issue's events with start, end, environment, pagination, and optional full bodies
What is actually enforced
Strengthen it: Use a dedicated event:read token and wrapper for the exact issue-list, issue-detail, and issue-events GET endpoints, with pagination and rate ceilings. Expose no Sentry mutation.
List issue events ↗GitHub MCP + REST
Partially enforcedWorkflow intent
Credential ceiling
Exposed operations
- • Search and read repository history through MCP read-only mode
- • Read pull requests, commits, releases, and Actions data
- • GET /repos/{owner}/{repo}/deployments
- • GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
What is actually enforced
Strengthen it: Use the official MCP server in read-only mode with only required toolsets and a separate wrapper limited to the two documented deployment GET endpoints. Grant Deployments: read and expose no GitHub mutation.
List deployment statuses ↗Slack MCP
Partially enforcedWorkflow intent
Credential ceiling
Exposed operations
- • Search messages and files
- • Retrieve threads and message content
- • Send or draft messages when write tools and scopes remain exposed
What is actually enforced
Strengthen it: Use an approved read-only app, omit DM, file, and user scopes unless required, and expose no send, draft, canvas, list, or channel mutation tools.
Slack MCP server ↗Linear MCP
EnforcedWorkflow intent
Credential ceiling
Exposed operations
- • Find issues, projects, comments, and related objects
- • No create or update tools on the read-only endpoint
What is actually enforced
Strengthen it: Use the read-only endpoint and a team-restricted key. Create action items only through a later approval-gated workflow.
Linear MCP permissions ↗Postmortem artifact
EnforcedWorkflow intent
Credential ceiling
Exposed operations
- • Save a session-linked Markdown artifact
- • List prior artifact metadata
What is actually enforced
Strengthen it: Use the incident ID and source-scope fingerprint as the artifact group, and create a new revision instead of silently overwriting a reviewed draft.
AgentUse artifact tools ↗- Provide the resolved incident ID, incident owner, UTC start and end, affected services, severity definition, and explicit trigger for drafting.
- Provide the Sentry organization, regional API domain, project and environment scope, issue IDs or query, pagination ceiling, and read-token owner.
- Provide GitHub repositories, release and deployment conventions, commit or pull-request references, enabled read-only toolsets, and credential owner.
- Provide the Slack workspace and incident channel ID, thread or file scope, search window, approved app owner, and minimum scopes.
- Provide the Linear incident issue, engineering team scope, action-item states, duplicate-search policy, and postmortem review owner.
- Define the postmortem template, fact and inference labels, impact fields, timestamp policy, action-item standard, artifact group, and retention policy.
- Choose success measures such as complete source coverage, timeline correction rate, time to a reviewable draft, and approved actions with measurable completion criteria.
5 · Prepare data
Give every input and output field a meaning
The artifact retains a per-source collection receipt and a normalized event ledger before presenting the shorter narrative. Each conclusion carries an evidence class, citations, counterevidence, and review state so the draft does not turn a plausible sequence into a false causal story.
| Field | Example | Rule |
|---|---|---|
| incident_envelope | INC-204 / 2026-09-10T18:02Z..19:14Z / payments-api | Required incident ID, owner, UTC window, affected services, severity definition, source boundaries, and scope fingerprint |
| source_receipt | Slack complete 84 / Sentry complete 12 / GitHub complete 3 / Linear complete 5 | Per source status, counts, pages or cursors, denied items, skipped formats, errors, and collection time |
| timeline_event | 18:17:42Z / mitigation deployed / GitHub deployment 981 | UTC time, original time, event class, actor or system, concise fact, stable source ID, and URL |
| evidence_class | verified_fact | verified_fact, supported_inference, hypothesis, contradiction, or unknown; never promote proximity alone to fact |
| impact_fact | Sentry issue 992 reports 418 observed users | Preserve the source's metric name and scope; do not relabel observed users as paying customers |
| change_context | PR 881 merged 17:46Z / release web@4.18.0 | Commit, pull request, release, deployment, or CI evidence with explicit relationship or uncertain correlation |
| contributing_factor | Retry limit hypothesis supported by Sentry tags and rollback discussion | State evidence, counterevidence, confidence, and reviewer decision required |
| linear_coverage | ENG-902 / open / exact source link | Covered, possible duplicate, no match, or unavailable, with issue URL and state |
| action_proposal | Add payment retry saturation alert / owner platform / verify with load fixture | Problem, evidence, proposed owner, measurable completion, priority input, and existing coverage |
| terminal_receipt | incomplete / Slack pagination failed / conclusions withheld | Complete, incomplete, or blocked, including which draft sections were withheld and why |
6 · Choose approval points
Decide when the agent should ask first
Let routine collection and preparation run on their own. Ask for approval before an action changes an external system or commits you to something. Keep prohibited actions outside the workflow entirely.
Runs automatically
Read the approved incident record and bounded Sentry, GitHub, Slack, and Linear evidence; normalize timestamps; classify evidence; reconcile action coverage; and save the postmortem draft.
Ask for approval
Confirm root cause or customer impact, assign blame or ownership, create or change a Linear issue, publish the postmortem, notify stakeholders, or disclose customer and security details.
Never allowed
Modify code or production, resolve Sentry issues, merge or deploy GitHub changes, post to Slack, mutate Linear, invent missing events, equate correlation with causation, or store credentials in agent files.
Your preparation pack is ready when it contains
Resolved incident envelope
Sentry project and event scope
GitHub repository and release conventions
Slack incident channel scope
Linear incident and action-item policy
Postmortem template and review owner
7 · Create custom AgentUse agents
Create an agent for your incident evidence and review ritual
Validate the workflow against a previously reviewed incident, then trigger it only for explicitly resolved incidents. Keep collection read-only and require the incident owner to confirm causal conclusions and follow-up commitments.
First run
Rebuild a known postmortem
Compare source coverage, event order, evidence labels, and action matching with an incident whose reviewed outcome is already known.
Ongoing
Run after resolution
Invoke the agent with one incident envelope, collect each source once, and save a new complete or blocked artifact revision.
Review
Let the incident owner confirm meaning
A human resolves contradictions, confirms impact and cause, edits language, assigns actions, and publishes through the team's normal process.
Ready to build
Agent creation prompt
Copy this complete build brief into the project workspace you want the agent to update.
Create a production-ready AgentUse workflow that prepares an evidence-backed postmortem draft for one explicitly resolved incident by reading Sentry, GitHub, Slack, and Linear. It must not modify operational systems or declare root cause without human review.
Run `npx agentuse@latest skills get core --full` and `npx agentuse@latest skills get creator --full`. Inspect the installed AgentUse version, model catalog, project conventions, and live tool inventories. Use https://docs.sentry.io/api/, https://docs.sentry.io/api/events/list-an-organizations-issues/, https://docs.sentry.io/api/events/retrieve-an-issue/, https://docs.sentry.io/api/events/list-an-issues-events/, https://docs.sentry.io/api/permissions/, https://github.com/github/github-mcp-server, https://docs.github.com/en/rest/deployments/deployments, https://docs.github.com/en/rest/deployments/statuses, https://docs.slack.dev/ai/slack-mcp-server, https://linear.app/docs/mcp, and https://docs.agentuse.io/reference/builtin-tools#artifact-tools as implementation references. Report unavailable evidence as a blocker rather than inventing a connector or asking for manual exports.
Create `agents/incident-postmortems/incident-postmortem-preparer.agentuse`. Give it a narrow Sentry read wrapper for the documented organization-issues, issue-detail, and issue-events GET endpoints; the official GitHub MCP server in read-only mode with only required toolsets; a separate GitHub wrapper limited to GET /repos/{owner}/{repo}/deployments and GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses with Deployments: read; Slack MCP search and retrieval for the approved incident conversation; Linear's read-only MCP endpoint; and AgentUse artifact tools. Expose no write operation for Sentry, GitHub, Slack, or Linear.
The input is an incident_envelope containing incident ID, owner, UTC start and end, affected services, severity definition, Sentry organization, region, projects, environments and issue scope, GitHub repositories and release or deployment conventions, Slack workspace and incident channel, Linear incident issue and engineering teams, source ceilings, fact and inference labels, postmortem template, artifact group, retention policy, and review owner. Refuse to run without an explicit incident ID, owner, time window, and source boundaries.
Paginate every source to completion and emit a source_receipt for each connector with status, counts, pages or cursors, denied items, skipped formats, errors, and collection time. For Sentry, preserve issue IDs, permalinks, event counts, observed user measures, first and last seen, releases, tags, and event timestamps without recasting observed users as customers. Use the issue-events endpoint with the incident start and end, approved environments, and full event bodies only when required; account for its smaller page size when full is true. For GitHub, retrieve only explicitly linked or time-bounded commits, pull requests, releases, deployments, deployment statuses, and Actions evidence. Previous deployment statuses older than GitHub's 90-day retention are an explicit evidence gap, not proof that a status did not exist. For Slack, retrieve the approved incident channel and threads inside the window. For Linear, read the incident record and search existing follow-up work.
Normalize timestamps to UTC while retaining the original value. Emit an ordered event ledger with timestamp, event class, actor or system, concise fact, stable source ID, URL, and evidence class. Evidence class is verified_fact, supported_inference, hypothesis, contradiction, or unknown. Link events only through stable IDs, explicit references, or corroborated system evidence. Temporal proximity may create a hypothesis but never proves cause.
Draft impact, detection, response, timeline, mitigation, recovery, contributing factors, lessons, and action proposals. Every nontrivial statement needs a source or an explicit inference label. Include supporting evidence, counterevidence, confidence, and open questions for each contributing-factor hypothesis. Do not name a root cause as confirmed until the incident owner reviews it. Reconcile each action proposal against Linear and label it covered, possible duplicate, no match, or unavailable. Include problem, evidence, proposed owner, measurable completion, and priority input, but create no issue.
Save one Markdown artifact through artifact_save containing the incident envelope, source receipts, evidence manifest, full event ledger, postmortem draft, action coverage, unresolved contradictions, review checklist, and terminal receipt. If any required source is incomplete, preserve partial evidence, mark the artifact incomplete or blocked, withhold unsupported conclusions, and do not claim full coverage.
Use a supervised historical incident first. Later trigger the agent only after an explicit resolution event or operator invocation with the incident envelope. Deduplicate collection by source system plus stable item ID and output by incident ID plus source-scope fingerprint. Create a new artifact revision when evidence changes rather than overwriting a reviewed draft.
Create fixtures for linked deployment, coincidental deployment, missing Sentry events, Slack pagination failure, conflicting timestamps, unsupported impact claim, existing Linear action, ambiguous duplicate, unconfirmed root cause, and unavailable source. Run doctor, a complete mock test, deterministic timestamp and ordering tests, and one supervised read-only reconstruction before operational use.
At handoff provide the agent path, connector identities and exact read operations, source and privacy matrix, evidence schema, exact supervised command, fixture and session evidence, example postmortem artifact, known coverage limits, trigger recommendation, and incident-owner review checklist. Never request, print, or store credentials in agent files.The agent adapts the implementation to your installed AgentUse version and actual tools.