AI agents · OpenClaw · self-hosting · automation

Quick Answer

What Infrastructure Do You Need to Run AI Agents at Scale?

Published:

The short answer

Running agents at scale is less about the model and more about seven pieces of plumbing around it: a model gateway, durable execution, sandboxes, protocols, identity, observability and approval gates. A single agent in a notebook needs none of them; a thousand concurrent agents that take actions on real systems need all of them. Tool names and prices below are as of October 17, 2026.

The seven layers

LayerWhat it doesExample tools (Oct 2026)Why it matters at scale
1. Model gatewayOne API over many models; fallbacks, rate limits, budgets, cachingLiteLLM, OpenRouter, Cloudflare AI GatewayProvider outages and rate limits stop fleets, not single agents
2. Durable executionPersists each step so runs resume after crashes, deploys and timeoutsTemporal Cloud ($50 per 1M actions, $150 free credits), Inngest, RestateAgent runs last minutes to days; retries must not repeat side effects
3. SandboxesIsolated machines for code, shell and browser actionsE2B (Hobby free with $100 credit; Pro $150/mo + per-second usage; 100 concurrent on Pro), Modal, DaytonaUntrusted generated code must not touch production hosts
4. ProtocolsStandard tool and agent interfacesMCP (agent→tool), A2A (agent→agent)Avoids N×M custom integrations
5. Identity and secretsOne identity per agent, short-lived credentials, brokered secretsInfisical, HashiCorp Vault, AWS Secrets ManagerA prompt injection can only steal what the agent can read
6. Observability and evalsTraces of every model and tool call; offline and online evaluationLangfuse (Core $29/mo, Pro $199/mo), Arize Phoenix, LangSmith; OpenTelemetry GenAI conventionsYou cannot debug a 40-step run from logs
7. Policy and approvalsAllow/deny rules, spend caps, human sign-off on risky actionsGateway policies, workflow signals, approval queuesLimits the blast radius of a wrong action

How the pieces fit

A production agent run looks like this: a workflow (layer 2) starts the run and records each step; each step calls a model through the gateway (1) and tools over MCP (4); code and browsing happen inside a sandbox (3) holding only short-lived credentials (5); every call emits a trace (6); and any action above a risk threshold pauses for an approval signal (7) before the workflow continues. Hand-offs to another team’s agent go over A2A.

Protocols: MCP vs A2A

  • MCP is client-server over JSON-RPC: the agent discovers a server’s tools, resources and prompts and calls them. Anthropic contributed it to the Linux Foundation’s Agentic AI Foundation, formed December 9, 2025 with Block’s goose and OpenAI’s AGENTS.md.
  • A2A lets independent agents discover each other through agent cards, exchange tasks and stream results for long-running, asynchronous work. The Linux Foundation reported more than 150 supporting organisations and integration across Google, Microsoft and AWS on April 9, 2026.

Use MCP inside your system; add A2A only where agents owned by different teams or vendors must collaborate.

What to measure

Borrow from distributed-systems monitoring, then add AI-specific signals:

  • Per run: latency, steps, tokens and cost; retries and loop detection; final success or failure.
  • Per tool: call volume, error rate, p95 latency.
  • Quality: task success on an offline eval set before each release; sampled online scoring (LLM-as-judge plus human review).
  • Safety: blocked actions, policy violations, approval wait times, secrets accessed per agent.

Emit traces using OpenTelemetry’s generative-AI semantic conventions so you can switch tracing vendors without re-instrumenting.

A build order that works

  1. Tracing first — you will need it to debug everything else.
  2. Gateway with a fallback model and per-agent budgets.
  3. Durable execution once runs exceed a few minutes or call paid or irreversible APIs.
  4. Sandboxes before any agent executes generated code.
  5. Per-agent identity and brokered secrets before agents touch production systems.
  6. Approval gates on writes, payments, emails and deletes.
  7. A2A only when you have agents across team or company boundaries.

Go deeper: best LLM gateways, best durable execution platforms for AI agents, best AI agent sandboxes, best secrets managers for AI agents, how to monitor and evaluate AI agents in production, MCP vs A2A vs ACP.

Last verified: October 17, 2026. Prices are list USD from vendor pricing pages.

Sources