AI agents are moving beyond short conversations. Developers are building agents that inspect codebases, execute tools, run tests, investigate failures, and complete workflows that may take hours to finish.
However, running an agent in production introduces a different set of engineering challenges. What happens if the process crashes halfway through a task? How does it resume after a user approval is required? What prevents two distributed components from corrupting the same session? And how can teams isolate code generated by an agent?
Google Cloud introduced Agent Executor, an open-source runtime standard for agent execution, resumption, and distributed deployment, to address these problems.
Announced on May 20, 2026, Agent Executor is designed to make long-running agent workflows more resilient. It provides capabilities such as durable execution, secure isolation, session consistency, connection recovery, and checkpoint-based branching.
For developers building production AI systems, the important change is that reliability becomes part of the runtime rather than something every agent application must implement independently.
What Is Google Cloud Agent Executor?
Agent Executor is a runtime layer designed to manage the execution of AI agents and their supporting components.
A typical agent application contains several parts: a model, an agent framework, tools, external services, and application state. The framework determines how the agent reasons and selects actions, while the tools perform operations such as querying a database, reading files, or executing code.
The runtime is responsible for managing execution across these components.
Agent Executor is designed to support agents built with different frameworks and deployment models. These include custom agents built with LangChain, LangGraph, Google's Agent Development Kit (ADK), and agents that communicate through the Agent2Agent (A2A) protocol.
It can also work with different agent harnesses and execution environments rather than requiring developers to adopt one specific model or framework.
This separation matters because an agent framework defines how an agent works, while a runtime helps determine how reliably that agent executes in production.
Why Long-Running AI Agents Need a Different Runtime
Traditional web applications often process a request, return a response, and finish the operation. Long-running agents behave differently.
An agent might need to:
Read a large codebase.
Identify a problem in the application.
Generate a proposed change.
Run tests and inspect the results.
Ask a developer for approval.
Apply an approved change.
Verify the outcome and report completion.
The workflow may involve multiple tools, external services, intermediate decisions, and waiting periods.
If the process fails after step four, a basic implementation may lose its in-memory state and need to repeat earlier work. If the client disconnects while the agent continues running, the user may lose access to intermediate responses. If multiple workers modify shared state simultaneously, the workflow can become inconsistent.
Production challenge | What can go wrong | Runtime capability needed |
|---|---|---|
Process failure | An unfinished task loses its progress | Durable execution and recovery |
Human approval | The workflow stops while waiting for a decision | Resumable execution |
Client disconnection | The user misses responses generated during the interruption | Connection recovery |
Concurrent updates | Multiple components overwrite shared session state | Session consistency |
Untrusted generated code | An agent operation affects resources outside its intended boundary | Secure isolation |
Alternative execution paths | Developers cannot easily compare different decisions from the same starting point | Checkpoint-based branching |
Agent Executor is designed around these operational requirements rather than treating agent execution as a single model call.
1. Durable Execution Through Events and Snapshots
One of the most important features is durable execution.
A long-running agent should not depend entirely on the continued availability of a single process. If the process is interrupted, the system needs enough recorded state to continue the workflow safely.
Agent Executor uses an event log and snapshots to support this behavior.
An event log records relevant execution activity. A snapshot captures a representation of the workflow's state at a particular point. Together, these mechanisms can help the runtime reconstruct execution after an interruption.
Consider a code-review agent that has already analyzed several files when its worker process fails.
Without durable state, the application may need to restart the entire review. With a suitable durable execution design, the runtime can restore the recorded workflow state and resume from an appropriate checkpoint.
A simplified conceptual representation looks like this:
Agent task started
|
v
Record execution events
|
v
Execute tools and update state
|
v
Create checkpoint or snapshot
|
v
Process interrupted?
|
+----+----+
| |
No Yes
| |
v v
Continue Restore recorded state
| |
+----+----+
|
v
Resume workflowThis illustrates the general recovery pattern, not a literal Agent Executor API or guarantee that every external operation can be replayed safely.
Durable execution is especially useful when an agent must wait for external input, perform lengthy investigations, or coordinate several steps before producing a final result.
Developers still need to consider side effects. If an agent sends a payment request or creates a cloud resource before a crash, blindly repeating the operation could produce duplicate effects. Idempotency keys, operation records, and explicit completion checks remain important.
2. Secure Isolation for Agent Execution
AI agents can generate code, execute commands, and process data supplied by users or external systems. That flexibility creates security risks when the agent runs with access to sensitive infrastructure.
A generated script could delete files, read credentials, or attempt to access resources outside its intended scope. A malicious prompt could also try to persuade an agent to perform an unauthorized operation.
Agent Executor uses secure isolation to help limit the impact of such behavior. Sandboxed execution environments can separate agent components from the broader service and from workloads belonging to other users.
For example, a code-generation agent could run tests inside an isolated environment instead of executing arbitrary generated commands directly on an application server.
A production implementation should establish several boundaries:
Filesystem isolation: Restrict which files and directories the agent can access.
Network restrictions: Limit outbound connections to approved destinations.
Identity controls: Give the agent only the credentials and permissions required for its task.
Resource limits: Control CPU, memory, execution time, and other resource consumption.
Tenant separation: Prevent one user's agent execution from accessing another user's data.
Sandboxing is not a replacement for application authorization or secure infrastructure configuration. It is an additional layer of defense that helps contain potentially unsafe execution.
3. Session Consistency in Distributed Workflows
Distributed agent systems may involve several components that communicate through a shared session. These components might include an agent, a tool executor, a human-approval handler, and a background worker.
If multiple components update the same session concurrently, conflicting writes can produce inconsistent state.
Imagine an agent that is updating a task status while a separate component records a human approval. If both updates are applied without coordination, one component could overwrite information written by the other.
Agent Executor addresses this class of problem through a single-writer architecture for shared session state.
The principle is straightforward: coordinate state updates so that concurrent components do not independently modify the authoritative session state in conflicting ways.
This is useful for agents that maintain conversation history, track tool execution, or coordinate work across multiple steps.
However, developers should distinguish session consistency from consistency in external systems. A single-writer session model does not automatically make database updates, API calls, or other external side effects transactional.
Those operations still need their own consistency and recovery strategies.
4. Connection Recovery for Long-Running Tasks
A disconnected client does not necessarily mean that an agent's task should be abandoned.
For example, a developer may start an agent that investigates a large repository. The browser tab closes, the network connection drops, or the terminal session disconnects while the agent continues working.
Agent Executor supports reconnecting clients and backfilling responses from the last sequence observed by the client.
This helps the application recover a more complete view of the conversation after reconnection.
A simplified client-side sequence tracker could look like this:
class AgentClientState:
def __init__(self):
self.last_seen_sequence = 0
def record_response(self, sequence_number):
if sequence_number > self.last_seen_sequence:
self.last_seen_sequence = sequence_number
def reconnect_request(self):
return {
"last_seen_sequence": self.last_seen_sequence
}This example illustrates the client-side idea of tracking the last observed response. It is not a drop-in implementation of the Agent Executor protocol.
A real integration must use the runtime's supported connection and recovery interfaces.
The broader lesson is that a production agent interface should treat reconnection as a normal operating condition, not necessarily as a reason to restart the task.
5. Checkpoint-Based Branching for Testing Agent Decisions
Agent workflows are not always deterministic. The same initial task can lead to different tool selections, intermediate decisions, or implementation strategies.
Agent Executor supports trajectory branching through checkpoints. Developers can branch from a recorded point in a workflow to explore alternative paths without losing the original execution history.
Consider a software-maintenance agent that has identified a failing test. The developer may want to compare two possible fixes:
Branch A changes the implementation.
Branch B changes the error-handling logic.
Starting both investigations from the same checkpoint makes it easier to compare the resulting behavior.
This capability can support debugging, evaluation, and experimentation. It can also help teams investigate why an agent selected a particular action.
However, branching execution does not automatically guarantee that two paths are reproducible. Model responses, external APIs, timestamps, and other changing inputs can affect results. Developers should capture relevant inputs and control external side effects when reproducibility matters.
How Agent Executor Fits Into an AI Architecture
Agent Executor is not a replacement for the model, agent framework, or business logic. It operates as part of the infrastructure that manages agent execution.
A simplified architecture can be represented as follows:
User or Application
|
v
Agent API or Interface
|
v
Agent Framework or Harness
|
v
Agent Executor Runtime
|
+-------------------+
| |
v v
Agent State and Isolated Tool
Recovery Mechanisms Execution
| |
+---------+---------+
|
v
External Services
Databases and APIsThis is a conceptual architecture. The actual deployment depends on the chosen framework, runtime configuration, and infrastructure.
Google describes Agent Executor as a way to support different agent implementations and deployment models. Teams can use compatible Google-built agents, managed agents, or their own agents built with supported frameworks and protocols.
This flexibility is relevant to organizations that want to retain control over their models, execution environments, data residency, and infrastructure policies.
Agent Executor and Kubernetes: Understanding the Difference
Agent Executor also fits into a broader infrastructure direction that includes Agent Substrate, an open-source project designed to improve the way large numbers of agent workloads use compute capacity on Kubernetes.
The two projects address related but different problems.
Area | Agent Executor | Agent Substrate |
|---|---|---|
Primary focus | Reliable agent execution, resumption, and distributed deployment | Efficient scheduling and utilization of compute for agent workloads |
Main concerns | Durable state, session consistency, recovery, and isolation | Compute capacity, scheduling overhead, and execution density |
Role in the architecture | Runtime for managing agent execution | Infrastructure layer for scaling agent workloads |
Typical motivation | Keep long-running workflows reliable | Handle large volumes of short-lived agent operations efficiently |
Traditional Kubernetes deployments often organize compute around long-running services. Agent workloads can have different patterns: they may wait for external input, invoke tools frequently, or require isolated execution environments for short periods.
Agent Substrate is designed to address some of these scaling challenges while building on Kubernetes and existing sandbox infrastructure.
The projects can complement each other, but they are not interchangeable. A team should choose components according to its execution, isolation, and scaling requirements.
Best Practices for Production Adoption
Agent Executor can simplify important runtime concerns, but reliable production systems still require careful application design.
Make External Operations Idempotent
A recovered workflow may encounter an operation that was started before an interruption. Design important operations so that retries do not create duplicate payments, records, deployments, or other side effects.
Separate State From Process Memory
Do not assume that in-memory variables will survive worker replacement. Identify the state required to resume a workflow and ensure it is captured through the runtime's supported mechanisms.
Keep Tool Permissions Narrow
Give each agent access only to the resources it needs. Use separate identities and authorization boundaries for development, testing, and production.
Test Failure and Recovery Scenarios
Simulate process interruptions, client disconnections, and delayed human approvals. Verify that the workflow resumes correctly and does not repeat completed side effects.
Monitor Execution and Resource Usage
Track workflow duration, failed operations, retries, resource consumption, and recovery behavior. These metrics help identify whether the runtime improves reliability without introducing excessive overhead.
Define Human Approval Boundaries
Require approval for sensitive operations such as production deployments, destructive changes, and privileged infrastructure modifications. Make the approval state explicit so the workflow can resume safely after a decision.
Conclusion
Google Cloud Agent Executor addresses an important gap in production AI development: managing agent execution reliably after the initial model response.
Its combination of durable execution, secure isolation, session consistency, connection recovery, and checkpoint-based branching provides a foundation for long-running workflows that need to survive interruptions and coordinate multiple components.
For developers, the main benefit is a clearer separation between agent logic and the infrastructure required to run that logic reliably. Teams can focus on building useful agents while using a dedicated runtime to manage important execution concerns.
Agent Executor was introduced as an open-source project in preview. Before adopting it, teams should verify the current release status, supported interfaces, and deployment requirements.
The practical starting point is a workflow that already needs recovery, human approval, or isolated execution. Test that workflow under failure conditions, validate how external operations behave during recovery, and expand the architecture only when the operational benefits are clear.
Join the conversation! Your thoughts help the community grow.