Enterprise
Set Up Cursor Cloud Agents: Environment, Repo, First Run
Set up a Cursor Cloud Agent by connecting its repositories, dependencies, secrets, and network access. New environments use Builds automatically: Cursor prepares the repository and runs install in the background, then runs start and terminals when an agent begins. Existing environments opt in from the Builds tab after a test succeeds.

On this page
What is a cloud agent environment?
A cloud agent environment is the machine the agent works on: cloned repos, installed dependencies, secrets, startup commands and network access. Cursor describes it as similar to the setup on your laptop. An agent that can write code but can't run tests, query services or reach APIs cannot close the loop on its work, so Cursor calls environment setup the most important step for making cloud agents effective.
The clip below follows one run from prompt to pull request.
Cloud Agent opens the PR
0:40 · narratedRead this demo as text
- This prompt asks for a pull request when the work is ready. Not a merge. Send it on a Cloud Agent so it runs in an isolated VM, on its own branch, while you keep moving.
- And boom, the remote build lands. Three files in the file components/search, Changes panel open. Your machine stayed free the whole time. That is the point of shipping the work to the cloud.
- Green checks on the PR tab. Read the diff, then merge it yourself. Cloud Agents hand you proof. They do not deploy.
Practice next: Practice this yourself in the hands-on module.
Simulated Cursor 3.12 (macOS, light) — beta educational reconstruction, not the real product.
What happens without environment setup?
An unconfigured agent still produces work. It reads the repo and hands you a plausible diff that nobody has run. Verifying it falls to whoever opens the pull request, who checks out the branch and runs the suite by hand. That is the time the agent was supposed to save, and spending it twice is, I suspect, most of why people try cloud agents once and never come back.
Configured environments make agent sessions faster because the tools are already installed instead of being set up from scratch every time. New environments use Cloud Agent BuildsPrepared Cloud Agent environments built in the background, with the last successful build kept active when a newer build fails. Press Enter for the full definition. automatically, so Cursor prepares that reusable state in the background.
This exact topic is a hands-on Lesson: Split install, start and terminal commands — about 7 minutes, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
How do I configure the environment?
There are two ways to configure the environment, and both let you define the machine and its commands. With Builds enabled, the install command prepares dependencies in the background while start and terminals wait for the agent run. The table below maps each setup option to when Cursor recommends it.
- Option
- Agent-driven setup (recommended)
- How it works
- Cursor's agent sets up the machine in under 10 minutes; you watch in a shared terminal, then save a snapshot of its VM
- When to use it
- Most repos; fastest path to a reusable environment
- Option
- Manual setup with Dockerfile (advanced)
- How it works
- You write a Dockerfile for system-level dependencies, compiler versions or a different base OS and reference it from
.cursor/environment.json - When to use it
- Advanced cases needing specific system packages
- Option
- Cursor-configured Dockerfiles (private beta)
- How it works
- Cursor inspects your repos and produces a Dockerfile-based config you edit and version
- When to use it
- Enterprise teams who don't want to write a Dockerfile from scratch
| Option | How it works | When to use it |
|---|---|---|
| Agent-driven setup (recommended) | Cursor's agent sets up the machine in under 10 minutes; you watch in a shared terminal, then save a snapshot of its VM | Most repos; fastest path to a reusable environment |
| Manual setup with Dockerfile (advanced) | You write a Dockerfile for system-level dependencies, compiler versions or a different base OS and reference it from .cursor/environment.json | Advanced cases needing specific system packages |
| Cursor-configured Dockerfiles (private beta) | Cursor inspects your repos and produces a Dockerfile-based config you edit and version | Enterprise teams who don't want to write a Dockerfile from scratch |
Cursor-configured Dockerfiles are in private beta for Enterprise; request access via your account representative or hi@cursor.com.
The table recommends row one on speed. What it leaves out is what you own afterwards. Agent-driven setup leaves you a snapshot, a saved VM that is quick to produce and hard to read back six months later, and Cursor's environment-recovery docs list a snapshot expired after inactivity among the cases where a run comes up on the default base image with a warning instead. A Dockerfile is text you can diff, and editing one rebuilds only the changed layers. The third row splits the difference, with Cursor writing the Dockerfile and you keeping the version history.
Team size decides this more reliably than repo complexity does. Two people can rebuild a snapshot from memory when it breaks. Thirty can't, so on a large team I'd write the Dockerfile even where the agent-driven path would have worked, and accept the slower start.
For agent-driven setup, you connect a GitHub, GitLab, Azure DevOps or Bitbucket account, select one or more repositories and provide the environment variables and secrets needed to install dependencies and run the code. After Cursor verifies the code works, you save a snapshot so future agents start faster, and commit the config to .cursor/environment.json so the whole team benefits.
Cursor resolves environment config by repository or repo group, using the first match: .cursor/environment.json in the repo, then a personal saved environment, then a team saved environment. This gives team-level defaults while letting individuals override to test a new config before rollout.
For work that spans more than one repo, select multiple repositories when you create the environment. Cursor clones each into the agent machine and reuses the environment for future runs and automations that use the same repo group.
How do Cloud Agent Builds change environment setup?
Builds move repository cloning and dependency setup out of the agent's startup path. Cursor prepares a bootable environment in the background, records the environment version and exact commit for each repository, and keeps the latest successful Build active for future agents, automations, and code reviews.
- Phase
- Build
- When it runs
- Ahead of agent runs
- What belongs there
- Clone repositories, run
install, generate code, compile artifacts, warm disk caches
- Phase
- Agent start
- When it runs
- When the first prompt starts a run
- What belongs there
- Run
startfor Docker, databases, tunnels, and other fresh services
- Phase
- Shared terminals
- When it runs
- At agent start
- What belongs there
- Launch app processes from
terminalsin sharedtmuxsessions
| Phase | When it runs | What belongs there |
|---|---|---|
| Build | Ahead of agent runs | Clone repositories, run install, generate code, compile artifacts, warm disk caches |
| Agent start | When the first prompt starts a run | Run start for Docker, databases, tunnels, and other fresh services |
| Shared terminals | At agent start | Launch app processes from terminals in shared tmux sessions |
Builds preserve disk state. Running processes, shell exports, and in-memory caches do not survive the snapshot.
A failed Build never replaces the working one. Agents continue from the last successful active Build while you inspect logs, commit SHAs, and the Build used by each run in the dashboard. This is a reliability boundary, not permission to ignore a broken setup: fix it before the active Build drifts too far from the repository state you expect.
- 1For a new environment, confirm its first automatic Build succeeds before relying on it.
- 2For an existing environment, open the Builds tab and choose Run setup agent or Test build to review the migration.
- 3Select Enable Builds when the tested configuration is ready for agent runs.
- 4Open Build history after the first run and confirm the recorded Build, logs, and repository commit.
The Cloud Agent BuildsPrepared Cloud Agent environments built in the background, with the last successful build kept active when a newer build fails. Press Enter for the full definition. guide covers activation, failed-Build debugging, staleness settings, and Build provenance in detail.
What do the update and startup commands do?
With Builds enabled, the commands no longer share one startup path. Cursor runs the dashboard update command, called install in environment.json, while preparing a Build. It runs start and configured terminals only when an agent starts. Each phase has a separate job.
- `update` / `install`: runs during each Build. Put dependency installation, generated code, compilation, and disk-cache warming here. Keep it complete and idempotent because Cursor may run it repeatedly on prepared disk state.
- `start`: runs at the start of each agent session. Put Docker, databases, tunnels, and other services that must be fresh here.
- `terminals`: starts app processes for the agent run in a
tmuxsession shared by you and the agent.
A successful Build snapshots disk state after install completes and becomes active. A later agent starts from that prepared disk, so it does not clone the repository or install the same dependencies again. The environment.json reference covers the exact command fields and idempotency contract.
Put durable preparation in install and live processes in start. A database server started during a Build will be gone after Cursor snapshots the machine, while installed packages and generated files remain. Per-task commands still belong in AGENTS.md so the agent can choose them when the work actually calls for them.
That hand-off only works if the agent finds the instruction, so write the cloud section for someone who has never seen the repo.
Cloud agents read AGENTS.md files. Cursor recommends a dedicated section for cloud-only setup and testing instructions, titled something like "Cursor Cloud specific instructions." If it gets large, reference other files with detailed instructions for specific tasks.
How do I provide secrets and AWS access?
To run and test code like a developer, cloud agents often need environment variables and secrets such as API keys and database credentials. The recommended approach is the Secrets tab in Cursor settings on cursor.com, which exposes the values to the agent as environment variables. The list below covers the cases Cursor documents.
- Environment-scoped secrets: use these when a credential should be available only to agents that use one environment. They apply to every repo in that environment and are not shared with others.
- Sign-in credentials and 2FA: add the same login credentials you use locally as secrets. For TOTP-based 2FA, add the TOTP shared secret too; the agent generates the current 6-digit code with
oathtool --totp -b "$TOTP_SECRET". - Monorepos with multiple `.env.local` files: add values from all of them to the same Secrets tab, use unique variable names when keys overlap (such as
NEXTJS_*andCONVEX_*) and reference them from each app.
Cursor documents a shortcut here and stops short of recommending it. Any .env.local files present when you take a snapshot can be saved into that snapshot, so later agents find the values without a Secrets entry at all. It works. Rotating a key then means taking a new snapshot rather than editing a field. The docs still call the Secrets tab the recommended approach for security and management.
Saving environment configuration or changing its secrets triggers a new Build. Team and environment secrets can be used during Builds; user secrets are added only when an agent starts and do not enter the shared snapshot. If a credential is missing, check whether the new Build succeeded and whether the secret belongs to the Build or run phase. The secrets troubleshooting page covers the full ladder.
For AWS, Cursor can assume a customer-provided IAM role so you grant permissions without sharing long-lived credentials. You create the role and note its ARN, add a secret named CURSOR_AWS_ASSUME_IAM_ROLE_ARN, have a team admin generate an external ID from team settings, and update the role's trust policy to allow Cursor's role assumer. Cursor then sets AWS_CONFIG_FILE, AWS_PROFILE=cursor-cloud-agent and AWS_SDK_LOAD_CONFIG=1 so the AWS CLI and SDKs pick up the profile automatically.
Cursor assumes the role with STS credentials that expire after 1 hour. When the agent wakes, Cursor refreshes credentials that are missing, invalid or within 15 minutes of expiration. You don't export AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY or AWS_SESSION_TOKEN yourself.
Can cloud agents reach private services and Docker?
Yes, with some VM-specific configuration. Cloud agents support Docker workflows and can reach private services through Tailscale or Cloudflare Tunnel. The cards below summarize the pattern Cursor documents for each.
For simple setups, installing Docker is often enough. Because Docker runs inside another container layer, more complex setups should start from the fuse-overlayfs and iptables-legacy configuration, and make sure your cloud agent user can run Docker.
Tailscale's default networking mode does not work in cloud agent VMs; use userspace networking instead. Start tailscaled with --tun=userspace-networking plus the proxy flags, export the proxy variables, then run your usual tailscale up. The VM cannot act as a tailnet exit node.
cloudflared runs in userspace, so it works. Run a connector inside your private network, route an authenticated hostname through the tunnel, add it to the network allowlist if you use restricted egress, and store Access service tokens (CF_ACCESS_CLIENT_ID, CF_ACCESS_CLIENT_SECRET) as Cursor Secrets.
Two of those three cards turn on the same word. Tailscale needs userspace networking because its default mode doesn't work in these VMs, and cloudflared works as shipped because it already runs there. Docker is the awkward one, and the reason the docs give is the container layer it runs inside. If a private service is unreachable, I'd still check the egress allowlist before any of that, since a missing hostname on a restricted-egress environment looks much like a tunnel that never came up.
The Cloudflare pattern in that card is for HTTP services. Private databases get their own route in the docs, a Cloudflare TCP Access app with cloudflared access tcp in your startup command, and your test command pointed at the local listener it opens. It goes in start rather than update, since it has to stay running while the agent works.
Keep tunnel tokens and Access service token secrets in Cursor Secrets, not in your repository, and rotate them after testing if they were created for a proof of concept.
Frequently asked questions
Do new Cloud Agent environments use Builds automatically?
Yes. New environments use Builds by default. For an existing environment, open its Builds tab and either run the setup agent or test a Build, review any proposed command changes, then select Enable Builds. A failed Build does not replace the last successful active Build.
What happens if a saved environment snapshot can't be used?
Agents no longer hard fail. If a snapshot expired after inactivity, is invalid or failed, or you lack access, Cursor falls back to the default base image, keeps the rest of the configuration and warns you. The update command still runs, so dependency setup can repair the environment. The agent view shows "Environment ready (with warnings)." Cursor does not auto-switch to an older version; roll back from Version history in the dashboard.
Where do I keep environment configuration in code?
Commit a .cursor/environment.json to your repository. Cloud agents use the configuration at the commit they start from, so to test a new config you can commit and push to a new branch and start an agent from there. The config can reference a snapshot ID or a .cursor/Dockerfile; in build, the dockerfile and context paths are relative to .cursor, while the install command runs from your project root.
Can I increase the memory and CPU for a cloud agent?
Each cloud agent runs on a default VM profile with limited memory and CPU. On an Enterprise plan, if your repo needs more resources you can contact support to increase limits for your workspace. Cursor notes that self-serve custom resource configuration is coming soon.
Sources & last verified
- Cursor - Cloud Agent Setup
- Cursor - Cloud Agent Builds
- Cursor Changelog - Cloud Agents Start 3x Faster with Builds
- Cursor - Cloud Agents Settings (dashboard)
- Cursor - Agents Window
- Cursor - AGENTS.md
Cursor ships frequently. Facts verified against primary sources on August 14, 2026.