The choice between a self-hosted and a managed agent runtime has become one of the most consequential infrastructure decisions enterprises face as they move AI agents from prototypes into production. A managed runtime — think Anthropic's Managed Agents, Amazon Bedrock AgentCore, or hosted offerings from platforms like Ollama Cloud — gives you a vendor-operated execution environment where the provider handles sandboxing, scaling, identity, and updates. A self-hosted runtime, exemplified by open source projects like TrueFoundry's TrueForge, xpander's control layer approach, or Ollama running on your own hardware, puts the orchestration engine, context store, and tool-execution plane inside your own perimeter. The direct answer for most mid-size and large enterprises in August 2026 is this: start with a managed runtime if you are validating use cases with fewer than roughly 50 concurrent agents and no hard data-residency constraints; commit to self-hosting once agents touch regulated data, per-task costs exceed budget thresholds, or you need deep control over context and tool permissions. The economics alone justify attention — VentureBeat reported that TrueForge, an open source agent harness from TrueFoundry, delivers task completion 30% to 75% cheaper than Claude Managed Agents, and Forbes framed TrueFoundry's thesis bluntly: enterprises will own their agent runtime. But cost is only one axis, and the wrong early choice can lock you into an architecture that is expensive to unwind.
What Each Option Actually Is
Also worth reading: What are the definitive agentic AI runtime governance patterns for enterprise software architectures? · How do you go about securing multi agent enterprise workflows in 2026? · What is an AI agent identity governance framework and how do I implement it for enterprise security?
A managed agent runtime is a fully operated service. Anthropic's Managed Agents platform, described in their engineering write-up on "decoupling the brain from the hands," separates model reasoning from tool execution so the provider runs the hands — sandboxes, browsers, code execution environments, and API connectors — while your application supplies goals and consumes results. AWS took a similar path with Bedrock AgentCore, which hosts coding agents and general-purpose agents on managed infrastructure with built-in identity via AgentCore Identity, session isolation, and elastic compute. Harvey, the legal AI company, publicly documented why they built their own cloud agent infrastructure rather than relying entirely on third-party runtimes, citing control over latency, security posture, and cost at scale.
A self-hosted runtime inverts the responsibility model. You operate the orchestration loop, the sandboxing, the memory and context stores, and the gateway through which models are called. Open source options have matured quickly: TrueForge ships as an open source harness compatible with multiple frontier models, xpander positions itself as a self-owned control and context layer that sits above any model provider, and Ollama now runs either as a self-hosted application on your own GPUs or as a managed cloud service with hosted models, web search support, and coding-agent integrations, including use with workflow tools like n8n. The distinction matters because the runtime — not the model — increasingly determines reliability, auditability, and unit cost in production agent systems.
Why This Decision Matters More Than It Did Two Years Ago
In 2024, most enterprise agents were single-model, single-tool demos where the runtime was an afterthought. By 2026, agent sprawl has become a governance problem: VentureBeat's coverage of xpander notes that enterprises confront dozens of overlapping agent deployments, each with its own credentials, context stores, and permission scopes. When every team spins up its own managed runtime, you accumulate shadow infrastructure — duplicated spend, inconsistent audit trails, and credential sprawl across vendors. Forbes reported TrueFoundry's bet that enterprises will want to own this layer precisely because the runtime consolidates identity, observability, and policy enforcement in one place.
There is also a structural economic argument. Managed runtimes typically bundle compute, sandboxing, and margin into per-task or per-session pricing. Self-hosted runtimes convert that bundled price into raw infrastructure plus engineering time. If your workload is bursty and small, the managed premium is cheap insurance. If your workload is steady-state and high-volume — thousands of agent-hours daily — the spread between bundled pricing and raw compute becomes material, which is exactly the 30%-75% gap TrueForge claims against Claude Managed Agents. Treat vendor benchmarks skeptically, but the direction of the claim is consistent with how infrastructure margins work everywhere else in cloud computing.
Head-to-Head Comparison
| Feature | Managed Agent Runtime (e.g., Bedrock AgentCore, Claude Managed Agents) | Self-Hosted Runtime (e.g., TrueForge, xpander, Ollama self-hosted) |
|---|---|---|
| Upfront effort | Hours to days; SDK integration | Weeks to months; infra, sandboxing, observability buildout |
| Unit economics | Bundled per-task/session pricing with vendor margin | Raw compute + ops; 30%-75% cheaper claimed at high volume (TrueForge vs Claude Managed Agents) |
| Data residency | Vendor regions; contractual controls | Full control; air-gapped and on-prem feasible |
| Scaling | Elastic by default | You provision and autoscale |
| Security surface | Vendor-managed isolation, e.g., AgentCore Identity | Your responsibility; full audit ownership |
| Model flexibility | Often tied to provider catalog | Any model, including local weights via Ollama |
| Observability depth | Provider dashboards | Custom, complete trace ownership |
| Exit cost | High if deeply integrated | Low; you own the loop |
| Best fit | Validation, bursty workloads, small teams | Regulated data, high volume, platform teams |
Practical Steps: How to Decide and Execute
Start by quantifying your agent workload honestly. Estimate concurrent sessions, average tokens per task, tool-call frequency, and expected growth over twelve months. As a rough threshold drawn from current market behavior: under about 10,000 tasks per month, managed pricing differences rarely exceed a few hundred dollars and engineering time dominates; above roughly 100,000 tasks per month, a 40% unit-cost delta compounds into six figures annually, and self-hosting deserves a serious pilot.
Second, classify your data. If agents read customer PII, health records, financial filings, or anything under GDPR, HIPAA, or sector-specific rules, map exactly where prompts, completions, tool outputs, and logs physically reside under each option. Managed providers offer region pinning, but self-hosting removes the question entirely — one reason Harvey built its own cloud agent infrastructure for legal workloads.
Third, run a two-week bake-off. Deploy the same reference agent — say, a document-analysis pipeline with three tool calls per task — on both a managed runtime and a self-hosted candidate like TrueForge or an Ollama-backed stack. Measure p95 latency, task success rate, cost per completed task, and engineering hours consumed. Real numbers from your own workload beat every vendor benchmark, including the flattering ones.
Fourth, design for portability regardless of choice. Keep your prompt templates, tool definitions, evaluation suites, and memory schemas in version-controlled repositories independent of the runtime. Teams that treat the runtime as swappable infrastructure negotiate better and migrate faster than teams that adopt proprietary session formats and vendor-specific identity primitives without abstraction layers.
Common Mistakes That Cost Enterprises Dearly
The most expensive mistake is choosing self-hosting for prestige. Engineering teams see "own your runtime" headlines and spin up infrastructure before they have a validated use case, burning three to six engineer-months on sandbox hardening while the product question remains unanswered. Self-hosting is an optimization for proven workloads, not a prerequisite for experimentation.
The mirror-image mistake is drifting into managed-runtime lock-in by accident. Teams integrate deeply with a provider's proprietary session management, then discover at renewal that switching means rewriting authentication, replaying historical traces, and re-validating compliance — a migration measured in quarters. Contract review matters here: check data-retention terms, egress fees, and whether evaluation logs remain exportable in open formats.
A third mistake is ignoring the identity layer. Agent runtimes mint credentials that act on real systems — databases, email, payment APIs. Whether managed (as with Bedrock AgentCore Identity on ECS) or self-hosted, you need short-lived, scoped, revocable credentials per agent session. Enterprises that reuse long-lived service accounts across agents create blast radii that make both auditors and attackers happy for the wrong reasons.
Finally, teams routinely underestimate observability requirements. An agent that fails silently after four tool calls is far harder to debug than a failed HTTP request. Whatever runtime you choose, insist on full trace capture — every prompt, completion, tool call, and latency figure — retained long enough to reconstruct incidents weeks later.
Cost and Pricing Realities in 2026
Managed runtimes price per task, per session-hour, or per token-plus-compute bundles. Expect effective costs ranging from a few cents for simple retrieval-augmented tasks to several dollars for long-horizon coding or research sessions with heavy tool use. AWS's AgentCore and similar services add standard cloud compute charges beneath the service fee. Self-hosted costs split into fixed infrastructure — GPU instances for local models, CPU fleets for sandboxes, storage for traces — plus the loaded cost of the engineers who keep it running, realistically 0.5 to 3 FTEs depending on scale. The crossover point where self-hosting wins financially typically lands somewhere between 50,000 and 500,000 tasks per month depending on task complexity, which is why the claimed 30%-75% savings figures apply to high-volume deployments rather than hobby projects. Open source licenses matter too: verify whether your chosen harness is genuinely open source or source-available, since the latter can carry usage restrictions that complicate commercial deployment.
When to Act, and How to Hedge
If you are pre-product, act now by choosing a managed runtime and shipping — speed to learning outweighs unit-cost optimization when monthly spend is trivial. If you are at product-market fit with growing agent traffic, act within the next two quarters: instrument your current costs precisely, stand up a self-hosted proof of concept in parallel, and negotiate managed contracts knowing you have a credible exit path. If you are in a regulated industry, begin the self-hosted evaluation immediately, because compliance sign-off cycles alone consume six months or more. In every case, the hedge is the same: own your prompts, tools, evaluations, and memory schemas; rent the execution substrate for as long as renting is cheaper than owning. The enterprises winning with agents in 2026 are not the ones that picked the ideologically pure option — they are the ones that kept the decision reversible until the numbers forced it one way or the other.