How we handle GDPR data-subject requests on a deadline
Legal
When an incident resolves, an agent pulls the timeline from the incident channel, correlates deploys and log spikes, and drafts a structured postmortem as a doc PR for the team to review and edit.
A postmortem is worth writing and easy to skip. Once an incident is resolved and the pressure is off, someone has to reconstruct the timeline from a scrolling channel, line it up against the deploys and log spikes, work out the root cause, and write it all up. It's an hour of careful work at the moment everyone most wants to move on, so it often gets a thin summary or nothing.
We run an agent on Kortix that drafts the first version. When an incident resolves, it reads the incident channel, correlates the deploys and log spikes, and opens a structured postmortem as a doc PR. It drafts; humans review and finalize. This is how we write our own postmortems.
The facts of an incident are scattered across places that don't line up on their own: the back-and-forth in the incident channel, the deploy history, and the log spikes. Turning them into a timeline means reading the channel top to bottom, matching each moment against what shipped and what the logs did, and inferring where the root cause sits.
The common workarounds are thin. A blank template gets filled in from memory, so the timeline drifts and details get rounded off. A resolved incident with no writeup means the same failure mode can recur with nothing to point back to. The information to do it properly exists; assembling it by hand is exactly the work no one wants right after an incident.
On Kortix, resolving an incident triggers an agent. It reads the incident channel for the timeline, pulls the deploy history and log spikes for the same window, correlates them, and drafts a structured postmortem, timeline, root cause, and action items, as a doc PR against the repo. The team reviews and edits the draft the way they'd review any change. The agent drafts; it never publishes a final postmortem on its own.
Open your Kortix workspace, start a new session, paste this prompt and send it. The agent writes the agent file, the postmortem-draft skill and the 15-minute trigger, and opens a change request for you to review. Prefer clicks? Choose Use this template instead.
Set up an incident postmortem agent in this workspace.
Create the agent agents/incident-postmortem.md. Its job is to draft a postmortem for each resolved incident in #incidents and open it as a pull request in owner/repo. It may use the GitHub and Datadog connectors, the Slack channel and the GH_TOKEN secret.
Create the skill skills/postmortem-draft/SKILL.md with these rules:
Add a cron trigger resolved-incident-sweep to kortix.yaml. It runs the incident-postmortem agent every 15 minutes with the prompt "Load the postmortem-draft skill and check #incidents for incidents marked resolved since the last sweep."
Tell me which of these connectors are not connected yet.
Open a change request with all of it. Do not merge it.
Open Connectors in your workspace and connect GitHub and Datadog, add a
GitHub token as the GH_TOKEN secret, and connect Slack under Channels.
Credentials are brokered server-side and never enter the agent's machine.
Reads deploys and merges and opens the postmortem pull request.
Reads log spikes over the incident window.
Reads the incident channel timeline for resolved incidents.
Merge the change request, then start a session with the incident-postmortem agent and send this prompt. Pick a recently resolved incident and read the draft before you let the schedule take over.
Check #incidents for incidents marked resolved and draft their postmortems.
The change request added this trigger to kortix.yaml. From now on the agent
runs every 15 minutes, each run in a new session on its own cloud computer.
To change the time, edit the cron line, or open Triggers in the workspace.
triggers:- slug: resolved-incident-sweep name: Resolved incident sweep on: cron: "0 */15 * * * *" run: agent: incident-postmortem prompt: Load the postmortem-draft skill and check #incidents for incidents marked resolved since the last sweep.The draft states the root cause and the action items as proposals, with the evidence listed. The action items have no owners. The channel, GitHub history and Datadog are read-only sources, and the pull request is the one write. The team corrects the draft, sets owners and merges the version they stand behind.
Each resolved incident ends with one pull request. This is what a run looks like in the session:
Found 1 newly resolved incident, open for 42 minutes. The error rate rose 3 minutes after a merge to the checkout service, so the draft proposes that merge as the root cause. Opened one pull request with 4 candidate action items and no owners.
Once it works, paste any of these into the same session.
When you open a postmortem pull request, post its link and the one-paragraph summary in the incident thread.
Each month, read the merged postmortems and list root causes that appeared more than once, with links.
After a postmortem pull request merges, file each action item as an unassigned GitHub issue linked to it.
The agent reads an incident channel, logs, and deploy history and writes a document others will act on, so the access is scoped and contained:
Resolved incidents now come with a drafted postmortem waiting as a doc PR, its timeline already correlated against the deploys and log spikes. The team spends its time judging the root cause and deciding the action items rather than reconstructing what happened, and fewer incidents close with no writeup at all.