What changes when an agent stops running on a laptop and starts running in the cloud. A desktop agent gets four things for free that a cloud platform has to rebuild as explicit systems: persistence, identity, network trust, and retry. This page is the platform-engineering counterpart to the Agent Harness cluster — the harness is what runs inside one process; this is what has to hold around it when the process is a fresh sandbox booting on shared hardware while the user sleeps.
Source
Distilled from CREAO’s engineering writeup (@intuitiveml, 2026): What Changes When an Agent Moves to the Cloud.
The desktop assumption (and why it breaks)
Most agent frameworks assume a desktop: one user, one machine, one process. The agent runs while the laptop is open, writes to a local filesystem, holds API keys in environment variables, and dies when the terminal closes. State, secrets, and lifecycle all sit inside one trusted boundary.
Cloud agent infrastructure has none of those luxuries:
| Desktop gives free | Cloud must engineer |
|---|---|
| Filesystem persists between runs | Sandbox boots fresh; state must be re-attached |
| Agent runs as the user, with the user’s keys | Agent runs as nobody, on hardware shared with strangers |
| Network is the user’s trusted LAN | Network is the open internet; the agent code may be adversarial |
| User watches and retries on failure | User is asleep; the trigger was a cron job or another agent |
The sandbox boots fresh, on shared hardware, triggered by callers the user never meets (a schedule, an HTTP request, another agent), running code an LLM wrote from a prompt that may have been adversarial. Every free guarantee becomes a system you have to build.
The four load-bearing properties
CREAO’s writeup reduces “reliable, secure cloud agent infra” to four properties held without exception:
- State lives in the sandbox, frozen until the user changes it.
- Code is hot-swappable, independent of state.
- Credentials live host-side, never inside the agent.
- One execution pipeline serves every caller (human click, scheduler, API call).
The two hard-won lessons below are how properties 1–2 and 3 are actually delivered.
Lesson 1 — Separate what changes slowly from what changes fast
On a desktop, the user’s environment and the agent’s runtime are the same artifact, updated on the same cadence, by the same person. In the cloud they are not, and conflating them is the trap.
The frozen snapshot. An agent app accumulates state platform-side: a stock-analyst agent installs matplotlib, downloads market data, writes charting scripts. That environment is the agent’s muscle memory. The platform freezes it into a sandbox snapshot the moment the user is happy, and holds it frozen until the user edits it again. Every run boots from the same bytes. This buys reproducibility — a pip install six months ago resolves to different versions today, but a snapshot resolves to the same bytes forever. Reproducibility is something the platform owes the user.
The coupling problem. The same image that freezes the user’s environment also contains the runner — the platform’s small harness library that manages each run. The user wants their environment to stay still; the platform wants to ship the runner many times a day. One artifact, two opposite requirements.
- Naive fix: on boot, if the runner version is stale, throw the snapshot away and boot from a clean template. Works for attended use (damage hits only the first run after deploy) but breaks unattended runs — a 9am cron job should not lose its environment because the platform deployed at 8:55.
- The OS analogy: the kernel changes; your home directory does not. You don’t wipe the disk to install a security patch.
- The real fix — hot-swap only the runner:
- Stage the new runner in a temp dir inside the sandbox.
- Validate with
node --checkbefore touching anything live. - Atomically swap: unlock the immutable flag, copy the new runner over, re-lock with
chattr +i, then hide thechattrbinary so sandbox code can’t reverse the lock. - Purge V8’s compile cache so the new file actually loads (not stale bytecode).
- On any failure, kill the sandbox and retry fresh — no half-upgraded state ever runs an agent.
The swap takes ~300ms. After a successful run the platform re-snapshots only if the runner changed, baking the new code into the user’s image so the next run skips the swap.
The diagnostic question
For anything you persist in a cloud platform, ask: who controls the cadence of change on this artifact? If the user and the platform both own it, you will pay for the coupling. Split the artifact along the ownership boundary and let each side update on its own clock.
This is the same instinct as Brain Hands Session Split — separate components that change on different clocks so each can be replaced independently — applied to deployment rather than request handling. There it’s model-loop / sandbox / event-log; here it’s frozen-state / hot-swappable-runner.
Lesson 2 — Keep secrets out of the execution boundary
A desktop agent runs as the user with the user’s keys. A cloud agent runs as nobody, on shared hardware, executing LLM-written code from a possibly-adversarial prompt. The security model assumes the code inside the sandbox is already compromised, rather than hoping it isn’t. This is the operational answer to the prompt-injection threat that Context Engineering and tool design can only partly mitigate.
The rule: no long-lived credential ever lives inside the sandbox.
The API bridge. When the agent needs an authenticated call (Slack, GitHub, the user’s own API), it does not hold the token. It sends a local HTTP request to a bridge running outside the sandbox. The bridge attaches the OAuth token host-side and forwards the call. The response returns without the token ever entering the sandbox’s memory or environment. The same bridge carries billing, logs, and metrics out — it is the single interface crossing the sandbox boundary in either direction.
Two layered checks prove the sandbox is allowed to ask:
- IP allowlist — the bridge accepts connections only from the internal network range the sandbox hosts live on. Anything else (a leaked URL, the public internet, a dev laptop) is dropped at the network layer before application code runs.
- Short-lived per-run JWT — at boot the platform signs a token scoped to this run (which user, which app, which session) with an expiry covering only the run window. The sandbox presents it on every bridge call; the bridge verifies signature + expiry, then resolves the user’s stored credentials server-side. A hijacked sandbox inherits a token that dies with the run and authorizes only that session. There is no master credential to steal.
If a prompt injection convinces the agent to dump process.env to a webhook, the attacker gets a per-run JWT that only works from inside the network and expires with the run.
The pattern underneath — one pipeline, many triggers
The fourth property is the punchline: one executeAgent function handles UI clicks, scheduled runs, and API calls identically. Billing, credit-deduction logs, and observability signals are the same regardless of who pulled the trigger. Adding a new trigger surface (a new webhook, a new scheduler) is a routing change, not an architecture change. The agent itself does not know or care who triggered it.
An agent is a function with a natural language interface. Its implementation belongs to the user; its trigger surface, runtime, and security boundary belong to the platform.
This is the cloud counterpart to the desktop trigger model in Five Patterns for Long-Running Agents in Production (ambient processing, fleet orchestration) — the same “agent as callable function” idea, made concrete at the infrastructure layer.
Why this matters
- For builders: if you are moving an agent from a CLI/desktop harness to a hosted product, these are the four systems you must build before launch, not after the first incident.
- For the Agent Harness view: the harness defines the loop, tools, context, I/O, and providers inside a run. Cloud infrastructure defines what survives between runs and what protects the run from its own (possibly compromised) code. They compose: the harness is the engine, this is the chassis and the locked fuel tank.
- The security stance generalizes: “assume the sandbox is compromised” is the only safe default once an LLM is writing and executing code on shared hardware. Host-side credentials + per-run tokens + network allowlisting is a reusable blueprint, not a CREAO-specific trick.
Related
- Agent Harness — what runs inside one process; this page is the platform around it
- Brain Hands Session Split — the same separate-by-cadence instinct, applied to request handling
- Long-Running Agents — why persistent state and unattended execution are hard
- Five Patterns for Long-Running Agents in Production — ambient processing and fleet orchestration as trigger surfaces
- Context Engineering — where prompt-injection risk originates; this page is the runtime containment
- Agent Platform Blueprint: N agents on M computers (checkpointed sandboxes plus local machines) and a shared RBAC-ed cloud filesystem as two of nine platform blocks