TL;DR: Long-running loops outgrow context windows, compaction loses critical IDs, and pod restarts force replay decisions that can duplicate side effects or reopen the same PR, according to Edge Delta. The real control problem is durable execution, not just more iterations, because agent state must survive both memory pressure and crash recovery.
At a glance
What this is: Edge Delta argues that long-running agent loops fail when context, compaction, and replay are not engineered for durable execution.
Why it matters: This matters because IAM and NHI teams increasingly need agent workflows to survive restarts, preserve action identity, and avoid duplicated side effects in operational investigations.
Context
Agent loops are stateful investigations, not single prompts. Once an AI system spends hours pulling logs, checking dashboards, and testing hypotheses, the governing problem becomes how to preserve working memory, action history, and side-effect identity across time.
For IAM, NHI, and agentic AI programmes, the risk is that the control plane assumes a session can be safely compacted or replayed when the agent actually depends on durable context. A restart, a compaction error, or a replayed side effect can turn one investigation into duplicate actions or lost evidence.
This is typical of production agent design: the failure is not that the model cannot reason, but that the surrounding execution model was built as if reasoning were stateless.
Key questions
Q: What breaks when agent loop memory is compressed too aggressively?
A: Over-aggressive compression can drop the exact IDs, counts, timestamps, and prior decisions the agent needs to continue safely. The run may still finish, but it resumes from incomplete state, which leads to repeated work, lost evidence, or duplicate external actions. The control problem is not summarisation itself, but whether compaction preserves durable working memory.
Q: Why do long-running agent workflows need replay protection?
A: Because a multi-hour workflow will eventually restart, and anything already pushed outside the system must not be executed again. Replay protection preserves the original result for completed steps, which prevents duplicate commits, duplicate PRs, and inconsistent state after recovery. Without that boundary, the agent can drift into a subtly different execution path.
Q: How do teams know if agent memory controls are actually working?
A: Look for evidence that sensitive data stays bound to the correct identity, that memory entries can be traced and removed, and that replay tests do not produce cross-session leakage. A healthy program produces clear audit records, consistent retention behaviour, and no unexplained reuse of prior context in unrelated workflows.
Q: What is the difference between context compaction and durable execution?
A: Context compaction reduces the working history so the model can keep operating, while durable execution preserves the identity and result of side effects across restarts. Compaction is about what the model remembers, but durable execution is about what the system guarantees will not happen twice. Both are needed, but they solve different failure modes.
Technical breakdown
Why long-running agent loops outgrow context windows
A simple while loop that appends every tool call and result to the message history looks reliable until the investigation becomes long enough to exceed the model’s usable context. At that point, the model starts losing earlier IDs, decisions, and dead-ends, while compute cost rises because every new step resends the entire history. The failure is architectural, not prompt-related: the loop treats memory as an ever-growing transcript instead of a governed working set. Once the conversation becomes larger than the model can carry, fidelity drops in ways that are hard to see immediately.
Practical implication: design for bounded working memory and explicit preservation of critical identifiers, not unlimited transcript growth.
How context compaction becomes a governance control
Compaction is the risky step because it converts a long history into a shorter surrogate memory. If the summary omits exact IDs, timestamps, file paths, or prior decisions, the agent resumes from a distorted version of its own work. A faithful compression prompt therefore behaves more like a control specification than a summarisation request. It must preserve the exact facts needed for later action and prohibit invention, rounding, or truncation. When this is done well, the summary becomes durable working memory rather than an approximate note.
Practical implication: make compression deterministic, conservative, and loss-aware, because summary quality now determines future agent behaviour.
Why replay identity must survive pod restarts
Durable execution matters because a multi-hour run will eventually restart, and the system cannot safely re-execute an action that already touched the outside world. If a step opened a PR, pushed a commit, or wrote to an external system, replay must return the original recorded result instead of generating a new one. That means the identity of each side effect has to be fixed at first execution and reused on resume. In agentic systems, replay safety is not just about avoiding duplicate work; it is about preventing the recovered run from drifting into a different reality.
Practical implication: persist action identity and replay records for every side effect that must not happen twice.
NHI Mgmt Group analysis
Durable execution is the real control plane for agent memory. Long-running agentic workflows fail less because the model stops reasoning and more because the system treats memory as disposable conversation history. Once an investigation crosses the context boundary, the platform must preserve exact IDs, decisions, and action results as governed state. For IAM and NHI programmes, that shifts the design problem from prompt quality to lifecycle control over agent state.
Context compaction creates a new integrity risk. Summarisation is not neutral housekeeping when the summary becomes the only memory the agent has after a restart. If exact identifiers, counts, timestamps, and prior dead-ends are lost, the agent may repeat work or branch from an inaccurate premise. Durable context loss: this is the failure mode where compressed memory no longer preserves the facts needed for safe continuation. Practitioners should treat this as a control-gap issue, not a usability issue.
Replay safety must govern every side effect an agent can trigger. The article correctly frames the restart problem as a deterministic identity problem, not just a crash-recovery problem. If a resumed agent can regenerate new IDs or repeat an external action, the system has no stable audit trail and no trustworthy recovery boundary. In security terms, the recovered agent is only as safe as the side effects that are persisted and replayed exactly once.
Agent loops expose a governance gap between reasoning and execution. Many programmes focus on whether the model can continue thinking, but the harder question is whether the surrounding orchestration can preserve intent across interruptions. That gap becomes especially important when agents act as operational intermediaries in incident response, cloud operations, or identity workflows. The practitioner conclusion is straightforward: govern the execution substrate with the same discipline you apply to privileged workflows.
For NHI and agentic AI security, action identity is as important as authentication. A resumed agent that cannot prove which side effect already occurred is functionally indistinguishable from a duplicated non-human identity event. That is why the article’s emphasis on recording the first execution and reusing it on replay matters. Security teams should think in terms of durable action lineage, not just access approval and session scope.
What this signals
Durable context is now an operational control, not a design convenience. Once agents participate in long-running investigations, teams need to govern what the system remembers, what it compresses, and what it can replay after interruption. The programme risk is not just lost reasoning, but duplicated external actions that survive a restart path.
Action lineage becomes the key design concept for agentic governance. The question is whether a non-human workflow can prove which side effect already happened and resume from that boundary without mutation. That pushes security, platform, and identity teams toward durable state management for agent actions, not just authentication and approval at the front door.
For practitioners
- Define durable execution for agent workflows Record completed steps, side effects, and returned values so a restart resumes from saved state instead of rerunning external actions.
- Preserve exact identifiers during compaction Require summaries to retain IDs, counts, timestamps, file paths, error messages, and prior decisions, and reject any summary that invents or truncates facts.
- Treat replayable actions as idempotency-sensitive Assign stable identities to commits, PRs, tickets, or other external actions at first execution and reuse those identities on recovery.
- Fail closed when compression is unavailable If compaction fails after the configured retries, stop silently dropping context and force the agent to finish with explicit remaining work.
- Detect prose that hides intended tool calls Parse natural-language intent that describes an action and convert it into the proper structured tool invocation before the loop terminates.
Key takeaways
- Long-running agent loops fail when state is treated as disposable chat history instead of governed memory.
- Context compaction must preserve exact identifiers and decisions, or the agent resumes from distorted history.
- Durable execution is the control that prevents restarts from repeating side effects or reopening completed work.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 addresses the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | ASI08 — Cascading Failures | Long-running agent loops fail when compaction and restart handling cascade into repeated actions. |
| ASI03 — Identity & Privilege Abuse | Agent action identity and replay safety are core when non-human workflows trigger external side effects. | |
| Recommendation — Design agent orchestration to contain cascading failures when memory compaction or restart recovery goes wrong. Bind each agent side effect to a stable identity and prevent replay from creating new privileged actions. | ||
| NIST AI RMF | MANAGE — Manage AI risks and impacts | Durable execution and memory control are operational AI risk management issues. |
| Recommendation — Implement controls that manage AI system memory, state continuity, and failure recovery across deployments. | ||
| NIST CSF 2.0 | PR.AA-05 — Access Permissions, Entitlements and Authorizations | Agent actions must remain bounded and authorized even as sessions continue or resume. |
| Recommendation — Enforce authorization boundaries for agent actions and validate them again after recovery or replay. | ||
Key terms
- Durable Execution: Durable execution is a workflow design pattern that preserves state so a process can resume after failure without redoing completed work. In AI agent systems, it turns a fragile run into a recoverable sequence with replay, history, and auditability.
- Context Compaction: Context compaction is the process of summarising or pruning conversation history so a long-running AI session can continue inside a fixed token window. It is useful for continuity, but it can also remove standing instructions, making it a security-sensitive operation in agentic systems.
- Action Identity: Action identity is the stable reference assigned to a side effect, such as a commit, ticket, or PR, so the system can recognise that it has already happened. It is essential for replay-safe agent loops because recovery must reuse the original action rather than create a new one.
- Replay Safety: Replay safety is the property that completed operations are not executed again when a workflow restarts. For agent systems, it ensures a recovered run returns the prior result for completed steps instead of producing a new external action with a different outcome.
Deepen your knowledge
NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course. Explore how durable execution and action lineage fit into identity governance for modern AI programmes.
Published by the NHIMG editorial team on August 18, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org