What Product Teams Actually Give Up When They Self-Host Agents on General-Purpose Cloud
Self-hosting agents buys control but costs the product work it displaces.

Managed cloud hosting for AI agents should supply compute and take responsibility for agent execution, per-user isolation, provisioning, monitoring, and recovery. For most product teams, those responsibilities are the strongest reason to choose a managed platform. Self-hosting on general-purpose cloud trades engineering time for control, and the real cost is the product and customer work that ongoing infrastructure maintenance displaces.
Why the gap between a working agent and a production agent is an infrastructure problem, not a model problem
A local agent demo has forgiving conditions. One user sends a prompt, the agent calls a tool, and the test case is easy enough for it to give an answer the user can use. Production removes those conditions. Concurrent users start long-running loops, tool chains add five or more round-trips per prompt, and work may pause for human approval before resuming hours later.
That changes what the hosting environment must support. A single request can involve several model calls taking seconds each, memory retrieval, tool execution, and parallel subtasks before a response assembles. Streaming connections must stay open, and state must still be there after restarts. Better model output does not solve those problems, so the hosting decision is really a decision about which production systems the team will build and maintain.
The five-layer production stack that general-purpose cloud cannot assemble for you
An Amsterdam fintech example shows the gap clearly. An agent used a service account that could read every folder, without per-user scoping, and surfaced a client's file to the wrong analyst. Nothing left the building, but the wrong person received it. The deployment location was not the failure. The missing boundary between a proposed tool action and an authorized action was.
A production agent needs five distinct layers, beginning with a model server that serves tokens predictably. Ollama fits a single-user workload, while vLLM fits a queue. Above that, the runtime owns the execution loop, state, budgets, stop rules, and escalation paths. The tool boundary then decides which model proposals become actions, under whose identity, and with what scope.
Memory and context form the fourth layer. They need a written policy governing what the agent may remember and retrieve, because a prompt injection that enters memory can become a standing instruction. The fifth layer is an audit trail that records actions across the tool boundary as well as user prompts. General-purpose cloud provides building blocks that teams must assemble into these safeguards. Teams may spend the most time debating the model server, but the runtime and tool boundary create much of the operational work.
What the runtime layer demands that most self-hosted setups skip
The runtime turns a model loop into controlled work. It must enforce budgets, distinguish how a run ended, and provide an escalation path the agent cannot override. Those rules need maintenance as workflows change. A chat interface that works says little about whether a run can stop safely, explain what it spent, or pick up after it was interrupted.
A stateless agent can fit into serverless functions, while a stateful agent needs a durable store for conversation history, working memory, and accumulated observations. Human approval makes persistence especially important. A workflow waiting hours for a decision must retain enough state through a restart or redeploy to resume where it stopped.
Hosting limits can make that obligation harder to meet. Vercel and Netlify impose wall-clock timeouts, while Cloudflare Workers limits CPU time, excluding time spent waiting on I/O. Long-running or compute-heavy loops can reach those limits. Containers avoid those particular constraints, but add orchestration, health checks, and operational management. Every tool round-trip adds latency and one more way for the work to fail.
Why the tool boundary is the layer with the highest incident rate and the least tooling support
The tool boundary is where model output becomes action. An API key usually identifies the calling application. If every user shares that identity, the downstream service cannot distinguish their permissions. Consent, individual revocation, and attribution then become systems the product team must supply.
A sandbox controls which files and networks a workload can reach, while authorization decides which action a particular user may take. Those are different questions. General-purpose cloud can contain the process without supplying the product's rules for access. An agent can therefore remain inside its environment and still expose information improperly.
Composio addresses this layer with managed authentication, storing credentials per userID and isolating email, GitHub, and team messaging connections by default. The agent inherits the permissions of the user it represents, and policy-as-code evaluates tool calls before execution. Coverage still depends on the purchased plan. Audit logs and SCIM provisioning come with the enterprise tier, while teams on Pro can pay per-call charges for some compliance add-ons, including BAA and IP allowlisting. Managed integration can remove work, but teams must account for capabilities that are not included by default.
What self-hosting genuinely fixes on security — and what it leaves entirely unresolved
Data residency is a legitimate reason to self-host. Keeping data in an environment the team controls can meet requirements that a third-party deployment cannot and make the team less exposed to a vendor's outages and price changes. For some regulated teams, that control is necessary. It deserves evaluation on legal and operational grounds.
The legal requirements need careful interpretation, however. HIPAA permits transmission of protected health information under a BAA, while FedRAMP High requires appropriate authorization for third-party services. PCI-DSS v4.0 governs third-party service providers, and the EU AI Act is a risk-classification framework under which third-party model use remains possible. None makes local hosting a universal answer. The team needs to check whether a deployment meets the rules it must follow.
Residency also leaves several threats entirely unresolved. Prompt injection, tool poisoning, memory poisoning, and privilege escalation can occur inside a self-hosted environment. Containment and detection therefore need separate consideration. Self-hosting also puts incident response on the team's own rota, so ownership includes the engineering capacity to respond at 3am.
How per-user isolation fails when it is not built into the agent architecture from the start
Without architectural isolation, a shared runtime can let one user's working memory, tool permissions, or context bleed into another's session. The product must authenticate each customer at the front door and keep their ongoing work separate.
For the product model described here, the unit of scale is one isolated, persistent agent per customer, provisioned automatically at onboarding. Without that automation, every new account creates manual work. Someone must provision infrastructure, configure credentials, set permissions, verify isolation, and document the instance. Customer growth then expands the operating burden before the team has earned time back from it.
An OAuth consent screen naming the infrastructure vendor rather than the product can damage trust and reduce conversion. Composio supports using the product's own OAuth app credentials to show its brand, but that remains an integration the team must maintain. Billing, usage limits, partner permissions, and onboarding automation also remain unbuilt on general-purpose cloud. A functioning agent is not yet a finished B2B product, and assembling those pieces can push monetization back another quarter.
The observability and recovery obligations that become permanent engineering work
Operating the stack requires evidence of what it does. The audit trail must show which users and permissions were behind each action, while observability must show what failed, what looks unusual, and how well execution is going. That involves telemetry instrumentation, a log pipeline, action-count metrics, anomaly alerts, and a playbook for human review. Each is another system to maintain. When the evidence pipeline fails, the team loses the means to explain failures elsewhere.
A workflow that suspends and resumes needs checkpoints in a persistent store, so a restart does not silently erase a customer's unfinished task. Persistence is only part of the commitment. The team also owns the recovery path and the work required when the runtime, tool broker, memory store, or audit pipeline fails.
Each layer needs monitoring, patches, and steps for recovery as the product changes. Fast shipping can hide this cost temporarily. Without defect-rate tracking, change-failure-rate measurement, and rollback instrumentation, apparent delivery speed can coexist with defects that reach customers and become expensive to diagnose. Weak spots in hosting tend to become visible in use when users already expect fast responses and spending on tokens is going up.
What the operational tax actually displaces inside a product team
Infrastructure work consumes the same hours as product work. Engineers have to spend time on the first deployment, security hardening, setting up monitoring, and CI/CD setup before customers get a service they can count on. In a manually provisioned setup, much of that work repeats for each new instance. Automation can reduce repetition, but building and maintaining it is also part of the commitment.
The recurring workload is harder to see in advance. Patching, incident response, state recovery, model updates, and integration maintenance do not end when the first deployment succeeds. They compete with improving agent capability and customer experience. For a founder handling new accounts directly, infrastructure configuration also competes with selling and supporting existing customers. The compute invoice captures little of that displacement.
A managed platform changes who owns this work. The Stripe analogy is useful because payment infrastructure let software companies accept payments without becoming payments companies. The corresponding agent platform model takes on provisioning, uptime, billing controls, security, and per-user isolation, leaving the product team responsible for what its agent delivers. That is the practical value of handing off infrastructure.
How to decide which layers to self-host and which managed cloud hosting for AI agents to choose
The decision should follow workload needs, layer by layer. Self-hosting the model server can be right when data residency is a legal requirement, proprietary weights require fine-tuning, or inference volume justifies the infrastructure and the platform engineer needed to operate it. Ollama suits a single-user model-serving workload, while vLLM suits queued demand. Neither choice resolves the other four production layers.
For stateless work that fits execution limits, serverless hosting remains a candidate. Long-running, stateful agents need evaluation beyond simple request handling, centered on durable execution, persistence, and recovery. Teams that mainly need tool authentication can look at managed integration such as Composio while keeping in mind that they still need hosting beyond it. For multi-customer agent products, the stronger default is a managed platform that supplies isolated, persistent agents and automated onboarding.
That distinction makes platform comparisons more useful than a generic ranking. A service specifically designed to deploy and run agents at scale should own the runtime lifecycle, per-user isolation, provisioning, security controls, monitoring, recovery, billing controls, and integrations. Platform comparisons should distinguish the obligations the platform actually assumes from those that remain with the team.
Compliance must also follow the full deployment path. Codex CLI's Goal Mode persists session directives in a thread-scoped SQLite store on the user's machine, so that feature does not fit a no-data-leaves-our-VPC policy. Before a team commits to self-hosting any layer, it should name who will be on call, what the recovery path will be, how the audit mechanism will work, and how it will handle provisioning for each new customer. An unanswered question is unfinished operational work. For most product teams, the right boundary leaves them owning the agent's distinctive capability and delegates responsibility for the systems required to keep it running.


