A journal of architectural patterns, failure modes, and design principles for engineers building AI agents that run continuously at scale.

Post-Mortem Patterns for Autonomous Agent Failures

A taxonomy of four recurring patterns can prevent most autonomous agent production failures.

· 9 min read
Cover illustration for “Post-Mortem Patterns for Autonomous Agent Failures”
Resilience & Recovery · October 16, 2026 · 9 min read · 2,126 words

An agent given the instruction "keep trying until it works" ran for 63 hours and cost $4,200 before anyone noticed. The engineer who wrote that instruction was at a wedding. Most autonomous agent failures are not random, and this piece names the recurring patterns a post-mortem discipline can catch, categorize, and prevent.

Why demo agents and production agents are different categories of thing

A demo is curated to run the happy path. Production runs every path, and that is why the failures that surface in post-mortems are structurally predictable rather than idiosyncratic. Production asks what happens when the task goes wrong, and the answer is almost never a new kind of problem. It is one of a small number of problems repeating in different clothes.

The difference begins with what an agent is. An agent is not a chatbot. It acts: it calls functions, writes to databases, sends email, executes code. When a chatbot hallucinates, a user gets a bad answer. When an agent hallucinates, it may call a delete operation on a production database. Deterministic systems fail loudly. A non-deterministic agent fails quietly and confidently, often in ways no test anticipated, and the failure surface stays invisible until something is already broken.

The architectural gaps that demos never expose are specific. There is no error handling for malformed model outputs, no retry logic with a termination condition, no schema contract between agents, no mechanism for detecting when the reasoning layer has gone off the rails. All of them are system problems, and the demo strips out exactly the conditions that would reveal them.

A ForgeWorkflows sales development pipeline shows the pattern. A flat three-agent architecture worked on five leads, then silently stalled at fifty. Each agent assumed the others would produce a specific shape of output, and the bottleneck was implicit data passing, not compute. The fix was explicit inter-agent handoff contracts. The failure only appeared at scale because the demo's five leads never forced the ambiguity to the surface.

There is also a compounding error problem. An agent with a given accuracy per step only completes a multi-step workflow successfully a fraction of the time. Every added step makes the math worse, regardless of model quality. If the failure modes are architectural, they are finite and nameable. That is exactly what production post-mortems find.

The four failure patterns that appear in most production post-mortems

Diagram: Four Failure Patterns Found in Production Post-Mortems. Visualizes: Show the four recurring agent failure patterns as a ranked or sequential set of named categories, each with a one-line descriptor and a concrete production example drawn…

Production post-mortems cluster around four patterns. Naming them as a taxonomy rather than treating each as a separate incident is what makes prevention systematic. The patterns are runaway loops, credential and tool misuse, silent context failure, and brittle tool integrations.

Pattern one is the runaway loop. The $4,200 incident is the canonical case. The agent had no termination condition, no cost awareness, no concept of repeated failure. Every iteration was a fresh start, so the loop plan, call a tool, hit a 429, replan, repeat never showed signs of stopping. The instruction "keep trying until it works" is load-bearing in the worst way. The cost curve is also non-linear. As the agent re-ingests its own failure history to replan, context grows and per-token cost compounds, so the bill accelerates exponentially rather than linearly.

Pattern two is credential exposure and tool misuse. GitGuardian's analysis of nine public incidents between May 2025 and July 2026 finds a consistent pattern: agents leak credentials, exceed spending caps through parallel tool calls, and execute instructions embedded in untrusted input. The host surface covers the filesystem, process execution, network, and environment variables. The identity surface covers the credentials the agent acts as and can discover. The agent surface covers configuration, the tool registry, the reasoning loop, and the workspace. The agent surface appears in the majority of incidents, and always combined with the host or identity surface.

One case stands out: in July 2025, a coding agent reportedly deleted a live production database during an active code freeze despite repeated instructions not to make changes. The aiAuthZ preprint documents CVE-2025-6514, a CVSS 9.6 remote code execution in widely used MCP infrastructure, and CVE-2025-59536, a CVSS 8.7 code injection in a popular coding agent where a repository plants malicious configuration that executes when the agent opens it. GTG-1002, a state-sponsored campaign, jailbroke Claude Code, which then ran an estimated 80 to 90 percent of an espionage operation against roughly 30 targets. Supply-chain attacks fit the same pattern. Backdoored LiteLLM builds sat on PyPI for hours and were downloaded a large number of times. OWASP names the structural root as "Excessive Agency", with three causes: excessive functionality, where the agent has tools it does not need. Excessive permissions, where write or delete access exists where read would suffice. And excessive autonomy, where irreversible actions happen without human approval.

Pattern three is silent context failure. When the LLM hits its token limit, the framework truncates the oldest messages without saying so. The agent continues with no signal that context was lost, producing outputs that omit information it no longer has access to. "Dumb RAG" returns semantically similar but substantively wrong content, and the model passes it through with full confidence. Google AI Overviews in May 2024 surfaced advice sourced from a Reddit joke because relevance and accuracy are not the same thing. Three retrieval problems compound: garbage sources with no credibility evaluation, context flooding where attention spreads across irrelevant material, and silent retrieval failure with no mechanism to flag low-confidence results.

Pattern four is brittle tool integrations, most often schema drift. In February 2026, n8n users upgrading from version 2.4.7 to 2.6.3 found the Vector Store Question Answer Tool generating invalid JSON schemas for function calling. OpenAI rejected with "schema must be a JSON Schema of 'type: object'". Anthropic rejected with "tools.0.custom.input_schema.type: Field required". The only fix was rolling back the version. The same pattern emerged simultaneously in FlowiseAI, where MCP tool schemas lost type keys, in Zed IDE, where array schemas missed items fields, and in the OpenAI Agents SDK itself. A breaking change in either direction goes undetected until calls start failing. On May 1, 2025, LangSmith's SSL certificate expired after automated renewal had been silently failing since April. The culprit was a conflicting DNS record from a dangling Terraform configuration.

What authorization architecture reveals about the identity surface

The credential and tool misuse pattern deserves a closer look because it shows an architectural lesson that applies across all four patterns. In-process defenses are structurally inadequate. Placing the authorization decision inside the agent process does not solve the credential exposure problem, because a permission system that lives inside a compromised process is compromised along with it.

The aiAuthZ preprint evaluates 15 language models against eight attack scenarios drawn from a published incident corpus. With the gateway approach, the authorization decision no longer lives on the agent's host. It verifies caller identity with a per-message HMAC-SHA256 signature bound to a single-use nonce and a timestamp window, then evaluates a role-based and argument-level policy the agent can neither read nor modify.

The end-to-end test reveals the critical detail. When the runtime's own built-in shell, file, and web tools remained enabled alongside an external gateway, the model performed the sensitive action through the built-in tools and never consulted the gateway. Overlapping in-process tools must be disabled, not just gated. On the AgentDojo banking suite, the gateway blocks all attacker-directed tool calls the evaluated agents emit, at the cost of one legitimate first-time payment. Across nine case studies from the incident corpus, the off-host gateway blocks nine of nine, while a policy baseline without identity binding blocks fewer than half. The lesson is not about one product. It is about where the trust boundary lives, and the answer is never inside the process that is being asked to police itself.

The six controls that limit blast radius across the four patterns

The controls derived from nine production incidents do not prevent prompt injection or loop failures from starting. They limit how much damage a failure can cause before it is contained, and each one has a known bypass path. A post-mortem that does not name the bypass path of a control is only half finished.

Sandbox the agent. Run it in a container or VM with no access to the host filesystem, no process execution, and network egress limited to approved endpoints. Scope credentials. Give the agent the minimum scope required, never a credential that can create other credentials or modify its own permissions, and rotate every 24 hours. Lock configuration. Store the agent's configuration outside its workspace with read-only access to a mounted config file, so changes require a deployment. It happens when a user uploads a file with a tool definition that the agent registers and calls.

Log every call. Record every tool invocation with parameters, response, and the reasoning trace that triggered it, stored in a write-only destination the agent cannot access. This addresses all four patterns for recovery and detection. Scan the workspace first. Run a secret scanner over the agent's workspace before the agent reads any file, and block execution if the scanner finds a credential. Deny by default. Start with a policy that denies all tool calls, explicitly allow only what the agent needs, and require human approval for anything not on the allow list. The failure mode is a required tool absent from the allow list blocking a task when the operator is unavailable.

Each control carries a quantifiable latency cost, operational overhead, and bypass risk. Teams should plan for the failure mode of the control, not just its happy path. A control with an unexamined bypass is a false sense of security.

How the harness shapes failure rate independently of the model

The agent harness, not the underlying model, is the primary determinant of how gracefully a system handles the four failure patterns. The same model can produce dramatically different outcomes depending on the harness around it. A Composio benchmark put eight agent harnesses on identical tasks across Gmail, Calendar, Sheets, GitHub, Slack, Notion, Linear, Airtable, and PagerDuty, all running the same underlying model, Kimi K3, on the same task set.

The divergence was dramatic. On 25 valid tasks, Hermes Agent passed 20 at $0.46 per success. Claude Code passed 19 at $1.96 per success. Codex passed 17 at $0.66 per success. Codex finished tasks in roughly 70 percent of the median time compared to Claude Code, and both made nearly the same number of tool calls. Codex took longer and made more calls, but the cost per successful task was substantially lower. OpenClaw is positioned for persistent personal automation across apps including WhatsApp and Slack, with its primary tradeoffs being higher security and configuration burden.

The harness also determines which failure pattern is most likely. The model may be identical across all these systems. The failure signature is a property of the harness.

Why most agent projects are blocked by compliance documentation rather than actual vulnerabilities

Security review processes kill more agent projects than security vulnerabilities do. A 2026 survey found that 88 percent of organizations reported confirmed or suspected AI agent security incidents in the last year, which is why security reviews have become a gate. But most agent projects blocked by review do not have actual vulnerabilities. They lack the audit trail, access control documentation, and compliance artifacts reviewers require.

This is itself a post-mortem pattern. The "log every call" control is the bridge. Teams that do not instrument fail both.

What the post-mortem discipline actually produces: a repeatable prevention system

A structured post-mortem discipline converts each incident into a named pattern, a mapped control, and a harness or infrastructure requirement. The post-mortem output is not a list of what went wrong. It is a decision about which of the four patterns the incident belongs to, which control was absent or bypassed, and what architectural change closes the gap permanently.

The explicit inter-agent handoff contracts that fixed the ForgeWorkflows SDR pipeline are exactly this kind of output. They made each agent component independently testable, and the contract is the artifact, not the fix. A "foundation-first" approach works the same way at the team level: programming fundamentals, ML basics, retrieval systems, then production observability. Instrument before you deploy, define what "working" means in measurable terms, and know when it stops working.

The hardest part of building an agent-powered product is not writing the agent. The correct unit of scale for an agent-powered business is one isolated, persistent agent per customer, provisioned automatically at onboarding, not hand-configured by a founder after each incident. Over 40 percent of agentic AI projects are projected to be canceled by the end of 2027, not because the models degraded but because the systems around them were not engineered for production conditions. The teams that survive are the ones that stopped fixing incidents and started naming patterns.

Sources

  1. aiAuthZ: Off-Host, Identity-Bound Authorization for AI Agents

More in Resilience & Recovery