Cover illustration for “Skipping the Generic Cloud Stack When You Ship Your First Production AI Agent”
First Agent Setup

Skipping the Generic Cloud Stack When You Ship Your First Production AI Agent

November 11, 20269 min read1,950 words

Share

Text: Marcus Oyelaran

Purpose-built agent hosting removes the safety work generic cloud leaves to you.

Managed cloud hosting for AI agents should provide persistent sessions, per-user isolation, policy checks, managed tools, and agent-specific observability. For teams shipping their first production agent, purpose-built infrastructure is the better starting point because it removes work that generic cloud leaves to the builder. The choice is about who owns production failures.

Why production AI agents fail in ways generic cloud was never designed to catch

An agent that auto-resolved tickets perfectly in staging encounters malformed input in production and executes it against a live database. No policy check ran before dispatch. A better prompt does not supply that missing boundary, and a healthy server does not prove the action was safe. The gap between demo and production is structural.

A production agent authenticates a user, retrieves enterprise knowledge, calls external APIs, validates results, enforces policy, and logs its actions. It may then hand work to another agent. Each step adds another place where things can fail, and some steps change systems outside the agent itself. This is a distributed-systems problem with real-world side effects. Generic serverless functions and self-managed computing environments can host the code, but they do not supply the coordination and controls that make those actions dependable.

The six infrastructure layers an agent actually needs, and what breaks when any one is missing

State and pointers form the first layer, recording job state and references to context and results so a run can be reconstructed. Without them, incidents turn into archaeology. The scheduler supplies deterministic retries, timeouts, and dead-letter handling for work that cannot complete. Without that layer, runs become orphaned or execute twice under retry pressure. These are execution requirements, whether the agent answers a question or performs a long investigation.

The policy decision point checks an action before dispatch and routes risky actions into an approval queue. It is the highest-leverage control because it intervenes before a side effect occurs. Output safety is a separate layer that can let results with sensitive information through, redact them, or quarantine them. Input checks cannot do that job alone. The audit trail then preserves an immutable timeline of actions, decisions, and approvers, giving an incident investigation evidence.

Memory is the sixth layer, and prototypes often underestimate it. Conversations in progress need short-term state, while tool-call history and summarized context need long-term persistence. Keeping the full conversation in memory also makes token costs compound as the context window fills. Stateless FAQ lookups need no memory between turns, ongoing conversations need stateful sessions, and long-running investigations need asynchronous execution with queues, workers, result storage, and notifications. A platform for customer service may need all three.

Diagram: The Six Infrastructure Layers a Production AI Agent Needs. Visualizes: Visualize six sequential infrastructure layers that a production AI agent requires, showing what breaks when each is absent.

What assembling those layers yourself actually costs in founder time and money

The advertised cost of self-hosting is the compute bill. The real cost includes the engineering hours spent provisioning, securing, monitoring, and recovering the stack before and after customers arrive. Initial setup consumes time before a single user is served, even though that work never appears on a cloud invoice. Spread across the first year, it remains part of the deployment cost. A cheaper machine does not eliminate it.

On a generic stack, the founder owns VPS provisioning, Docker configuration, SSH hardening, and secrets management, including keeping API keys in vaults. Stateful agents add load balancers and session affinity. Monitoring built for agents adds tool-call traces and reasoning-step logs that standard application monitoring does not record. Incident response and rollback drills also belong before launch. None of that work improves the agent’s core task, but production still depends on it.

The burden grows with the customer base. When every customer needs an isolated agent instance, manual deployment means repeating a meaningful share of the provisioning work for each one. Managed hosting changes where that work sits, while self-hosting leaves it with the team. The useful comparison is therefore compute plus engineering responsibility.

Why stateful, per-user session isolation is the hardest requirement to retrofit onto generic infrastructure

A shared, stateless application can handle each request on its own. A stateful agent cannot make that assumption. Conversation history, working memory, and tool-call history belong to a particular user and must remain inaccessible to other users’ agent instances. Retrofitting that boundary changes both how requests are routed and how state is stored. It is not a setting applied only at the network edge.

Load balancers must either keep a user on the same agent instance or send requests to instances that can safely reach shared state. Both approaches require explicit user boundaries. External credentials and OAuth tokens also need to be stored and refreshed for each user, with no shared credential pool. Permissions need their own scope as well. A research agent reading web pages should not have filesystem write access, and a coding agent should not reach production databases.

Composio addresses the authentication part at the tool layer through a session-per-user model. A builder creates a session for a user ID and requests tools through that session, scoping pre-authenticated toolkits to the individual user. Those toolkits include GitHub, Slack, Gmail, Notion, Jira, and more than a thousand others. With this, the builder no longer has to build each OAuth flow or handle each token refresh. Boundaries around the agent’s own session state remain necessary.

The security controls that generic cloud skips and agents cannot operate without

Generic cloud security centers on the network perimeter and identity. Those controls are necessary but insufficient for an agent that can write to infrastructure and act through external services. Tool over-permissioning lets a compromised agent exceed its assigned scope, while data exfiltration can expose PII and secrets through outputs. In multi-agent systems, identity spoofing and lateral movement can spread a compromise. Training data poisoning adds inputs meant to corrupt how the model behaves over time.

Pre-dispatch policy enforcement places a deterministic decision before the action. An in-process check sits inside the agent’s trust boundary, while an out-of-process check sits outside it, an increasingly common audit expectation for regulated deployments. Output safety remains necessary even when that check is present because permission to act does not prove a result is safe to release. Network access controls alone answer neither question.

Microsoft Agent Governance Toolkit, Galileo Agent Control, and CyberArk’s Secure AI Agents Solution formalize subsets of these controls. OWASP Agentic Top 10 and NIST AI RMF provide the broader security and governance frame. Coverage cannot simply be assumed from an agent’s availability. The 2025 AI Agent Index documents sandboxing or VM isolation for only a minority of evaluated agents, primarily developer/CLI tools and browser agents. The same index finds that a large share have no documented guardrails, so builders have little on record to start from and no evidence of containment.

How the integration layer breaks at scale on generic cloud, and what a managed tool layer does instead

A function that calls GitHub and another that calls Slack can look easy to manage in a demo. Each service then needs its own OAuth flow, a place to store each user’s token, a way to handle refreshes, and changes to keep up with its API. The work grows with the agent’s capabilities. An agent that reaches more services inherits more authentication and maintenance obligations, even if its core logic stays unchanged. Generic hosting runs those integrations but leaves their upkeep to the builder.

A continuing session must handle token expiry. Google OAuth tokens expire after one hour, and Slack tokens that use rotation expire within a fixed window. Concurrent agent tasks can attempt refreshes at the same time and conflict silently. Separately, API version changes can break an integration that worked for months without any change to the agent. Per-user token storage also becomes a security surface that needs its own audit.

A managed tool layer takes on authentication and token refresh instead of making the builder repeat that work service by service. Composio’s user-scoped sessions illustrate that division of responsibility. The agent gets tools through a user boundary without the builder having to make a set of credential flows by hand. This is a distinct requirement from hosting the runtime. A managed deployment that leaves all tool authentication to the builder still leaves a substantial part of production operations unfinished.

The observability gap: why LLM-specific behavior is invisible to standard monitoring tools

Standard application performance monitoring keeps track of latency, error rates, and resource use. Production debugging also needs tool-call sequences, recorded reasoning steps, policy decisions, and token usage for each step. Distributed tracing must follow work across agents because the failure can occur two or three hops from where the error appears. A signal that a request succeeded cannot show all of that.

Timeouts show how an agent can fail silently. An API responds slowly, the agent waits, requests pile up, and the system degrades without an error appearing in standard monitoring. A single timeout for the whole session hides which step is responsible. Per-step timeouts prevent one slow tool call from cascading, while per-step success rates, latency, and token usage reveal where execution is going wrong. The useful unit of inspection is the action.

The audit trail adds the context needed to explain that action, including the active policy, approver, and full input context. Purpose-built platforms surface agent-specific observability in the runtime rather than leaving it as another integration for the builder to assemble. Without those records, debugging LLM behavior in production is nearly impossible. That blindness also prevents a team from judging whether a new deployment is safe to expand.

Staged rollout as a first-class deployment requirement, not an optional practice

An all-or-nothing cutover exposes every user before correctness regressions become visible. For agents, rollback cannot undo every side effect. Messages may already have been sent, database writes performed, or billing events triggered. At double expected load, a backed-up scheduler and retries can also produce duplicate executions and conflicting customer responses. Deployment control therefore belongs in the agent’s infrastructure.

The rollout starts with synthetic and replay testing, which includes replaying production requests through the policy engine without side effects. Live traffic then advances through small gates, with objective metrics evaluated between stages. A failed gate requires immediate rollback. Generic cloud has blue/green deployments and canary weights, but the builder must set and enforce the gate criteria for agents. Purpose-built platforms can embed those controls in the deployment workflow, tying wider exposure to evidence that the agent behaves correctly.

Which managed cloud hosting approach fits a first production AI agent?

For a first customer-facing agent, managed or no-code platforms offer the lowest infrastructure burden and minutes-to-days time-to-value. They fit teams focused on building agent logic. Platform or low-code approaches, including orchestration frameworks on self-managed infrastructure, sit in the middle, with days-to-weeks time-to-value. Their builders still own whatever layers the platform does not cover. Fully self-hosted custom deployments take weeks-to-months and place all six layers, and their incidents, with the team.

Persistent session state, per-user isolation, security controls, managed integrations, agent-specific observability, and staged rollout distinguish agent infrastructure from a place to run containers. A managed label alone proves little. For a team with three engineers shipping its first production agent, the recommendation is to start with purpose-built hosting that covers those requirements. No single hosting product in the supplied material establishes complete coverage, so the recommendation rests on capabilities.

Retrofitting those capabilities means repairing architecture while real users and real data are already exposed. Missing policy checks, hand-rolled OAuth, invisible tool failures, and uncontrolled rollouts each make that repair harder than prevention. The choice is not managed versus technical. Stripe let software companies take payments without becoming payments companies, and the same idea applies here. The goal is to give every customer their own agent, with managed hosting that provisions, monitors, and recovers one for each of them.

More in First Agent Setup