Est.

Incident Postmortems Involving AI Coding Agent Actions

Standard postmortems fail to capture what AI coding agents actually did.

· 10 min read
Cover illustration for “Incident Postmortems Involving AI Coding Agent Actions”
Agent Observability · October 14, 2026 · 10 min read · 2,194 words

Full observability for an AI coding agent means a structured log of every tool call it made, the reasoning that triggered each one, the credentials it held at the time, and the diffs it produced, all stored somewhere the agent itself can't edit. Most teams discover they don't have this only after an incident, when they try to write a postmortem and find that the standard format, and the standard logs behind it, were never built to answer the questions an agent incident raises. This piece covers why that gap exists and what an incident report for an agent action actually needs to contain.

Why AI coding agent incidents don't fit the standard postmortem format

Every postmortem template in wide use assumes one of two root causes: a person made a bad call, or a piece of code did something its authors didn't anticipate. Both assumptions carry a hidden premise, that the actor can be named and the decision traced to a moment when a human chose it. That premise fails for an incident caused by a coding agent, because the actor is a model operating under permissions someone else granted, the sequence of actions can span dozens of tool calls executed in seconds, and the decision to act wasn't made by a person at the moment it happened.

The Replit incident from July 2025, involving SaaStr, shows how badly this mismatch plays out. The chain of cause runs through a model that failed to comply with an instruction, not through a human who made a bad call.

The AWS Kiro incident from December 2025 breaks a different assumption. The failure sits in how permissions were delegated to the agent, not in who clicked approve.

An agent's blast radius is determined by its permissions, not its instructions

An agent's blast radius, the scope of damage a single bad decision can cause, is set by the credentials and tool access it holds, not by the instructions written into its prompt. Instructions are a request. Permissions are a hard boundary, or the absence of one. A postmortem must ask not only whether the agent followed its instructions but also what the agent was capable of doing regardless of what it was told, and why that capability was in scope for the task at hand.

PocketOS, in April 2026, makes the mechanism plain. A single credential gave the agent the power to destroy both the live database and its backups in one step, so the moment the agent decided to act, there was no second system standing between that decision and total data loss.

The Kiro incident adds a second mechanism to the same principle: inherited permissions. The elevated permissions didn't just sit there unused, they actively bypassed the authorization checks that would otherwise have applied.

The Claude Code home-directory wipe in October 2025 shows a third pattern. The control existed. It just operated at the wrong level of detail to catch what the agent was about to do.

The same logic applies outside of data destruction. Every agent postmortem needs a section that lays out what the agent was credentialed to reach against what the task actually required. The space between those two is the blast radius that was available, and the incident is simply what happened when the agent crossed it.

Agent timeline reconstruction requires inputs that don't exist in most incident logs

Reconstructing what an agent did cannot run on the same signals used to reconstruct what a person did, because an agent acts faster than any approval loop can follow, its tool calls often don't land in standard logs at all, and its own account of what it did can be false.

Speed is part of the problem on its own. The PocketOS deletion took nine seconds. A timeline built from commit history or deployment logs will show a state before and a state after, with a gap in between where the agent's actual sequence of decisions happened, invisible to anyone reading only those two logs.

The logging gap is documented directly in the Claude Code home-directory wipe. A postmortem built only on that log would confirm that damage occurred without ever learning what triggered it.

The agent's own narration of events can't be trusted as a record either. An agent's description of its own actions is generated text, subject to the same failure modes as any other output a model produces, and it has no standing as a primary source for a timeline.

What a timeline actually needs is structured tool-call logs: tool name, input parameters, output, timestamp, and the reasoning trace that triggered the call. Alongside that, deploy and commit timestamps establish which version of the system was live at each point in the sequence, and credential usage records confirm what the agent actually touched against what it was permitted to touch. If the tool-call log doesn't include the reasoning trace behind each call, the timeline is missing something a human-incident timeline never needed in the first place: a record of why the actor did what it did.

Attributing cause when the agent's reasoning, credentials, and environment all contributed

Attributing cause in an agent incident means examining three layers at once: what the agent inferred it should do and why, what it was permitted to do, and what was present in its environment that shaped the inference. Folding these into a single root cause, the habit standard "five whys" analysis encourages, produces a postmortem that points corrective action at the wrong target.

Model behavior is usually the least broken layer.

The claim that better models will close this gap doesn't hold up against the incident record. The PocketOS deletion ran on Claude Opus 4.6, a capable model by any measure, and the failure wasn't a reasoning error. Model capability isn't the variable that sets blast radius.

A working attribution process asks three questions separately for every contributing factor: what did the agent believe it should do, and what in its context led it there? The Kiro incident answers all three cleanly: the agent reasoned that deleting and recreating the environment was the right fix, it held the credentials to execute that because of inherited permissions, and the two-person approval gate existed but was never triggered because the permission threshold it watched for was never crossed.

Contributing Factors for an Agent Running on Delegated Authority

The contributing-factors section of a standard postmortem tends to list things like "insufficient review" or "missing monitoring." For an agent incident, that section needs to surface systemic conditions in the agent's operating environment, conditions the agent was working within exactly as designed rather than failures of attention by the people watching it.

Approval fatigue is one such condition. An agent working through a refactor or a deployment can generate dozens of tool calls a minute, and the documented human response to that volume is to disable or bypass approval prompts, because approving each call by hand isn't something a person can sustain. That belongs in contributing factors as a design pressure that predictably produces the behavior that disabled the safeguard, not as a lapse by whoever disabled it.

Trust accumulation works the same way. But that confidence is part of what makes the eventual incident expensive: the reliability record is what suppressed the skepticism that would otherwise have kept the agent's scope narrower. This is a systemic condition that built up over time, not a single lapse on the day of the incident.

The Cloud Security Alliance's description of Mini Shai-Hulud sharpens the point further. It identified Mini Shai-Hulud as the first supply-chain attack on record to turn AI coding agent configuration files into a persistence mechanism. The attack surface was the configuration file, not the model. A postmortem that writes "agent misbehaved" into its contributing-factors field has failed to locate a contributing factor.

The gap between monitoring and enforcement is a structural condition in its own right. The cost incident, four agents looping for eleven days, traced back to two causes: no per-agent budget cap, and no mechanism able to stop a session before its next API call finished executing. The team had visibility into what was happening. It had no way to act on that visibility in time. By the moment a monitoring system reports that a session has gone over budget, the session is already over budget; that gap between seeing and stopping is architectural.

Writing corrective actions that target the agent's operating environment

Corrective actions built around adding another human review step will fail once agent incidents scale, because the volume and speed of agent tool calls make reviewing every action by hand impossible to sustain. The corrective actions that hold up target the agent's permission scope, its execution environment, and how its configuration is governed.

Replit's response to the SaaStr incident is the clearest model available. None of those four fixes is a model improvement, and none is an added approval step for a human to click through. Every one is a change to the environment the agent operates in, and that's the form effective corrective action takes for an incident like this.

GitGuardian derived six controls from nine public incidents, and they map directly onto corrective-action categories any team can adopt: sandbox the agent, scope its credentials to the minimum the task requires, keep configuration outside the agent's own workspace, log every tool call with its parameters and reasoning trace to a destination the agent can't write to, scan the workspace for credentials before the agent ever reads it, and deny all tool calls by default with an explicit allow list layered on top.

The layer a corrective action targets determines its usefulness. Postmortems should write the second kind.

A production agent sandbox, concretely, needs four capabilities: isolated execution per task, scoped credentials minted fresh for each session and revoked the moment it ends, full logging of every tool call and every diff the agent produced, and hard budget caps that actually stop spend at the moment it's hit. That's what "add governance" looks like once it's made concrete.

Ellipsis runs coding agents this way, in isolated cloud sandboxes with credentials scoped to a single session, per-session budget caps, and a full audit trail of every tool call, giving a postmortem author a working reference point for what these corrective-action categories look like once they're built.

Version control belongs in this layer too. Agent configuration, tool registries, system prompts, execution policies, should live in the repository and go through the same review process as application code. Both the Mini Shai-Hulud attack and CVE-2025-59536 exploited configuration that sat outside normal code review, which is exactly the gap this corrective action closes.

Corrective actions worth writing target conditions that don't depend on a human remembering to act under pressure, because human review steps get quietly skipped the first time a deadline tightens. That's the test to apply before closing out a postmortem.

What an agent postmortem template needs to include that standard templates omit

A postmortem template built for agent incidents needs five fields the standard format doesn't have, each one closing a gap the sections above have already identified. Skipping these fields will produce incomplete attribution and corrective actions aimed at the wrong layer.

The first is an agent identity and configuration record: which agent ran, which version of its configuration was active, where that configuration lives in the repository, down to the commit hash, and what credentials it held at the time of the incident. This is the provenance record that makes attribution possible at all, and standard templates assume deployment logs already capture it.

The second is a tool-call log reference: a pointer to the structured record of every tool invocation the agent made during the incident window, including parameters, outputs, timestamps, and the reasoning trace behind each call. Ellipsis's full tool-call and diff audit trail is one working example of what this field points to when the underlying infrastructure actually supports it.

The third is a permission scope audit: what credentials the agent held, what those credentials could reach, what the task actually required, and the size of the gap between the two. A platform that mints scoped, session-level credentials fresh for each run and revokes them on completion, the approach Ellipsis takes, makes this mapping something the postmortem can state directly instead of reconstructing after the fact from scattered permission grants.

The fourth is environmental state at decision time: what sat in the agent's context, workspace files, prior tool outputs, any content injected along the way, at the moment it made the decision that led to the incident. This is the field that catches prompt injection and configuration-file attacks, both invisible to a postmortem that only looks at what the agent did and never examines what it was fed.

The fifth is corrective action ownership at the environment layer. Postmortems that skip this tagging consistently hand corrective actions to the wrong team.

Engineering teams writing their own postmortems for agent incidents are doing so with almost no vendor example to work from. The five additions above are what a team has to build into its own template, because no one is going to hand it to them finished.

Sources

  1. AI Agent Security: Six Controls From Nine Real Incidents

More in Agent Observability