Overview
Set up Cursor Cloud Agents with a Dockerfile environment, repository hooks, redacted runtime secrets and an outbound allowlist, so agent tasks run apart from your machine and land on a branch for review.
Problem or Objective
- Which agents take on multi-step tasks in the background and report back when they finish or need approval?
- Which agents write or run tests against an application?
More in Coding and Code Review
AI Agents and Models
Tools and Integrations
- Tools
- Cursor · Docker
- Prerequisites
- A Cursor plan that includes Cloud Agents (Premium and higher, Teams, Enterprise, or a legacy paid plan), source control connected by a Cursor admin, and a Dockerfile for the project's environment.
How It Works
Write a Dockerfile for the project with the language runtime, the test tools and the database your tests need, and reference it from .cursor/environment.json. Add command hooks in .cursor/hooks.json for the checks you want enforced. Store credentials in the Cursor Secrets tab as Runtime Secrets so they are redacted from the agent's output and commits, use Build Secrets for private package registries, and keep production credentials out entirely. Set network access to an allowlist of the domains the work needs. Then start a cloud agent with a task and its acceptance criteria. It works on its own branch in an isolated VM and pushes for handoff. Read the diff and test output; if a run goes wrong, discard the branch and start a fresh agent from the same environment.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Cursor.
- Connect the toolsConnect the tools this workflow relies on: Cursor, Docker.
- Check the prerequisitesA Cursor plan that includes Cloud Agents (Premium and higher, Teams, Enterprise, or a legacy paid plan), source control connected by a Cursor admin, and a Dockerfile for the project's environment.
- Gather your detailsCollect what the prompt asks for: The change to make, Repository, Systems the agent must not reach, Command that runs the tests, What done looks like.
- Run the starter promptPaste the starter prompt below into Cursor and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at cursor.com before you rely on it.
Practical Starter Prompt: Run a sandboxed agent task
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
Work on [The change to make] in [Repository]. Use the environment defined in .cursor/environment.json and the test database it starts; never connect to [Systems the agent must not reach]. Run [Command that runs the tests] before you finish and include the output. Meet these acceptance criteria: [What done looks like]. Work on a new branch and push it for review; do not merge. A person will review the diff and test output and approve before anything merges.Keep only test credentials in Runtime Secrets and set an outbound allowlist before the first run. Review the branch and test output; if a run goes wrong, discard the branch and start a new agent.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. Cursor's docs say cloud agents run in isolated VMs with full development environments, that environments can come from agent-led setup, a saved snapshot or a Dockerfile, that agents run command hooks from the repository, and that runtime secrets are redacted from tool results, transcripts and commits. They do not promise that hooks or allowlists stop every unsafe action, so review each branch before merging.
Limitations and Considerations
Cloud agents auto-run terminal commands, and Cursor warns that this brings a data exfiltration risk from prompt injection; an allowlist narrows it, though Cursor's own services and source control stay reachable. Runtime secrets are hidden from the agent but visible to anyone using the environment's terminal, so give the agent test credentials only. Cloud agents use your plan's usage and need a plan that includes them. Merge nothing without human review. Results depend on your setup and were not independently reproduced by Top 200 Repos.
Sources
- Cloud Agents | Cursor Docs (opens in a new tab)
Project documentation · cursor.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Cloud agents run in isolated VMs in the cloud with full development environments instead of on your local machine; they clone your repo, work on a separate branch, and push changes for handoff.
- You can configure environments with agent-led setup, a saved snapshot, or a Dockerfile in .cursor/environment.json.
- Cloud agents run command-based hooks from .cursor/hooks.json in your repository; you can add secrets and restrict outbound domains.
- Secrets & Network | Cursor Docs (opens in a new tab)
Project documentation · cursor.com · Undated · Source checked 26 Nov 2026, 17:27 UTC
What this source supports
- Runtime Secrets are loaded as environment variables but redacted from the agent's tool call results, chat transcript, commits and commit messages; they are still visible to users interacting with the agent's environment via the terminal. Build Secrets are only available to the Docker build process.
- Cloud agents auto-run terminal commands; the docs say this introduces data exfiltration risk because attackers could use prompt injection to trick the agent into uploading code to malicious websites.
- Outbound network access can be limited to the default domains plus an allowlist, or to an allowlist only; even then, a small set of domains such as Cursor's own services and source control providers remain accessible.