Kapten

Whitepaper · WP-01

The deploy gap

Why software written with AI stalls before production, and what closes the gap.

Code generation got fast. Operating software did not. A look at everything production adds to an application that works on localhost, and at a way to close the gap without hiring a platform team first.

Read online
Pages in print
≈12
Read time
15 min
Chapters
7
Sections
15

Executive summary

The argument in 5 lines.

If you read nothing else, read these. Each one is developed in a chapter below.

  1. 01

    Writing the application is no longer the slow part. Getting it into production, and keeping it there, is.

  2. 02

    Production adds eight concerns that localhost never asks about, from reproducible builds to a named owner for the bill.

  3. 03

    Platforms-as-a-service hide those concerns until you outgrow them; do-it-yourself infrastructure asks for an SRE you do not have yet.

  4. 04

    The gap closes when the agent you build with can also deploy, with permissions you chose, onto infrastructure you own.

  5. 05

    Kapten gives that agent a deployment platform on your own Kubernetes clusters, through the kapten skill and the CLI's MCP server.

Kapten · Whitepaper WP-01 · 13 October 2026

1. The new bottleneck

For most of the history of software, writing the code was the expensive part. A feature took days. A rewrite took a quarter. Everything around the code (the servers, the pipeline, the database backups) was proportionally cheap, because it moved at the same pace as the thing it was supporting.

That proportion has changed. A single developer with a capable coding agent can produce a working application in an afternoon: a web frontend, an API, a background worker, a database schema and a test suite. The application runs. It answers requests on localhost:3000. It might even be good.

And then it stops. Not because the code is wrong, but because the next step is a different kind of work. The question changes from does it work? to where does it run, who can reach it, what happens when it crashes at two in the morning, and who pays for it? Those questions do not have answers in the repository, and the agent that wrote the repository usually cannot answer them either, because it has no access to anything outside it.

We call the distance between those two states the deploy gap. It is not new. What is new is how wide it has become relative to everything else. When writing the application took three months, spending two weeks on deployment was a rounding error. When writing it takes an afternoon, two weeks of infrastructure work is the entire project.

3 monthsWriting the app, beforeTwo weeks of deployment was a rounding error.
1 afternoonWriting the app, nowWith a capable coding agent.
2 weeksInfrastructure, stillNow the entire project.
8Concerns production addsNone of them visible on localhost.
Figure 1. The gap in proportion. Writing the application shrank from months to an afternoon; the infrastructure work around it did not shrink at all.Illustrative · orders of magnitude from this paper

The same orders of magnitude, put on one scale, show what changed. Nothing about the infrastructure work got bigger. Everything around it got smaller.

Share of the project spent on each kind of work
Share of the project spent on each kind of work
RowWriting the application (days)Infrastructure and deployment (days)Total
Before coding agents65 (87%)10 (13%)75 days
With a coding agent0.5 (5%)10 (95%)10.5 days
Figure 2. Infrastructure went from about an eighth of the project to nearly all of it, without growing by a single day. Working days from the orders of magnitude above; no measurement involved.Model · 3 months ≈ 65 working days, 2 weeks = 10, an afternoon = ½

What the gap looks like from the inside

The symptoms are familiar to anyone who has built something with an agent recently:

  • A repository full of working code and no clear way to run it anywhere but the laptop that produced it.
  • A docker-compose.yml that was perfect for development and is now being asked to be production.
  • An .env file with real credentials in it, and a vague intention to “move those somewhere safe later”.
  • A database that has never been backed up because it has never been anywhere that could lose it.
  • A free tier on a hosting platform that is about to stop being free, or about to stop being enough.

None of these is a bug. Each is a decision that has not been made yet, because nothing so far has forced it.

2. What production adds

It is worth being precise about what changes between localhost and production, because “deployment” is usually spoken of as one step when it is really eight distinct concerns. Each of them is invisible on a laptop, and each of them eventually becomes the reason something breaks.

Build reproducibility

On a laptop, the application runs with whatever is installed: a particular Node version, a system library, a globally installed CLI. Production needs the same application built the same way every time, from the source alone. In practice that means a container image per service, built from a pinned base, with nothing smuggled in from the machine that happened to build it.

Configuration and secrets

Locally, configuration lives in one file and secrets live next to it. Production needs configuration per environment, secrets that are never committed, never baked into an image and never printed in a log, and a way to rotate them without redeploying everything by hand.

Data durability

A local database is disposable. A production database is the one thing that cannot be recreated from the repository. It needs backups, a tested restore, a migration process that does not lock the table your users are writing to, and a decision about where it physically lives.

Network exposure

On a laptop, everything can reach everything. In production, almost nothing should. The public endpoint needs TLS and a domain; the database should not be reachable from the internet; internal services should talk only to the services that need them.

Health

A process that is running is not the same as a process that is working. Production needs health checks that reflect whether a service can actually do its job, so that the platform can stop sending it traffic, restart it, or refuse to roll it out in the first place.

Rollback

On a laptop, a bad change is fixed by editing the file. In production, a bad change is serving errors to people while you edit the file. A rollback needs to be a single, fast, boring step, ideally one that re-points traffic to an image that already exists rather than rebuilding an old commit and hoping.

Cost

Localhost is free. Production has a bill, and the bill grows in ways that are hard to see from the code: idle environments, oversized instances, storage nobody remembers creating, traffic between zones. Someone needs to know what the application costs and to notice when that changes.

Ownership

Finally, production needs a person. Someone who is allowed to approve a release, who is told when something breaks, and who decides what happens to the data. On a laptop, that is obviously you. In production it should still be obvious, and it often is not.

What localhost hides

Concern What breaks when it is ignored How Kapten handles it
Build reproducibility “It works on my machine” becomes a production incident Images built from the repository with Railpack, or your own image
Configuration and secrets Credentials leak through images, logs or commits Variables and secrets per project, environment or component; secrets never shown again
Data durability A migration or a disk failure loses data with no restore path Databases in the cluster or managed by your provider, with backups as an option
Network exposure Databases and admin endpoints reachable from the internet Databases private by default; one namespace per environment
Health Broken releases receive traffic until a user complains Readiness and liveness checks on every application
Rollback Recovery means rebuilding an old commit under pressure Deploy the previous image tag again; every run is recorded
Cost The bill grows silently through idle and oversized resources Instance limits per application; compute on your own bill
Ownership Nobody is sure who may approve, who is paged, who decides Roles scoped to projects and environments; an activity log of every change

None of this is exotic. Every one of these concerns has a well-understood answer. The difficulty is that there are eight of them, they interact, and each one is easy to get almost right.

3. Why the usual answers fall short

There are two standard ways to cross the gap today, and both work. They simply ask for a trade-off that fits some teams well and others badly.

The platform-as-a-service answer

A traditional PaaS hides the eight concerns behind a single command. You push code; it builds, runs, gets a domain and a certificate. For a first deployment this is genuinely excellent, and for many applications it is all they will ever need.

The trade-off arrives later, and usually all at once:

  • The infrastructure is theirs, not yours. Your data lives in their account, in their chosen regions. When a customer or a regulator asks where it is, the answer is a vendor’s page rather than your own architecture.
  • The bill is a markup on someone else’s cloud. Your existing credits, commitments and discounts with a cloud provider do not apply. As usage grows, the gap between what you pay and what the underlying resources cost grows with it.
  • The abstraction has edges. A worker that needs a specific instance type, a private connection to a customer’s network, a database extension the platform does not support: each of these is a reason to leave, and leaving means rebuilding everything the platform was doing for you.
A constant markup on a growing bill
A constant markup on a growing bill
PointUnderlying cloud resourcesPlatform markupTotal
M110040140
M212048168
M314558203
M417068238
M520080280
M624096336
M7285114399
M8330132462
M9380152532
M10440176616
M11500200700
M12570228798
Figure 3. The underlying resources grow with usage; a markup charged as a share of them grows in absolute terms with it. The rate is invented to show the shape. Your own rate is the gap between your platform invoice and the same resources at your cloud's list price.Model · 40% markup is a placeholder, not any provider's price

The PaaS answer does not close the deploy gap so much as postpone it. That is often the right call. It is worth knowing that it is the call being made.

The do-it-yourself answer

The other route is to build the platform yourself: infrastructure-as-code for the cloud account, a Kubernetes cluster or a set of managed services, a CI pipeline, a secrets manager, monitoring, alerting, backups. Everything lives in your account, on your bill, under your control.

This is the right destination for many teams. The trouble is the journey:

  • It is a second project. The time spent writing Terraform modules and pipeline configuration is time not spent on the product. For a small team, that can be most of the time.
  • It is specialist work. Getting the eight concerns right requires judgement that comes from operating systems in production. That is what an SRE or platform engineer is for, and most early teams do not have one.
  • It keeps costing. Infrastructure that you build, you also maintain: version upgrades, certificate renewals, security patches, the slow drift between what the code says and what is actually running.

And here is the irony of the moment: a coding agent can write the Terraform. It can write the pipeline, the Dockerfile and the Kubernetes manifests. What it cannot do, sitting in a repository with no access to anything else, is know whether any of it is correct for your account, apply it safely, watch what happens, and roll it back when it goes wrong. It produces infrastructure code with no one to operate it.

What you getPlatform-as-a-serviceDo it yourselfAgent on your account
First deploy in one stepKapten needs a connected cluster firstYesNoPartial
Data in your own accountNoYesYes
Your cloud credits and discounts applyNoYesYes
No platform specialist requiredSomeone still runs the clusterYesNoPartial
Handles unusual infrastructureInstance types, private links, extensionsPartialYesYes
Clean exit to your own teamNoYesYes
Figure 4. The two usual answers and the agent-operated one, scored against the trade-offs in this chapter. 'Partial' means it depends on how far you take it.

4. A different shape: operations from the agent you build with

If the bottleneck is no longer writing code but operating it, then the natural place to close the gap is the same place the code came from. The developer is already working with an agent. The agent already understands the application, because it helped write it. What it lacks is a safe, structured connection to the environment the application will run in.

That connection is what the Model Context Protocol (MCP) provides. MCP is an open protocol that lets an assistant call tools exposed by a server, with typed inputs and outputs. Kapten’s CLI runs an MCP server, kapten mcp serve, that gives a compatible client (Claude Code, Codex, Cursor and others) a vocabulary for production: list the environments, create a database, set a secret, deploy an application, read the logs of its last run. A second server searches the Kapten docs, so the agent works from documented options instead of guessed ones.

With that connection in place, the conversation that wrote the application can continue past localhost:

“Deploy this to our staging environment. Postgres for the data, the worker as its own application, the API behind our domain.”

$ deploy this to staging: web, api and worker, with Postgres
3 services found: web, api, worker. Postgres dependency.
worker expects a Redis queue that is not declared. Intended?
$ yes, add a Redis cache
api reads a secret from a committed file. Rotate it, then set it as a secret in staging.
createPostgresqlDatabase · createRedisDatabase · createApplication ×3 · allow?
3 runs succeeded in staging. Credentials injected as secrets.
Figure 5. The conversation that wrote the application continues past localhost. Each change is a tool call your client shows before it runs.Illustrative session

What happens next matters more than the request itself.

From request to components

A general-purpose agent asked to “deploy this” will try to do everything at once, and will be as confident about the network policy as about the CSS. The work goes better with a structure, each concern handled on its own:

  • Read the repository and map the services, ports and dependencies.
  • Make each service buildable: Kapten builds it from GitHub with Railpack, or deploys an image you already build.
  • Create the environment’s databases; Kapten adds their credentials as secrets.
  • Set the remaining configuration as variables and secrets, never in the code.
  • Give each application readiness and liveness checks, so a broken instance gets no traffic.
  • Deploy in order with a pipeline: migrations, then the backend, then the frontend.
  • Read the runs afterwards, and start from what changed when something breaks.
Map, Build, Data, Config, Health feed into Kapten, which produces A recorded run.
Mapservices and dependencies
BuildRailpack or your image
Datadatabases and their secrets
Configvariables and secrets
Healthreadiness and liveness
KaptenOne environment, on your clustercomponentspipelineruns
A recorded runstatus, timeline, logs
Figure 6. Each concern is handled on its own, and each lands in Kapten as a component, a setting or a run.

You stay in the loop

The most important property of this model is that the agent acts with permissions you chose. It runs with the roles of the login or OAuth application you gave it, your client shows each change before it runs, and production can stay behind a pipeline that a person runs. Every change is recorded in the activity log, and every deployment is a run with its timeline and logs. It is the same discipline an experienced SRE would bring, without waiting until you can hire one.

5. Your infrastructure, not ours

Closing the deploy gap with agents would be a poor trade if it reopened the ownership problem that a PaaS creates. With Kapten, your applications, jobs and databases run on Kubernetes clusters in your cloud account.

  • Your account, your region. You choose where your clusters run, and the answer to “where is our data?” is your own architecture.
  • Your bill. Cloud usage appears on your provider’s invoice, where your existing credits, commitments and discounts apply. Kapten bills separately, per environment minute.
  • Standard building blocks. Kubernetes, namespaces, in-cluster or managed databases. Nothing your applications need to keep serving depends on Kapten.
  • A clean exit. If you stop using Kapten, you revoke the access you gave it on each cluster. The cluster keeps serving traffic, because it was always your cluster. Your team, or the SRE you eventually hire, takes over from a known starting point.

That last point is worth dwelling on. The model is meant to carry you to the point where you would hire a platform engineer, and then to hand that person a foundation built from conventional parts rather than a black box they have to reverse-engineer.

Your coding agent runs the kapten MCP server locally, which calls the Kapten API with your login. Kapten's Engine drives an agent on your Kubernetes cluster, in your cloud account, where your services, Postgres and Redis run.Your toolsKaptenYour cloud accountCoding agentClaude Code, Cursor…kapten mcp serveyour loginEnginedesired state, runsKubernetesweb, api, workerPostgresbackups onRedisstdioapicluster agent
  • Coding agent connects to kapten mcp serve (stdio).
  • kapten mcp serve connects to Engine (api).
  • Engine connects to Kubernetes (cluster agent).
  • Engine connects to Postgres.
  • Engine connects to Redis.
Figure 7. Kapten deploys through an agent on your cluster. Everything runs in your account; revoke its access and the cluster keeps serving traffic.

6. What changes for the builder

Concretely, here is what the path from repository to production looks like with Kapten in the loop. This is an illustrative sequence, not a benchmark.

  1. Connect
    Your cluster, by kubeconfig.
    Gate: Agent installed
  2. Ask
    Describe what should run.
    Gate: Questions
  3. Staging
    Components, config, deploy.
    Gate: Readiness
  4. Production
    A pipeline a person runs.
    Gate: Readiness
  5. Watch
    Runs, logs, what changed.
Figure 8. From repository to production with Kapten in the loop. Production waits for a person, and every deployment leaves a run behind.
  1. You connect a cluster. Once, with a kubeconfig for a service account you create. Kapten installs its agent.
  2. You ask. In the client you already use, you describe what you want running.
  3. The agent maps. It reads the repository, finds three services and a Postgres dependency, and notes that the worker expects a Redis queue that is not declared anywhere. It asks you whether that is intended rather than guessing.
  4. The agent builds staging. It creates the databases, sets the configuration as variables and secrets, flags the secret committed in the repository for you to rotate, and deploys each application behind its readiness check. Your client shows each call first.
  5. You ship production. Through a pipeline: migrations, then the backend, then the frontend, each stage able to stop the next.
  6. You keep watching, together. When the next release raises the error rate, the agent reads the runs and their logs, points to the deployment that changed, and proposes deploying the previous tag. You decide.

The eight concerns from chapter two have all been addressed, and none of them required you to become an infrastructure specialist first. They did require you to make decisions, which is exactly the part that should stay with you.

What you still need to bring

An agent can infer a great deal from a repository, but some facts only you have. Coming to the first conversation with them makes the first deployment far better:

  • The cluster the application should run on, in which account and region, and who owns it.
  • The domain it should answer on, and who controls its DNS.
  • The data: whether there is existing data to migrate, and what its owner expects for backups and retention.
  • The third parties: payment providers, email services, model APIs, and which credentials belong to which environment.
  • The people: who runs production releases, and who should hear about it when something breaks.

None of these require infrastructure expertise. They require knowing your product, which you already do.

7. Limits worth stating

An honest account of this model includes what it does not do.

  • It does not remove responsibility. You still own the application’s behaviour, the data decisions and the approval of every change to production. Kapten makes those decisions easier to make well; it does not make them for you.
  • It does not replace judgement about your product. Whether a feature should ship on a Friday, whether a customer’s data may leave a region, whether an outage warrants a status page: those are business decisions.
  • It needs a cluster. Kapten deploys onto Kubernetes clusters you own and connect; it does not create them. Running the cluster itself stays with you or your provider’s managed service. The docs describe exactly what is available.
  • Agents can be wrong. That is why the model is built around scoped roles, confirmed changes, gated pipelines and a record of every run rather than around trust. The guardrails are not an afterthought; they are the design.

Where to start

If you have a repository that works and nowhere to put it, the deploy gap is probably the most expensive thing in your project right now. A few ways to begin:

Build with Kapten

Start with one service.
Build from there.

Tell us what you want to deploy. We review each request and follow up about fit and onboarding on your preferred cloud.

Free during early access. No card required. Cloud usage billed separately.