AgentUse

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

40–60 minutes after connectors are readyNo agent code requiredLast tested September 2026
You'll finish with: A viewable postmortem draft with a sourced incident timeline, verified impact facts, deployment and issue context, separated facts and hypotheses, proposed follow-up work, and a complete collection receipt.

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.

ServiceType

Sentry

Retrieve bounded issue and event evidence for the incident window

Sentry Web API through a read-only wrapper

API

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

MCP + API

Slack

Read the approved incident channel and preserve timestamped decisions, observations, and mitigations

Slack MCP server

MCP

Linear

Read the incident record and reconcile proposed follow-up actions with existing engineering work

Linear MCP read-only endpoint

MCP

Postmortem artifact

Save the evidence manifest, normalized timeline, postmortem draft, and terminal receipt as a viewable result

AgentUse artifact tools

Tool
Connector rule: Resolve the exact installed skill or MCP package during setup. The names below describe the required capability, not a package that the coding agent may invent.

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.

agents/incident-postmortems/incident-postmortem-preparer.agentuse1 agent
incident-postmortem-preparermgr
@judgment

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

manager

Collect 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.

@judgment
Sentry API readGitHub MCP and deployments API readSlack MCP readLinear MCP read-onlytimeline normalizationevidence classificationAgentUse artifact save
Validate incident scope
Collect source receipts
Normalize chronology
Correlate linked evidence
Draft findings and actions
Publish postmortem artifact

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.

1

Scope

Start from an explicit resolved incident ID, owner, UTC window, affected systems, and approved Slack, Sentry, GitHub, and Linear boundaries.

2

Collect

Paginate each source to completion and retain stable IDs, URLs, timestamps, authorship, and per-source errors in an evidence manifest.

3

Normalize

Convert source timestamps to UTC, preserve the original time, and order observations, decisions, changes, alerts, and mitigations without inventing missing events.

4

Correlate

Link events only through explicit IDs, references, or corroborated time and system evidence, while labeling temporal proximity as a hypothesis.

5

Reconcile

Compare proposed follow-up actions with existing Linear issues so the draft distinguishes covered, duplicate, new, and unresolved work.

6

Draft

Prepare the impact, detection, response, timeline, contributing factors, recovery, lessons, and action proposals with source citations and confidence labels.

7

Review

Save the artifact for the incident owner, who confirms root cause, impact, wording, owners, and any external or tracker action.

Definition of done: Every in-scope source reports complete, incomplete, or unavailable; every timeline event has a stable source reference and UTC timestamp; facts, inferences, and unknowns are distinct; proposed actions show existing Linear coverage; and the draft makes no source-system change or unsupported root-cause claim.

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 enforced

Workflow intent

Read issue and event evidence for named projects, environments, and the incident time window

Credential ceiling

A bearer token or internal integration with event:read and membership in the accessible Sentry projects

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

Token scopes and project membership are enforced. Project, environment, and time parameters are query filters, so a narrow wrapper should expose only approved GET requests.

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 enforced

Workflow intent

Read named repositories and retrieve linked commits, pull requests, releases, deployments, deployment statuses, and Actions evidence

Credential ceiling

OAuth or a fine-grained token whose repository permissions determine MCP access, plus Deployments repository permission (read) for the REST wrapper

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

Repository permissions, enabled MCP toolsets, read-only mode, and the wrapper's GET allowlist constrain access. Repository names and time windows remain workflow filters. Previous deployment statuses older than 90 days are unavailable from GitHub.

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 enforced

Workflow intent

Read one approved incident channel and incident window

Credential ceiling

Confidential OAuth through an approved internal or directory app with only the required search and history scopes

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

Slack app eligibility, OAuth scopes, workspace access, and channel membership are enforced. The incident channel ID and time window constrain the workflow but do not narrow the token to only that conversation.

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

Enforced

Workflow intent

Read the named incident record and search approved engineering teams for existing follow-up work

Credential ceiling

OAuth, bearer token, or team-restricted API key connected to Linear's read-only endpoint

Exposed operations

  • Find issues, projects, comments, and related objects
  • No create or update tools on the read-only endpoint

What is actually enforced

The separate read-only MCP endpoint prevents mutations through this connection. Team scope and the connected identity determine visible records.

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

Enforced

Workflow intent

Save one viewable draft and evidence manifest for the explicit incident ID

Credential ceiling

AgentUse project artifact directory; no external credential

Exposed operations

  • Save a session-linked Markdown artifact
  • List prior artifact metadata

What is actually enforced

Artifact tools write only under the configured project artifact directory without granting general filesystem write access.

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.

FieldExampleRule
incident_envelopeINC-204 / 2026-09-10T18:02Z..19:14Z / payments-apiRequired incident ID, owner, UTC window, affected services, severity definition, source boundaries, and scope fingerprint
source_receiptSlack complete 84 / Sentry complete 12 / GitHub complete 3 / Linear complete 5Per source status, counts, pages or cursors, denied items, skipped formats, errors, and collection time
timeline_event18:17:42Z / mitigation deployed / GitHub deployment 981UTC time, original time, event class, actor or system, concise fact, stable source ID, and URL
evidence_classverified_factverified_fact, supported_inference, hypothesis, contradiction, or unknown; never promote proximity alone to fact
impact_factSentry issue 992 reports 418 observed usersPreserve the source's metric name and scope; do not relabel observed users as paying customers
change_contextPR 881 merged 17:46Z / release web@4.18.0Commit, pull request, release, deployment, or CI evidence with explicit relationship or uncertain correlation
contributing_factorRetry limit hypothesis supported by Sentry tags and rollback discussionState evidence, counterevidence, confidence, and reviewer decision required
linear_coverageENG-902 / open / exact source linkCovered, possible duplicate, no match, or unavailable, with issue URL and state
action_proposalAdd payment retry saturation alert / owner platform / verify with load fixtureProblem, evidence, proposed owner, measurable completion, priority input, and existing coverage
terminal_receiptincomplete / Slack pagination failed / conclusions withheldComplete, incomplete, or blocked, including which draft sections were withheld and why
Matching rule: Link events through stable IDs, explicit URLs, deployment or release references, or corroborated system evidence inside the incident window. Time proximity can nominate a hypothesis but cannot prove causality. A root-cause statement remains unconfirmed until the incident owner reviews the supporting and conflicting evidence.

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.

Simple rule: If an action sends, shares, changes, submits, spends, or deletes, pause and ask first.
A

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.

G

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.

N

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.

Recommended ownership and models. Use one judgment model for evidence classification and narrative drafting. Deterministic code should own pagination, UTC conversion, stable event IDs, ordering, source counts, and artifact fingerprints.

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.

Need agents running while your Mac is offline?