Multi-Tenant AI Agent Platform
Zero open ports. Per-tenant isolation. Production AI agents.
Overview
Designed and deployed a production multi-tenant platform hosting OpenClaw, an AI gateway connecting LLMs to messaging and productivity tools, with zero open inbound ports and per-tenant isolation enforced from the network layer up.
The Problem
The platform needed to run OpenClaw for multiple isolated tenants simultaneously, each with its own credentials and tool integrations, completely separated from every other tenant. The naive approach β open SSH ports and config files on a shared EC2 instance β wasn't viable for production: it exposed credentials, created an unacceptable attack surface, and made onboarding and secret rotation manual and error-prone at scale.
The Solution
I built the platform as 7 Pulumi TypeScript components β networking, secrets, IAM, storage, compute, observability, and a dedicated access component for per-tenant IAM β with one isolated stack per tenant. SSH is closed entirely; all access goes through SSM Session Manager port-forwarding, so there are zero open inbound ports. Credentials flow exclusively through Secrets Manager into each tenant's IAM instance profile, EBS and EFS are encrypted at rest, and a CloudWatch alarm acts as a kill switch, auto-stopping any instance that sustains over 90% CPU for 15 minutes. An onboarding script automates tenant provisioning end to end, and a hardening script runs non-destructive security audits against live instances. Nine security controls are documented and tracked β eight enforced by default, the ninth a deliberate, documented exception rather than an oversight.
The Results
The platform shipped across 10 merged PRs in a single foundation-and-security milestone, with zero open inbound ports maintained across every tenant. It's been deployed across multiple internal tenants, including my own production use, spanning more than one AWS region. Secret rotation applies in roughly 10 seconds with no infrastructure redeploy required.
Key Takeaways
SSM port-forwarding eliminates the open-SSH attack surface entirely without sacrificing operational access β zero open ports is achievable in production without workflow pain
Per-tenant Secrets Manager paths with isolated IAM give strong separation, and credential rotation measured in seconds instead of a redeploy changes how often you're willing to rotate
Documenting a deliberate exception is more trustworthy than claiming blanket compliance β security maturity shows in what you chose not to do, and why
Automating onboarding and audits as first-class scripts, not one-off runbooks, is what makes multi-tenant operations sustainable past the first few tenants
Tools & Technologies
- Pulumi TypeScript
- AWS EC2
- Docker
- AWS EFS
- AWS SSM
- Secrets Manager
- CloudWatch
- SNS
- IAM
- Python