Skip to main content
Agentic AI
AI Infrastructure
Comparison
Updated Nov 2026

What Is an Agent Runtime? Managed Options Compared With Self-Hosting

The runtime is where an AI agent's loop actually executes: sessions, isolation, long-running work, identity and traces. Here is what Amazon, Google, Microsoft and Anthropic now offer, and what you build yourself if you host it.

Published November 28, 2026 · HostingX Solutions LLC

Short answer

  • An agent runtime (or “agentic runtime”) is the hosting layer that runs an agent's loop of model calls and tool calls. It keeps per-user session state, isolates sessions from each other, lets work run for minutes or hours, gives the agent an identity for the tools it calls, and records traces.

  • Plain serverless functions fit short steps, not whole agent sessions. AWS Lambda's maximum timeout is 30 minutes and a Cloud Run request's is 60 minutes, and neither keeps a session's files and state between calls.

  • The managed options are Amazon Bedrock AgentCore Runtime (a microVM per session, up to 8 hours, or 14 days on Instances), Google Agent Runtime in Gemini Enterprise Agent Platform (formerly Vertex AI Agent Engine), Microsoft Foundry hosted agents (a VM-isolated sandbox per session) and Claude Managed Agents (Anthropic's agent harness plus sandbox, in beta).

  • Self-hosting on Kubernetes is still a fair choice when you need to stay in your own cluster. Plan to build session routing, a state store, per-session isolation and idle cleanup yourself, or start from the Kubernetes agent-sandbox project or LangSmith Agent Server.

What Is an Agent Runtime?

An AI agent runs a loop: call the model, run the tool it asks for, feed the result back, and repeat until the task is done. The framework (LangGraph, Google's Agent Development Kit, Strands, CrewAI, Microsoft Agent Framework or your own code) defines that loop. The runtime is the infrastructure the loop runs on. Search terms such as “agentic runtime”, “agentic backend” and “AI agent backend infrastructure” all point at this layer.

A runtime has to handle six things that a typical web API does not:

  • Sessions. Each user or task gets a session that keeps conversation history, files and working state between requests.

  • Isolation. Agents run code, write files and hold user data, so one session must not see another's memory or filesystem.

  • Long-running work. A task can take minutes or hours, often mostly waiting on model and tool responses, and may continue after the client disconnects.

  • Identity. Users authenticate into the agent (inbound), and the agent authenticates to the APIs and SaaS tools it calls, either as itself or on a user's behalf (outbound).

  • Protocols. Clients reach the agent over HTTP or WebSocket; tools increasingly sit behind MCP servers; other agents may call it over A2A.

  • Observability. Traces need to show each reasoning step, tool call and model call, not just request latency.

The runtime is separate from the tools the agent calls. If those tools are MCP servers, they are hosted like stateless APIs; our guide to running MCP servers in production covers that side. For the wider stack around agents (queues, vector databases, monitoring), see agentic AI infrastructure.

Why Don't Plain Serverless Functions Work for Agents?

They work for short, single steps, such as classifying a ticket or summarizing one document. They struggle with whole agent sessions because of time limits and missing state:

  • AWS Lambda: the timeout defaults to 3 seconds and can be raised to 1,800 seconds (30 minutes). Functions on Lambda Managed Instances allow up to 5,400 seconds (90 minutes) for asynchronous and event source mapping invocations.

  • Google Cloud Run: the request timeout defaults to 5 minutes and can be raised to 60 minutes. Google recommends implementing retries for timeouts longer than 15 minutes, because the connection is more likely to drop.

  • No session state: each invocation starts clean, so conversation history, downloaded files and installed packages have to live in an external store and be reloaded on every call.

  • Shared execution environments: code the agent writes or runs, and files it downloads, need a boundary per user. A function instance isn't designed as that boundary.

The common workaround is a queue plus long-running workers, which is what our agentic infrastructure guide describes. Managed agent runtimes package that pattern with per-session isolation and identity built in.

How Do the Managed Agent Runtimes Compare?

RuntimeWhat you deployIsolationSession lengthProtocolsBilling basis
Amazon Bedrock AgentCore RuntimeA container with any framework: LangGraph, Strands, CrewAI or your own codeA dedicated microVM per session; memory is sanitized when the session endsUp to 8 hours on microVMs, up to 14 days on Instances; 15-minute idle timeout by defaultHTTP, MCP, A2A, AG-UICPU and memory consumed, billed per second; CPU isn’t billed during I/O wait
Google Agent Runtime (Gemini Enterprise Agent Platform)A container image from Artifact Registry, or a Dockerfile that Google builds; SDK templates for ADK, LangChain, LangGraph, AG2, LlamaIndex and CrewAINot described on the overview pagesNot stated on the overview pages; see the quota and system limits pageA2A (preview)Unified Agent Platform SKUs: vCPU-hours, GiB-hours of memory and GiB-months of storage
Microsoft Foundry hosted agentsA container image in Azure Container Registry; Python or C#; Agent Framework, LangGraph, Semantic Kernel or custom codeA VM-isolated sandbox per session, with a persistent $HOMEIdle timeout of 2 to 240 minutes (15 by default); a session is deleted after 30 days without activityResponses, Invocations (HTTP and WebSocket), Activity, A2A v1.0Allocated CPU and memory per session while its compute runs, including idle time before suspension
Claude Managed Agents (beta)An agent definition (model, system prompt, tools, MCP servers and skills), not your own agent loopAn Anthropic-managed cloud sandbox, or a self-hosted sandbox on your infrastructureBuilt for tasks that run for minutes or hours; sessions resume after pausesBuilt-in tools plus MCP serversModel tokens plus $0.08 per session-hour of active runtime
Self-hosted (Kubernetes, ECS, Cloud Run)Your containerWhatever you build, for example a pod per session with gVisor or Kata through agent-sandboxYour choice on Kubernetes; Cloud Run requests stop at 60 minutes, Lambda functions at 30Whatever you implementYour compute bill

From each vendor's documentation and pricing pages, November 2026. Model and tool usage is billed separately on every option.

Amazon Bedrock AgentCore Runtime

AWS describes AgentCore Runtime as a secure, serverless hosting environment for agents and tools. You package the agent as a container; AWS lists LangGraph, Strands and CrewAI as working frameworks, along with custom agents, and any model, including models on Amazon Bedrock, Anthropic Claude, Google Gemini and OpenAI.

Isolation and session limits

Each user session runs in a dedicated microVM with its own CPU, memory and filesystem. When the session completes, the microVM is terminated and its memory sanitized. Two settings control session lifetime:

  • idleRuntimeSessionTimeout: 900 seconds (15 minutes) by default. Each new invocation of the same session resets it.

  • maxLifetime: 28,800 seconds (8 hours) by default and at most on microVMs. The timer starts when the microVM is created and can't be reset.

  • On Instances, the second compute type, agents run on AWS-managed EC2 capacity in your own account. Both settings accept up to 1,209,600 seconds (14 days), and AWS lists GPU workloads and multiple collaborating agents on one instance as uses.

Sessions keep the code version they started with. If you deploy new agent code, existing sessions run the old version until they end. Filesystem state can also persist across session stop and resume.

import boto3

client = boto3.client('bedrock-agentcore-control', region_name='us-west-2')

client.create_agent_runtime(
    agentRuntimeName='my_agent_runtime',
    agentRuntimeArtifact={
        'containerConfiguration': {
            'containerUri': '123456789012.dkr.ecr.us-west-2.amazonaws.com/my-agent:latest'
        }
    },
    lifecycleConfiguration={
        'idleRuntimeSessionTimeout': 1800,  # 30 minutes
        'maxLifetime': 14400                # 4 hours
    },
    networkConfiguration={'networkMode': 'PUBLIC'},
    roleArn='arn:aws:iam::123456789012:role/AgentRuntimeRole'
)

Adapted from the AgentCore lifecycle settings guide. Account ID, image and role are placeholders.

Background work

For work that continues after the agent has replied, the container reports its state on a /ping endpoint. Healthy means idle; HealthyBusy means a background task is running, and the session then stays alive past the idle timeout. With the AgentCore SDK you mark tasks and it reports the status for you:

from bedrock_agentcore.runtime import BedrockAgentCoreApp

app = BedrockAgentCoreApp()

# While the task is open, /ping returns {"status": "HealthyBusy"}
task_id = app.add_async_task("data_processing")
# ... run the work in a separate thread ...
app.complete_async_task(task_id)

AWS warns that a blocking entrypoint can also block the ping handler, which is the usual reason a long-running agent is terminated after 15 minutes. Run blocking calls in a separate thread or as async code.

Protocols, identity and payloads

  • Protocols: HTTP on port 8080 at /invocations (and /ws for WebSocket), MCP on port 8000 at /mcp, A2A on port 9000 at the root path, and AG-UI. Each accepts SigV4 or OAuth 2.0.

  • Identity: AgentCore Identity gives each agent its own identity and integrates with identity providers such as Okta, Microsoft Entra ID and Amazon Cognito. Outbound calls to services such as Slack, Zoom and GitHub can use OAuth or API keys, on behalf of a user or autonomously.

  • Payloads and streaming: payloads up to 100 MB, and bidirectional streaming over WebSocket.

  • Tracing: built-in traces of reasoning steps, tool invocations and model calls. Observability is charged at Amazon CloudWatch rates.

Pricing

Runtime on microVMs bills the CPU and memory a session actually consumes, per second, with a 1-second minimum and a 128 MB memory minimum. CPU scales to zero during I/O wait, which is where an agent spends much of its time while it waits for a model or tool. The pricing page lists these rates:

AgentCore Runtime (microVMs)CPUMemory
Original platform (v1)$0.0895 per vCPU-hour$0.00945 per GB-hour
Platform version 2, consumption$0.1276 per vCPU-hour$0.0169 per GB-hour
Platform version 2, committed baseline$0.0997 per vCPU-hour$0.0132 per GB-hour

Platform version 2 starts agents from a snapshot to keep cold starts fast, and reclaims idle memory after 120 seconds. The pricing page lists the committed-baseline rates as launching by October 2026. Instances are billed at the EC2 instance cost plus a management fee that is a percentage of the EC2 On-Demand price. Check the AgentCore pricing page for the rates in your region.

Google Agent Runtime (Formerly Vertex AI Agent Engine)

Google now documents its managed runtime as Agent Runtime, part of Gemini Enterprise Agent Platform: “a fully-managed, opinionated runtime that you can use to deploy, operate, and scale agentic applications.” The old Vertex AI Agent Engine overview URL now serves the Agent Platform overview, Google's 2026 price sheet still refers to the previous “Agent Engine SKUs”, and the API resource is still called ReasoningEngine because, in Google's words, the name of Agent Runtime changed over time.

  • What you deploy: a container image from Artifact Registry, or a Dockerfile with your source, which Agent Runtime builds for you. Any language or framework works if the app can be containerized and follows the runtime contract. Higher-level SDK templates exist for ADK, LangChain, LangGraph, AG2, LlamaIndex and CrewAI.

  • Platform services: Sessions, Memory Bank, Code Execution, Example Store and an evaluation service sit next to the runtime.

  • Security: VPC Service Controls and IAM-based authentication. For deployed agents, customer-managed encryption keys work only on single-region endpoints, not the multi-regional us or eu endpoints.

  • Protocols and observability: A2A is supported in preview. Traces go to Cloud Trace and logs to Cloud Logging.

On pricing, Google's 2026 price sheet consolidates Runtime, the Code Execution sandbox, Sessions and Memory Bank into three SKUs, listed from June 17, 2026: Agent Platform Compute at $0.085 per vCPU-hour, Agent Platform Memory at $0.009 per GiB-hour and Agent Platform Storage at $0.30 per GiB-month. The previous Runtime compute SKU was $0.0864 per vCPU-hour. See the Agent Platform pricing page for current rates.

Microsoft Foundry Hosted Agents

Foundry Agent Service has two kinds of agents. Prompt-based agents are defined in the portal with prompts and tools. Hosted agents are your own code in a container image, pushed to Azure Container Registry. On deploy, Agent Service gives the agent a dedicated Microsoft Entra ID identity and a dedicated endpoint.

  • Frameworks and languages: Python and C#, with hosting integrations for Microsoft Agent Framework and for LangChain, LangGraph and Deep Agents. Semantic Kernel and custom code also work through the protocol libraries.

  • Isolation: each session runs in its own VM-isolated sandbox. $HOME and files uploaded through /files persist across turns and idle periods, so a session can scale to zero and resume with its files.

  • Session lifetime: the idle timeout is configurable per agent version from 2 to 240 minutes, with a 15-minute default. A running background response keeps the session active. Sessions are deleted after 30 days of inactivity.

  • Protocols: Responses (OpenAI-compatible, with platform-managed conversation history), Invocations for arbitrary JSON and webhooks, Invocations over WebSocket for real-time voice, Activity for Microsoft 365 channels, and A2A v1.0.

  • Tools and tracing: tools such as Code Interpreter, web search, Azure AI Search, OpenAPI and MCP are reached through a Toolbox MCP endpoint. Application Insights receives OpenTelemetry traces automatically.

  • Versions: each version is immutable, and an endpoint serves one version at a time; traffic splitting isn't supported.

You choose the sandbox size per agent version. A few of the published combinations:

CPUMemoryMaximum $HOME storage
0.25 vCPU0.5 GiBUp to 3 GiB
1 vCPU2 GiBUp to 12.8 GiB
4 vCPU8 GiBUp to 60 GiB
16 vCPU32 GiBUp to 100 GiB

Billing differs from AgentCore in one important way: Foundry bills the CPU and memory allocated to each session for as long as its compute runs, not what the code uses, and idle time counts until the platform suspends the sandbox. Oversizing therefore multiplies cost by concurrency, and Microsoft recommends stopping sessions when work is done. Hosted agents are available in US regions including East US, East US 2, Central US, North Central US, South Central US, West Central US, West US and West US 3. Rates are on the Foundry Agent Service pricing page.

Claude Managed Agents

Anthropic's offering has a different shape. Instead of hosting your agent loop, Claude Managed Agents provides the loop itself: a configurable agent harness that runs in managed infrastructure. You define an agent (model, system prompt, tools, MCP servers and skills) and an environment, then start sessions and exchange events with them over server-sent events.

  • Built-in tools: Bash, file operations, web search and fetch (optionally limited to allowed domains), and MCP servers.

  • Where sessions run: an Anthropic-managed cloud sandbox, a self-hosted sandbox on your own infrastructure, or the whole service self-hosted. Scheduled deployments run agents on a cron schedule.

  • Status: beta, behind the managed-agents-2026-04-01 header, on the Claude API, Claude Platform on AWS and Claude Models on Google Cloud (Anthropic managed). Anthropic announced it on April 8, 2026.

  • Pricing: standard Claude token rates plus $0.08 per session-hour of active runtime.

  • Data handling: sessions are stateful and stored server-side, so Managed Agents isn't eligible for Zero Data Retention (except when self-hosted) or HIPAA BAA coverage.

Pick it when Claude is your model and you want a working agent harness with sandboxed tools quickly. If you need your own loop, another model provider or a specific framework, one of the container-based runtimes fits better.

What Do You Build When You Self-Host?

Running the agent as containers on Kubernetes, Amazon ECS or Cloud Run keeps everything in your own account and network, at the cost of building what the managed runtimes include:

  • Session routing and state: map each session ID to its state and route follow-up requests to it; keep conversation history and checkpoints in a database, not in a pod's memory.

  • Isolation: a pod or task per session for agents that run code, a sandboxed container runtime, network policies and no shared writable volumes.

  • Lifecycle: idle timeouts, maximum lifetimes and cleanup, so abandoned sessions don't keep compute running.

  • Background work: a queue and workers for tasks that outlive the request.

  • Identity and secrets: per-agent credentials from a secret manager, and OAuth flows for acting on a user's behalf.

  • Tracing: OpenTelemetry spans around every model and tool call.

Two open-source projects cover part of this. agent-sandbox, developed under Kubernetes SIG Apps, adds a Sandbox resource for “isolated, stateful, singleton workloads” such as agent runtimes: one stateful pod with a stable identity and persistent storage. SandboxTemplate, SandboxClaim and SandboxWarmPool add reusable templates and a pool of pre-warmed sandboxes, and isolation itself comes from runtimes such as gVisor or Kata Containers configured through a RuntimeClass. For LangGraph and other frameworks, LangChain's LangSmith Agent Server (formerly LangSmith Deployment) is “the runtime for agent workloads”, with durable execution and streaming; it runs fully managed, hybrid, self-hosted, or as a standalone server on Docker or Kubernetes.

For the cluster underneath, see our guide to platform engineering on Kubernetes.

How Do You Choose an Agent Runtime?

  • Start from the cloud and identity provider you already run. Each managed runtime ties agent identity to its own IAM (AWS IAM and AgentCore Identity, Google IAM, Microsoft Entra ID), and that is where most integration work sits.

  • Match the session shape. Short chat turns fit any option. Multi-hour background tasks fit AgentCore microVMs (up to 8 hours), Foundry with background responses, or Managed Agents. Multi-day work points to AgentCore Instances or self-hosting.

  • Decide how strong isolation must be. If agents execute code or handle untrusted input, prefer per-session VM isolation (AgentCore microVMs, Foundry sandboxes) or a sandboxed runtime such as gVisor or Kata if you self-host.

  • Check compliance before you build. Confirm HIPAA, data residency and retention terms per service; Claude Managed Agents, for example, isn't currently HIPAA-eligible.

  • Model the bill on your traffic. Consumption billing (AgentCore) rewards agents that mostly wait on models. Allocation billing (Foundry) rewards right-sized sandboxes and short idle timeouts.

  • Keep the agent portable. Keep agent logic in the framework and the runtime adapter thin. The container-based runtimes all take a standard image, which makes a later move far easier than rewriting a loop.

For keeping model and GPU spend under control once agents are running, see reducing AI infrastructure costs. For agents that automate operations work with n8n, see agent workflows on n8n.

Production Checklist for Any Agent Runtime

  • One session ID per user or task, never shared across users.

  • Idle timeout and maximum lifetime set deliberately, with background work signalled to the runtime (for example AgentCore's HealthyBusy).

  • No secrets in container images or environment variables; credentials come from the runtime's identity service or a secret manager.

  • Outbound tool access scoped per agent, with an approval step on tools that write or spend money.

  • Traces for every model call and tool call, with session IDs attached.

  • Pinned agent versions, and a plan for sessions that are still running old code after a deploy.

  • Budget alerts on runtime compute and on model tokens, which are billed separately.

Frequently Asked Questions

What is an agentic runtime?

The infrastructure layer that executes an AI agent's loop of model and tool calls. It manages sessions, isolates them, supports long-running and background work, handles inbound and outbound identity, and records traces. Amazon Bedrock AgentCore Runtime, Google Agent Runtime and Microsoft Foundry hosted agents are managed examples.

Can I run an AI agent on AWS Lambda?

For short steps, yes. A Lambda function can run for at most 30 minutes (90 minutes for some invocation types on Lambda Managed Instances), and it doesn't keep session state between invocations, so long or stateful agent sessions need a queue and workers or a managed agent runtime.

What is the difference between an agent framework and an agent runtime?

The framework (LangGraph, ADK, Strands, CrewAI, Microsoft Agent Framework) defines the agent's logic and loop. The runtime hosts it: sessions, isolation, scaling, identity and observability. Most managed runtimes accept agents from several frameworks.

Which agent runtimes support MCP and A2A?

AgentCore Runtime hosts MCP servers and A2A servers as protocols of their own. Foundry hosted agents expose A2A v1.0 and reach tools through a Toolbox MCP endpoint. Google Agent Runtime lists A2A in preview. Claude Managed Agents connects to MCP servers as tools.

How long can an agent session run on AgentCore Runtime?

Up to 8 hours on microVMs and up to 14 days on Instances. The default idle timeout is 15 minutes, and a session reporting HealthyBusy stays alive past it.

What did Vertex AI Agent Engine become?

Google now documents it as Agent Runtime within Gemini Enterprise Agent Platform. The old Agent Engine overview URL serves the Agent Platform overview, and the API resource is still named ReasoningEngine.

Choosing where your agents run?

We help US businesses put AI agents into production: picking the runtime, wiring identity and tool access, tracing, and keeping runtime and model costs in check. The first 30-minute consultation is free.

See also: AI and automation services · Agentic FinOps · LLMOps and model drift

HostingX Solutions LLC logo

HostingX Solutions LLC

FinOps, DevOps, and automation for US businesses.

info@hostingx.solutions

Subscribe to our newsletter

Get monthly email updates about improvements.


© 2026 HostingX Solutions LLC. All Rights Reserved.

LLC No. 0008072296 | Est. 2026 | New Mexico, USA

Legal

Terms of Service

Privacy Policy

Acceptable Use Policy

Security & Compliance

Security Policy

Service Level Agreement

Compliance & Certifications

Accessibility Statement

Privacy & Preferences

Cookie Policy

Manage Cookie Preferences

Data Subject Rights (DSAR)

Unsubscribe from Emails