Just Ask Notes··11 min read

Where Does Your Code Actually Run? What to Know Before You Choose a Vibe Coding Platform

Your laptop, a vendor's sandbox and production are three different machines. Know which one you are on, what each platform does for you, and what you would have to rebuild if you left.

PW

Ping Wu

Cloud Architect · CSTU Professor · Author of Just Ask

Under the chat box of the Coding Agent App I use, there are three small controls. One says This Computer. One shows a folder name. One is a checkbox labeled worktree. I had been typing above them without a second look, until one day I stopped and asked what they meant.

My first guess was that the first control, the environment, is a place to keep environment variables: the named values, such as an API key, that a program reads when it starts. That turned out to be half right. The half I was missing is the one I think many vibe coders are missing too, and it changes how you choose every tool you build with.

An environment is a machine, not a list of settings

A runtime environment is the machine your code runs on, together with everything on it: the files, the installed tools, the network it can reach and the secrets it can read. That first control was asking a simple question: which machine should do this work? This Computer means my laptop. The other choices are machines somewhere else.

The word is confusing because it is used three ways. Environment variables are the named values a program reads. A runtime environment is the machine. And teams talk about development, staging and production environments, which are separate copies of the same app for building, testing and real users. The three meanings connect in one sentence: every machine keeps its own set of environment variables.

The three machines every builder meets

Your laptop. It has your files, your installed tools and your sign-ins. A coding agent can work with the files and tools its permissions allow. Being on your laptop does not automatically give it every sign-in or key: sandbox restrictions, network rules and approval settings still apply.

The vendor's sandbox. Here, the sandbox is an isolated workspace on the provider's infrastructure. It can start from a prepared image or saved setup, check out your code (often from GitHub), and keep task state according to the service's lifecycle. Sandboxing can also restrict commands on your own computer; the word alone does not tell you where execution happens. It has none of your laptop's sign-ins or keys unless you put them there. The Claude Code documentation, for example, describes a cloud environment as a saved configuration that controls three things: network access, environment variables and setup scripts.

GitHub Copilot makes a similar choice in a different way. In the Copilot app, you can choose This computer or a GitHub-hosted cloud sandbox. Copilot CLI can also work locally or start a cloud session. The screen you use and the machine doing the work are not necessarily the same.

The app's worktree choice answers a different question: where should the files for this task live? A Git worktree is a separate working directory, usually on its own branch, linked to the same repository and its Git history. Local worktrees share your computer's tools and resources. They keep work apart, but a worktree is not a security sandbox. Copilot's optional local sandboxing is a separate setting that restricts what agent-run tools can access.

OpenAI's Codex makes the same distinctions. With local execution, commands run against the checkout on the connected computer, subject to its sandbox and approval settings. The computer running your commands, the service handling the AI conversation and the host serving your finished app are separate parts of the system. Choosing local command execution does not mean the AI model runs locally or that no project context leaves your machine.

In Codex Cloud, each task gets its own workspace. A reusable environment supplies prepared files, dependencies, tools and access settings. Current Codex Cloud distinguishes environment variables that programs can read directly from network secrets whose real values are substituted by a proxy only for allowed HTTPS destinations. Those are development settings, not your production configuration. Check the documentation for the experience you use: Codex Cloud (Legacy) has different setup and secret-handling rules.

The Codex worktree documentation describes another checkout on the same execution host, sharing Git history; a new Codex worktree starts with detached HEAD by default, meaning no branch is selected yet. It does not create another computer. Dependencies and ignored files such as a local environment file may need separate setup. Codex local environments let you save worktree setup scripts and common project actions. A second folder still needs its own server port if both copies run at once, and separate test data if they must not affect each other.

Google's Gemini-powered Antigravity desktop app and CLI (`agy`) draw the same boundary across local and cloud execution. Locally, a project can group one or multiple folders and repositories under shared project permissions, and an OS-level terminal sandbox (macOS Seatbelt `sandbox-exec` or Linux kernel namespaces, without a virtual machine or Docker image) runs shell commands by default with write access to project and temporary directories, blocked access to sensitive files such as `~/.ssh` and `.env`, and restricted network access. Commands that need unapproved network access or host resources outside the sandbox must pass the permission rules (`Deny > Ask > Allow`). When you choose Remote Agents instead (`New Remote Project` or `agy --remote-agent`), the session runs in a Google-managed cloud environment that cannot read your local filesystem unless you attach GitHub repositories, Google Drive files or uploads as remote resources.

Antigravity also treats Git worktrees as workspace isolation rather than machine isolation. Starting a conversation in Local mode edits your active checkouts directly, while New worktree mode provisions a fresh Git worktree for each Git repository in the project so your working copy stays untouched. When a parent agent spawns parallel background subagents, each subagent can inherit the parent's workspace (`inherit`), get its own isolated Git worktree (`branch`), or share underlying repository storage (`share`) on the same execution host.

Production. This is the machine your users reach. It has its own keys, its own network rules, and no idea what is on your laptop.

“Same code, three machines, three sets of secrets.”

Why "it worked for the agent" is not "it works"

Most of the confusing failures I see in a first project come from mixing these machines up. The payment key is on your laptop but was never added to the sandbox, so the agent reports that the payment test failed. The sandbox is not allowed to reach the internet, so installing a package fails there and nowhere else. The app runs perfectly on your laptop and shows an error page when deployed, because nobody set the environment variable in production.

None of these is a bug in your code. Each one is a difference between two machines. So before you ask the agent to fix anything, ask it which machine ran the app. If the failure comes back as a number, my guide to HTTP status codes for vibe coders shows how to read it.

A container narrows the gap. A container packages your app and its runtime dependencies so more of the setup stays consistent. Secrets, external services, network access and host constraints still need to be configured and checked separately. The free Docker Desktop Foundations deck shows how that works without assuming you have used one.

And when you build from your phone?

Many tools now let you keep building from a phone. The same question applies, and the answer is easy to miss: in the remote coding workflows described here, the phone controls work happening elsewhere. Find out which host is actually running the commands.

Remote control. The phone steers a connected computer, which might be your laptop, a desktop or a remote development machine you control. The agent uses that host's files and permitted tools. The execution host must remain available; if your laptop is the host and goes to sleep, work cannot continue there. OpenAI's guide to Codex Remote describes the phone as the control plane: you choose the host, repository and worktree, then steer and review the work from your phone. Google Antigravity Remote Control works the same way from a mobile or desktop browser, connecting to a running desktop app or CLI session on your workstation while keeping execution inside that machine's local folders, worktrees and OS sandbox.

A cloud session. The work runs in a sandbox hosted by the provider, such as Claude Code on the web, a Copilot cloud session, Codex Cloud or Antigravity Remote Agents. Your computer can be off. The sandbox has only what it was given: a copy of your repository or attached resources, its own environment variables and its own network rules. A browser-based editor alone does not establish where its preview, build or deployed app executes.

“If I close my laptop, does the work keep going?”

That is a useful availability check, but it does not tell you who owns the machine. Work can continue in a provider's cloud or on a separate computer you control. Ask the agent to identify the execution host, working directory, checked-out commit and permissions, without printing secret values. That tells you what was actually tested.

Two kinds of platform

Once you can see the three machines, the tools sort themselves by one question: how much of this does the tool own for you?

Hosted app builders, such as Lovable, Replit, Bolt and v0. You describe what you want in a browser. The builder combines code generation with previews and a path to publishing a link you can share. Preview, build and production execution can be in different places, so check each one. Many builders can also set up a database and a sign-in page for you. You bring the idea.

A coding agent in your own repository, such as Claude Code, Codex, GitHub Copilot or Google Antigravity. The agent works on a repository you own, on a local or remote execution host, and leaves changes you can review, commit and turn into a pull request. Where the app runs for real users is your decision, and your job to set up.

Neither is the wrong choice. A hosted builder can put a first version in front of a real user in an afternoon, with nothing to install. A coding agent in your own repository takes longer to set up, and leaves you with something you can read, move and run anywhere.

The line between the two is also moving. Builders are adding ways to export your code, and coding agents are adding cloud sandboxes. Product features change every few months. The questions below do not.

Convenience is the product

Setting up infrastructure is hard: servers, databases, sign-in, keys, deployment. Every vendor in this market is competing to hide that work from you. The more a platform does on your behalf, the more useful it is, and the harder it is to leave. That is not a trick. It is the trade you are being offered, and it is a good trade when you know what you are trading.

What is easy to leave is the sandbox itself. A temporary cloud computer that copies a repository is something every vendor offers. What is hard to leave builds up around it, in three layers.

Configuration: the settings, setup steps and connections that exist only in that vendor's format. Context: the history, memory and instructions the agent has built up about your project. Habit: the steps the platform does for you that you never learned to do.

“The strongest lock-in is a step you never learned to do yourself.”

Connectors belong in this picture too. A connector lets an agent reach your other tools, such as your issue tracker, your email or your design files. Some are built on the Model Context Protocol (MCP), an open standard, so a connector written for one agent can be used by another. Skills and plugins package instructions and tools for an agent. Before you build many of them, ask whether the format is open or belongs to one vendor.

Four questions to ask of any platform

1. Where does my code run? On my laptop, in the vendor's sandbox, or in production? Which one is the agent using right now?

2. Where do my secrets live? Where is each key stored, and who can read it?

3. Can I leave? Can I export the code to a repository on my own account and run it without the platform?

4. What breaks when I do? Which pieces, such as the database, the sign-in and the hosting, were the vendor's and not mine?

You can ask the tool itself. Prompts like these work in an app builder or a Coding Agent App:

"Which machine are you running this on: my computer or a cloud sandbox? What can it reach on the network?"

"List the names of the environment variables this app needs. Do not show me the values."

"If I moved this project to another host tomorrow, what would I have to set up again? Give me a list."

What to keep in your own hands

You do not have to give up the convenience. Use it, and keep the source of truth in things you own.

The repository, on your own account. A container file that says how to run the app, so any machine can run it. A list of the environment variable names the app needs: the names, never the values. Agent instructions in a plain file in the repository. AGENTS.md is an open format for that, read by many coding agents. And a deployment you can point at a different host.

This site is built that way. The code lives in a GitHub repository, it is packaged as a container, and the instructions for the coding agent sit in a plain file beside the code. I use my agent's conveniences every day. I could also change agents without rebuilding the project.

One rule on secrets. Never paste a key into a chat. In a vendor's sandbox, use test keys. Production keys belong only in production.

Which one should you choose?

If you are testing an idea this week, use a hosted builder. Speed matters more than ownership when you do not yet know whether anyone wants the thing. If you are building something meant to run for years, hold customer data or take payments, start in your own repository, or plan the move there early. Many builders do both: a first version in a hosted builder, then an export. Ask question 3 on day one, so the move is a planned step and not an emergency.

A vibe coder accepts whatever machine the tool picked. An AI-native product builder knows which machine the code is on, where the secrets are, and what it would take to move. That knowledge costs an afternoon to learn, and it turns every platform into a choice you made.

This is why students in CSE 642, the course I teach at California Science and Technology University (CSTU), set up their own machine first: a repository, a container tool and a Coding Agent App. After doing it once by hand, they can judge any convenient platform with open eyes.

Common questions

What is a runtime environment?
A runtime environment is the machine your code runs on, together with everything on it: the files, the installed tools, the network it can reach and the secrets it can read. Your laptop, a vendor's cloud sandbox and your production server are three different runtime environments, even when they run the same code.
Is an environment the same as environment variables?
No. Environment variables are named values, such as an API key, that a program reads when it starts. An environment is the whole machine the program runs on, and each machine keeps its own set of environment variables, which is why a key that exists on your laptop can be missing in production.
What is the difference between an app builder like Lovable or Replit and a coding agent?
A hosted app builder usually bundles editing, previews and a path to deployment; where each step runs varies by product. A coding agent can edit your own repository locally or on another host, leaving changes you can review and commit. Compare code export, data export and runtime dependencies rather than assuming either category guarantees portability.
Why does my app work for the coding agent but fail in production?
Usually because the two run on different machines. The agent's machine has a key, a tool or network access that production does not have, or the other way around. Check which machine ran the app and compare its environment variables with production before you change any code.
How do I avoid getting locked in to an AI coding platform?
Keep the source of truth in things you own: the code in a repository on your own account, a container file that says how to run the app, a list of the environment variable names it needs, and agent instructions in a plain file in the repository. Then use the platform's conveniences freely, because you can rebuild them somewhere else.
#Runtime Environment#Vibe Coding#Platform Choice#Vendor Lock-in#AI-Native Product Builder
PW

Written by Ping Wu

Cloud Architect turned AI Educator with 25+ years experience across ByteDance, SAP, and Zuora. Professor at CSTU teaching Creation with Agentic AI, TEDx speaker, and author of the business novel Just Ask.

Just Ask Notes

Turn AI attention into shipped work.

Subscribe to get concise weekly notes on sovereign architecture, prompt-to-build workflows, and agency.