One customer per server: running our fleet
Each customer's Twin runs as a full stack on its own server, shipped as immutable images through one path: one CI run, staging, then production on one commit.
Each customer's Twin runs as a full stack on its own server, shipped as immutable images through one path: one CI run, staging, then production on one commit.
Coding agents optimise for finishing the task, not your scope, so drift builds up. Write scope as a contract, turn criteria into tests and verify continuously.
Test AI like software: real cases, code checks for what must hold, a calibrated LLM judge for the rest, human audits, and a release gate on every change.
A recurring report. A slow review. A prototype that needs to work in the real world.
We run the Company Twin with one customer per server: every piece of the stack that holds or processes a customer's data (the web app, the tenant API and its Postgres database, the agent runtime, the model gateway, the graph engine and the connectors) runs on a dedicated machine that serves nobody else.
Every server deploys the same way, from immutable release images built once off a clean commit, along one governed path: one CI run on the release tag, then staging, then production, all on the same commit. New releases swap in beside the old ones instead of overwriting them, so a bad release is a switch back, not a rebuild. That answers the first three questions a security lead asks about an AI platform (where does it run, what else shares the box, and who can change it?), though it comes with one operational trade-off that still hurts.
Key takeaways
Three reasons, in the order buyers raise them.
Not everything is per customer, and it's better to say so plainly. A central admin host runs sign-in (an OpenID Connect issuer that every customer's app trusts), the public API gateway that the CLI, SDK and MCP clients call, and deployment control. The gateway exchanges a caller's token for a signed subject token and relays the request to that customer's own server, which decides what the caller can read. Workspace data stays on the customer's server; the admin host holds only sign-in accounts and the routing records that map each organisation to its box.
The cost is operational: many servers to keep current instead of one cluster. For the buyer's side of the same question, see four questions on control for finance teams.
A target is one customer's server described as code: a folder of versioned, non-secret configuration setting out which services run there, where its release images come from, which backup check must pass before a migration, and which secrets project its settings render from. Secrets live in a secrets manager. At deploy time they render into root-only files for that release and are never edited in place on the server.
config.env committed, non-secret: services, image registry, backup checkruntime.env names the secrets project its settings render fromsecrets.env never committed, never copied to another targetEvery deployment script is pinned to a target, with no default. A command that doesn't name its customer fails before it reads anything, instead of deploying to whichever box was touched last. We also keep three easily conflated identities strictly separate: the deployment target, the tenant's name in the product and the physical host. None is ever inferred from another. Shipping the right change to the wrong machine is one of the most common incidents in operations, and this is the cheapest defence against it.
Each runtime component (the tenant API, executor, model gateway, app, public gateway, integrations worker and the rest) has one container recipe with two targets: production and development. The production image carries only runtime dependencies and compiled output, and runs as an unprivileged user. Built for arm64 in September, they ranged from 385 MB for the public gateway to 1.23 GB for the executor, down from 0.8 to 1.9 GB for the development-shaped images they replaced.
Four properties keep every release build honest:
git archive, so both the code and the build tooling come from that exact commit. A dirty tree is refused.org.opencontainers.image.revision annotation) and a SHA-256 digest of its inputs: source files, resolved dependencies and recipe. Rebuilding the same commit produces the same digest.The manifest also records each role's hardening (read-only root, dropped capabilities, no new privileges), and activation refuses any image reference that isn't pinned by digest.
Every release takes the same four steps on one commit:
Running CI once was deliberate: repeating the release suite on every push to main doubled load on the same runners and told us nothing new. A later article in this series covers how many coding agents feed this single path without colliding.
Deployment itself has one door. A coding agent or an engineer submits intent, never shell commands, to a private service on the admin host. Each request carries a signed assertion that lives for at most 60 seconds and is bound to the caller, the exact route and a hash of the request body. A separate database policy must grant that caller the exact action, targets and services; a valid signature without one is refused. Every request also carries an idempotency key, so retrying after a timeout returns the existing rollout, finished or not, instead of kicking off a second one.
A single runner then does the work under a five-minute lease renewed every 20 seconds. It prepares one clean snapshot of the admitted commit, hands each target an isolated copy holding only that target's secrets, and rolls up to six targets at once (eight at most). If one fails, the runner starts no new targets, lets the active ones finish their cutover or rollback, and marks the rest as skipped so the record stays unambiguous. Workstations and customer servers aren't deployment principals at all: only the runner can carry out a real deploy, and anything triggered from a laptop fails before it touches a server.
New releases swap in beside the old ones, with a strategy per role that matches how it fails.
| Strategy | Roles | Why |
|---|---|---|
| Two slots behind nginx; the previous slot keeps running | Web app, tenant API, model gateway | A switch back is instant, and model streams outlive a short stop |
| Paired generations, each drained before it moves | Executor with its agent runtime and Python sandbox | An agent turn can run for up to 30 minutes; a single executor would claim nothing new while it drained |
| One instance, stop then start | Background worker, build worker, graph engine | Only one can run at a time |
| Rolling | Integration workers | Connector jobs retry; the first instance runs the scheduler |
| Once per release | Database migration | Runs explicitly before the new roles start; a tenant refuses to serve with pending migrations |
Roles switch in a fixed order under a per-target lock, after a preflight checks the container runtime, disk and a recent backup. A role passes only when its container is healthy, its health response names the expected release and slot, and its image ID matches the manifest. Each phase has a compensating step, so an early failure puts the server straight back on its previous release. Once the executor's previous generation has started to converge, we halt rather than unwind: unwinding a half-drained executor is riskier than finishing forwards. Each server keeps its last three releases, so rolling back reactivates a known set of images, settings and digests together.
Starting a deploy doesn't mean it landed. Fleet status asks every server, in one parallel round trip, what each service is actually serving (reading the release from the running process rather than from symlinks) and compares it with the commit we expected.
| Rollout | Means |
|---|---|
| COMPLETE | Every selected service serves the expected commit, from a clean build |
| PARTIAL | Some services serve it |
| DRIFT | None does |
| DIRTY | A release marker says the build wasn't clean |
| UNKNOWN | A marker, active slot or running release couldn't be read |
| UNREACHABLE | The probe failed, with the reason in the row |
Health is reported separately, as one of four verdicts: healthy, or one of three that each call for a different response. Unhealthy means the serving path is broken: a required unit is down, the health probe fails or run claims are failing. Degraded means the serving path is up while something adjacent isn't, such as a failed backup timer or a stale connector. Unknown means we couldn't reach the server, and it's never shown as healthy.
One more check came out of an incident: a run left queued for more than three minutes while workers are active marks the server unhealthy, whatever its units say.
The graph engine, which computes every figure the Twin's agents quote, runs as a single instance per server and holds the organisation's model in memory. Each release stopped it, and while it reloaded, every graph read returned 503. Our telemetry showed the bursts lining up to the second with release changes. With frequent releases that turned into a visible share of failed answers, because the app gave up after six seconds.
We fixed it in two places. The tenant API now waits out a restarting or loading engine for up to 20 seconds, always inside the read's own time limit. On most servers the engine reopens from its snapshot in 3 to 20 seconds, so a release restart now usually passes unseen. Meanwhile the public gateway, which used to turn every upstream 5xx into a 502 that no client retries, now passes a 503 carrying Retry-After straight through so the CLI, SDK and MCP clients wait just like the app. A blue-green slot for the engine is the structural fix, and we haven't built it yet: it costs a second copy of the model in memory on every server.
Running many small, separate stacks makes every singleton obvious. Each one needs a slot, a drain or a caller that knows how to wait.
Most organisations deploying AI near sensitive data don't need our fleet. They need the same properties at their own scale.
When we deliver a system for a client, we leave this operating model behind with it: the target configuration, the release path and the checks that prove what's serving.
Every customer's Twin gets its own server, its own database and one governed release path. See the single-tenant architecture →