Self-Hosted AI Agents vs Managed Hosting: The Real Tradeoffs¶
Every AI agent team hits this decision: do we host it ourselves, or use a managed platform?
The self-hosting instinct is strong. "It's just a Python script on a server." Three weeks later, you're debugging IAM policies and your agent still isn't running.
Here are the real tradeoffs — not the marketing versions.
The self-hosting promise vs reality¶
What you think self-hosting looks like¶
- Spin up an EC2 instance (5 minutes)
- Clone your repo, install requirements (10 minutes)
- Add a cron job (2 minutes)
- Done
What self-hosting actually looks like¶
| Task | Estimated | Reality |
|---|---|---|
| Containerize the agent (Dockerfile, registry) | 2 hours | 1 day |
| IAM roles — least privilege per agent | 4 hours | 2-3 days |
Secrets management — not in .env |
1 hour | 1 day |
| Cron scheduler — reliable, monitored | 1 hour | 4 hours |
| Log aggregation — accessible, searchable | 2 hours | 2 days |
| Monitoring — is the agent running? | 2 hours | 1 day |
| CI/CD — update the agent when code changes | 4 hours | 2 days |
| Total | ~2 days | ~2 weeks |
Two weeks of infrastructure per agent. And that's assuming nothing goes wrong.
The security gap¶
Self-hosting means you own the security boundary. Here's what that means in practice:
Secrets on disk¶
Your agent needs an OpenAI API key. Where does it go?
.envfile committed to git → leaked immediately.envon the server → anyone with server access has it- Environment variable in systemd → visible in
/proc/<pid>/environ - AWS Secrets Manager → another service to manage, $0.40/secret/month
Managed platforms like HollowHost handle this by default: secrets are encrypted at rest, injected at runtime, and never appear in logs, environment dumps, or image layers.
Cross-agent access¶
If you run three agents on the same EC2 instance:
- Agent A can read Agent B's logs (
/var/log/agent-b/) - Agent A can read Agent B's env vars (
/proc/<b-pid>/environ) - One compromised agent compromises all three
Managed platforms enforce per-agent isolation automatically. HollowHost provisions a dedicated IAM execution role for every AI Job — no cross-agent access, no privilege escalation.
The blast radius problem¶
Without per-agent isolation, one over-privileged role means one compromised agent can access your entire AWS account. This isn't theoretical — it's the default when you reuse IAM roles across agents.
Managed hosting: what you actually get¶
A purpose-built AI agent platform handles:
- Containerization — your GitHub repo → container image, no Dockerfile
- IAM provisioning — per-agent least-privilege role, created on deploy
- Secrets injection — encrypted at rest, injected at runtime, never logged
- Cron scheduling — standard cron expressions, toggle on/off
- Log persistence — per-agent log streams, searchable in dashboard
- Run observability — status, duration, token usage per execution
- Always-on support — persistent agents (daemons) with web dashboards
With HollowHost, the deployment is one command:
hollowhost ai-jobs create --repo you/agent --lang python --pm uv --entry-point main.py
hollowhost ai-jobs deploy <id>
From GitHub to production in minutes, with security guarantees that would take weeks to build yourself.
Cost comparison: self-hosted vs managed¶
Let's compare the real cost of running one AI agent that executes 4 times a day, 5 minutes per run:
| Self-hosted (EC2 t3.small) | HollowHost (Free) | |
|---|---|---|
| Compute | $15/month (always-on) | $0 (12K tokens free) |
| Your time (setup) | 2 weeks (~$8,000) | 5 minutes |
| Your time (maintenance) | 4 hours/month | 0 |
| Secrets management | DIY or $0.40/secret | Included |
| Logging | CloudWatch ($2-5/month) | Included |
| Monitoring | DIY or Datadog ($15/month) | Dashboard included |
| Security audit | You | Automatic (IAM, isolation) |
| Month 1 total | ~$8,030 | $0 |
| Month 2+ total | ~$35/month | Free or paid tier |
The infrastructure cost is negligible compared to your time. Two weeks of engineering time at any reasonable rate dwarfs any hosting bill.
When self-hosting makes sense¶
Self-hosting isn't always wrong. It makes sense when:
- You need GPU inference — managed agent platforms typically don't offer GPU instances (use Modal or RunPod for that)
- You have strict compliance requirements — data sovereignty, on-premise, air-gapped environments
- You already have a platform team — if managing containers, IAM, and observability is your team's core competency, self-hosting is just another service
- You're running one simple agent — a single Lambda function with EventBridge doesn't need a platform
For everyone else — teams that want to ship agents, not infrastructure — a managed platform is the faster, safer, and cheaper choice.
The bottom line¶
Self-hosting AI agents is a trap that looks simple from the outside and becomes a maintenance liability the moment you have more than one agent, more than one developer, or more than one environment.
Managed platforms exist because the infrastructure of running autonomous AI agents — isolation, secrets, scheduling, observability — is genuinely hard and genuinely important. Unless you have a dedicated platform team, buy it.
Deploy your AI agent in 5 minutes instead of 2 weeks. Start on HollowHost — free tier, no credit card.