Back to blog posts

12 min

How Cursor background agents work (and where they fall short)

Learn how Cursor background agents, now renamed cloud agents, run tasks in remote VMs.

Nicolas LecomteNico is a founder of Blaxel, who usually writes about AI, agentics, and the future of AI runtimes.

You want to hand off a coding task and keep working while it runs. Cursor's answer started as background agents. Cursor now calls the feature cloud agents. A cloud agent works on a remote copy of your repository. It installs dependencies and runs tests, then returns a branch or pull request (PR). Meanwhile, you keep coding locally.

Cloud agents suit well-scoped work with clear tests. They struggle with fragile environments and long unattended runs.

Key takeaways

  • Cloud agents run in isolated Ubuntu VMs, clone your repository, and push a branch or pull request.
  • Access starts at the Premium plan ($30 a month). Runs draw on the same usage as agent work in the editor.
  • Internet access is on by default. A prompt-injected agent can try to send code out unless you restrict egress.
  • Reported weak spots include environment drift, long verification loops, rising token costs, and more PRs to review.

What are Cursor cloud agents?

Cursor cloud agents are asynchronous coding agents, so a task keeps running after you hand it off. The rename came in Cursor's 2.0 changelog entry on October 29, 2025: "Background Agents have been renamed to Cloud Agents."

Cloud agents now create more than 60% of the PRs Cursor merges internally, per its self-hosted machines post. The figure reflects Cursor's own engineering team and may not carry over to other codebases.

Cloud agents vs agent mode in Cursor

Agent mode runs the agent loop inside your editor and executes terminal commands on your machine. By default, sensitive actions wait for your approval, per Cursor's agent security docs. Cloud agents move the agent loop to a remote VM and auto-run terminal commands.

Agent modeCloud agents
Where it runsYour machineIsolated cloud VM, or a worker you manage
Needs approvalYes, you approve sensitive stepsNo, commands auto-run
OutputEdits in your working treeBranch and pull request
Best forExploratory work you steerScoped tasks with clear tests

If you expect to interrupt a task every few minutes, keep it in agent mode.

Cursor cloud agents vs Codex Cloud and Claude Code

Cursor, Codex Cloud, and Claude Code each default to VMs their vendors manage. The entries reflect each vendor's docs as of November 24, 2026.

Execution hostAgent network settingPrivate network or own infraPlans with cloud runs
Cursor cloud agentsIsolated Ubuntu VMInternet on by defaultSelf-Hosted MachinesPremium and above, Teams, Enterprise
Codex cloudVM per task, 2 or 4 virtual CPUs (vCPUs) by planPer-environment toggles for public internet, package manager domains and additional allowed domainsTailscale connectionEligible Plus and above, not Free or Go
Claude CodeAnthropic-managed VMLimited allowlist by defaultSelf-hosted environments, public betaPro, Max, Ultra, Team, eligible Enterprise seats

The coding-agent sandbox comparison goes deeper on how each sandbox isolates code. If repository secrets are your main concern, compare network defaults before plans or price.

How Cursor cloud agents work

Each run pairs a remote machine and an environment definition with a handoff back to your Git host.

The remote machine and repo clone

Each cloud agent runs in an isolated Ubuntu VM with a full development environment, per the Cloud Agents docs.

The default VM profile has limited memory and CPU. Cursor publishes no exact figures, so run your largest builds in a pilot first. The VMs run in an Amazon Web Services (AWS) account separate from Cursor's other production services.

The agent clones your repository from GitHub, GitLab, Azure DevOps Services, or Bitbucket Cloud. It works on a separate branch.

Cursor requires read-write privileges on the repository and any dependent repos or submodules. Access goes through the Cursor GitHub or GitLab App. A cloud agent can only reach repositories the triggering user could already reach.

Inside the VM, the agent builds, tests, and runs the changed software. The agent can also control a desktop and browser, and call Model Context Protocol servers over HTTP or stdio.

Self-hosted workers instead of Cursor VMs

Teams can also run cloud agents on their own workers with Self-Hosted Machines. Cursor keeps the agent loop, inference, and planning, while your worker performs file edits and terminal commands.

The worker connects over outbound HTTPS, so you don't need to open any inbound ports. My Machines connects a personal development machine with your own credentials. Team Pools share workers across a team and require an Enterprise plan.

Environment configuration and hooks

Cursor offers agent-led setup from the Cloud Agents dashboard, per the environment setup docs. Alternatively, point .cursor/environment.json at a Dockerfile. The file accepts build, install, start, terminals, snapshot, and repositoryDependencies.

Cursor runs install during every Build, so the command must be idempotent (safe to run repeatedly). Builds preserve only disk state, per the Builds docs. As a result, databases, Docker, and dev servers must start through start or terminals.

Configuration resolves in a fixed order:

  1. A personal saved environment
  2. A team saved environment
  3. The repository's .cursor/environment.json, for single-repo runs only

Builds read the configuration from the environment's default branch.

Cloud agents run command-based project hooks (scripts that fire at set points in a run) from .cursor/hooks.json. Enterprise plans also support team- and enterprise-managed hooks for cloud agents, per the hooks reference. User-level hooks in ~/.cursor/hooks.json never run because the VM can't see your home directory.

Commit .cursor/environment.json and .cursor/hooks.json to the default branch. Then confirm no saved dashboard environment overrides the environment file.

Launch points and the branch or PR handoff

You can start a cloud agent from these places:

  • Cursor Desktop, by selecting Cloud in the dropdown under the agent input
  • The web at cursor.com/agents, and an Android progressive web app
  • The Cursor iOS app
  • Slack, by mentioning @cursor
  • A GitHub PR or issue comment, or a Bitbucket PR comment, mentioning @cursor
  • Linear, by mentioning @cursor
  • The Cloud Agents API

Automations also start cloud agents on a schedule or in response to events.

Cursor marks the Bitbucket Cloud and Azure DevOps integrations as public beta. The Cloud Agents API v1 is also in public beta.

The agent pushes a branch and can open a PR automatically when it finishes. Cursor attaches videos, screenshots, and logs so you can review the work without checking out the branch. You can also take over the agent's remote desktop.

To send a follow-up in Slack, mention @cursor again in the same thread, per the Slack integration docs. For Linear, comment on the issue.

You can also review and merge agent PRs from an iPhone or iPad in the Cursor iOS app.

Cursor's October 19, 2026 release notes made PRs open ready for review unless you ask for a draft. A Cursor staff forum reply says agents treat a draft request as a prompt instruction. Specify the PR state you want in every prompt.

How to set up and launch a Cursor cloud agent

Run these steps in order. Some need admin rights.

1. Confirm the plan. Make sure every user has a plan that includes cloud agents. Legacy paid plans also qualify.

2. Connect source control. An admin installs the Cursor app on your Git organization and grants access only to chosen repositories. Each user then connects their own Git account.

3. Fix privacy settings. Privacy Mode (Legacy) blocks cloud agents. Switch to standard Privacy Mode under Dashboard, then Cloud Agents, as the secrets and network docs direct.

4. Set a spend limit. Cursor asks for a spend limit the first time you start a cloud agent.

5. Configure the environment. Use agent-led setup, or reference a Dockerfile as in Cursor's documented example:

JSON
{ "build": { "dockerfile": "Dockerfile", "context": ".." }, "install": "pnpm install && ./custom_script.sh" }

6. Run a task. Select Cloud under the agent input, then give a scoped prompt. Here is one: "Fix the failing date-parsing test in utils/, add a regression test, open a draft PR."

7. Review and merge. Read the diff, watch the attached video, wait for continuous integration (CI), then merge the PR yourself.

Models, pricing, and usage limits

Cloud agents use your plan's usage like other agent work, at the selected model's rate. Cursor listed these plans on November 24, 2026.

PlanMonthly priceCloud agents
Free$0No
Plus$8No
Premium$30Yes
Super$100Yes
Ultra$200Yes
Teams$30, $100 or $200 per seatYes
EnterpriseCustomYes

Cursor's own models, such as Composer 2.5 and Grok 4.7, draw from a weekly usage pool. The pool is shared across the editor, the CLI, and cloud agents. Third-party models such as Claude, GPT, and Gemini sit outside the pool.

On Premium and above, you pay the API list price from prepaid credit. Teams and Enterprise also pay a Cursor Token Rate of $0.25 per million tokens on eligible third-party requests.

Cloud agents offer a hand-picked subset of Cursor's models.

Cursor lets you run as many cloud agents in parallel as you want. The API allows one active run per agent and 50 open agent streams per caller (API docs).

Security model and guardrails

Cloud agents are the only Cursor feature that requires code storage, per the privacy and data governance page. Cursor keeps encrypted repository copies while the agent runs.

Cursor holds VM snapshots for 30 days after last activity, per its retention policies. Conversation history stays indefinitely by default. Select Enterprise teams can cap it at 90 days through early access.

The security overview documents four controls:

  • Privacy Mode: Cursor never trains on code or prompts from cloud agent runs. Under Cursor's agreements, most model providers neither store nor train on requests and responses.
  • Secrets: Cursor encrypts secrets at rest with a key management service and injects them as environment variables. Secrets you mark as Runtime Secrets get extra handling: Cursor strips them from transcripts, tool output, and commits. They never reach the model but remain visible in the terminal, as the secret protection docs explain.
  • Network: Internet access is on by default. Users, environment owners, and team admins choose Allow all, Default plus allowlist, or Allowlist only. The last two modes apply an egress allowlist. Enterprise admins can lock the setting org-wide. Start in Allowlist only mode, and add domains one at a time.
  • Human gate: Agents open PRs, and "nothing merges until a person reviews the change."

Auto-run commands raise the stakes of prompt injection. An attacker can plant instructions in content the agent reads, as Cursor's docs warn. The agent may then try to send code to an allowed external host.

Each agent's VM boundary keeps it separate from other tenants, but it can't stop outbound requests. An egress allowlist limits those requests to hosts you approve.

Prompt injection has already produced a Common Vulnerabilities and Exposures (CVE) entry for Cursor's editor agent. The National Vulnerability Database entry for CVE-2025-54135 describes indirect prompt injection writing settings files to trigger remote code execution.

Cursor fixed the flaw in version 1.3.9. For monitoring agents at runtime, see this guide to runtime threat detection.

Where Cursor cloud agents fall short

Cursor's docs, staff replies, user reports, and one academic study document these problems. Treat the forum threads as anecdotes rather than failure rates.

  • Environment drift: Default-branch runs start from the commit recorded in the active Build. Builds count as stale after 24 hours by default. With Update stale builds turned off, agents still start from that older commit.
  • Long runs: In one forum thread, a simple frontend fix ran for 41 minutes. Cursor staff traced most of that time to repeated browser verification loops.
  • Merge rate: An arXiv study found 65.22% of Cursor-authored PRs in popular GitHub projects merged. The overall rate was 71.48%, and the data doesn't isolate cloud agents.
  • Review volume: One forum user said the "Create PRs" setting offers only Never or Always. With Always, every turn that changes code tries to open or update a PR, so reviewers see more PRs.
  • Cost creep: Long runs use more tokens, and third-party models draw down prepaid credit as they go.

Cursor itself advises skipping cloud agents when your security policy prohibits code storage. Also skip them when a task has no tests to check against.

How Baseten Sandboxes help teams to build coding agents

Teams already standardized on Cursor can start with its cloud agents. Building your own agent makes sense when you need control over the runtime, network rules, and state between turns. Each task also needs a clean machine that starts fast and isolates untrusted code.

Baseten Sandboxes can run that agent's code, with a dedicated Firecracker microVM behind every sandbox:

  • Each agent task gets a fresh sandbox, which Baseten Sandboxes create in under a second.
  • Between agent turns, a sandbox with no network traffic for about 15 seconds drops into standby.
  • When the agent picks the task back up, resuming from standby takes under 25ms.
  • Regulated codebases get SOC 2 Type II, HIPAA, and ISO 27001 compliance.

Baseten Sandboxes offer domain filtering and proxy secrets injection for egress control. Both are in public preview and not yet recommended for production.

FAQs about Cursor background agents

Are Cursor background agents the same as cloud agents?

Yes. Cursor renamed Background Agents to Cloud Agents on October 29, 2025. As of November 24, 2026, the docs still use the Cloud Agents name.

How much do Cursor cloud agents cost?

As of November 24, 2026, cloud agents need Premium ($30 a month) or higher, Teams, or Enterprise. Cursor's models count against the weekly pool you share with the editor and CLI. Third-party models bill against prepaid credit at API list price.

Can Cursor cloud agents run on my own machines?

Yes. Self-Hosted Machines move file edits and terminal commands onto workers you run, while Cursor keeps inference. Individuals can connect a personal machine, and Enterprise teams can share a pool of workers.

Is it safe to let a Cursor cloud agent run commands on my code?

Each run gets an isolated VM, and Privacy Mode blocks training on your code. Runtime Secrets never reach the model. The open default network is the main gap, because an agent that follows injected instructions could send code out. Restrict egress to an allowlist for sensitive repositories.

Related articles