Understanding Agent Reliability: Crash Survival and Side Effect Duplication

When deploying large language model (LLM) agents that interact with external systems, two critical concerns emerge: agent resilience during crashes and the potential for duplicate execution of side effects. Developers worry about the state of ongoing tasks when an agent process terminates, particularly at approval gates. Does the work restart from scratch, or can it resume where it left off? Equally concerning is the risk of an LLM retrying an operation, potentially leading to the same external action—like a data mutation or a notification—being triggered twice. This double-execution risk can have severe consequences, especially for financial transactions or critical system updates.

A previous analysis identified a failure where the Strands framework, using a specific LLM, double-fired a publish call with an identical draft. This article details 34 additional runs, using the same task, model, and a recorder proxy, to quantify this behavior and understand its implications. The goal is to move beyond anecdotal evidence and provide measurable data on agent reliability under failure conditions.

The full code, traces, and analysis scripts are available in a public repository, allowing for transparency and further investigation by the community.

Diagram illustrating LLM agent workflow with external effects and potential crash points

Methodology: Replicating and Measuring Failures

The experimental setup involved a consistent task designed to trigger external effects. This task was executed 34 times under controlled conditions. A key component of the setup was the use of a recorder proxy. This proxy meticulously logs all interactions between the LLM agent and external systems, providing a detailed audit trail of every action taken. This is crucial for identifying duplicate executions.

The specific scenario under scrutiny involved an agent reaching an approval gate. If the process simulating this gate were to crash, the test would then observe how the agent recovers. The critical measurement focused on whether the agent, upon recovery or retry, would re-execute the same side effect that was in progress or had just been completed before the crash. The Strands framework, previously identified as exhibiting this behavior, was the primary focus, alongside the same LLM and recorder proxy to ensure comparability with prior findings.

The definition of a 'crash' in this context typically means the interruption of the agent's execution thread or process. The subsequent 'retry' refers to the LLM's decision to re-initiate a task or a sequence of tasks, either automatically as part of its error handling or in response to a simulated recovery of the environment. The 'side effect' specifically refers to an action that modifies state outside the LLM's immediate execution context, such as sending an email, updating a database, or making an API call.

Findings: The Persistence of Double-Execution

Across the 34 runs, a concerning pattern emerged: the LLM agent, when faced with a simulated crash at an approval gate, consistently exhibited a tendency to re-execute the same side effect. In several instances, the agent not only resumed its workflow but also performed an action that had already been completed prior to the crash. This indicates a significant challenge in agent state management and recovery mechanisms.

The data suggests that the LLM, when presented with a failure state, does not reliably retain the context of completed external actions. Instead, its retry logic appears to re-evaluate the task from a point that includes previously executed side effects, leading to duplication. This behavior was observed even when the task and model remained identical, highlighting a fundamental limitation in how these agents handle transient failures and manage their interaction history.

While the exact failure point and recovery path can vary, the core issue of side effect duplication persists. This is not a subtle bug; it is a direct risk to operations that rely on agents for critical, non-idempotent tasks. The Strands framework, in this specific configuration, demonstrated this weakness, raising questions about the robustness of other agent frameworks under similar stress conditions.

Log output snippet showing duplicate 'publish' calls from the LLM agent

Implications for Agent Development and Deployment

The findings have immediate and significant implications for anyone developing or deploying LLM agents that interact with external systems. The risk of double-execution is not theoretical; it is a measurable outcome of current agent architectures. This means that any application relying on agents for tasks such as financial transactions, order processing, or critical data updates must implement robust safeguards against this behavior.

Developers cannot assume that an agent's internal state management will prevent duplicate side effects. Instead, they must build external idempotency into their systems. This could involve using unique transaction IDs, implementing checks before executing critical actions, or designing workflows that can tolerate or explicitly handle duplicate operations. The burden of ensuring correctness shifts from the agent framework itself to the surrounding application infrastructure.

Furthermore, the question of crash survival is directly linked to this. If an agent cannot reliably resume without re-executing past actions, then a crash is not merely an interruption; it is a potential data corruption event. This necessitates a re-evaluation of how agents are architected and deployed, particularly in high-stakes environments. The current state of agent reliability, as measured by these runs, suggests a cautious approach is warranted.

Addressing the Double-Execution Problem

The core of the problem lies in the LLM's lack of inherent memory for completed side effects within a single execution flow, especially when that flow is interrupted. When the agent retries, it essentially re-evaluates the task history and may decide to perform an action that was already completed before the interruption. This is akin to a chef, after a momentary power flicker in the kitchen, deciding to chop the onions again even though they were already chopped.

To mitigate this, developers must implement strategies at the application level. For instance, before an agent performs a critical side effect like charging a credit card or sending a confirmation email, the application layer should check if this action has already been successfully logged or completed. This requires maintaining a persistent record of executed actions, keyed by a unique identifier for the task or operation.

Another approach is to design agent tasks to be as idempotent as possible. An idempotent operation is one that can be applied multiple times without changing the result beyond the initial application. However, not all operations are naturally idempotent, and forcing idempotency can add complexity. For actions that are inherently state-changing and not idempotent, such as sending a notification, external checks and balances are essential. The research highlights that relying solely on the LLM or the agent framework for this critical reliability is currently insufficient.

The Unanswered Question: Beyond Strands and Specific Models

While this study specifically measured the Strands framework with a particular LLM, the underlying problem of state management and side effect duplication is likely broader. What remains unaddressed is the extent to which this behavior is endemic across different LLM agent frameworks and models. Are there architectural patterns or specific LLM training methodologies that inherently mitigate this risk, or is this a universal challenge that all developers must proactively engineer around?

The 34 runs provide concrete evidence for a specific configuration. However, the broader ecosystem of LLM agents is rapidly evolving. Understanding the commonalities and differences in failure modes across various agent architectures and underlying LLM capabilities is crucial for establishing reliable AI systems. This research serves as a critical data point, but a comprehensive understanding requires further comparative studies and rigorous testing across the diverse landscape of AI agents.