Cloud Agents
Cursor Cloud Agent Best Practices: Scoping, Review, Cost
Cursor's first advice for reliable cloud agent runs is to set up the agent's environment before anything else. Next, make sure the agent can reach its secrets and URLs and can test your code. Then give it context through skills, AGENTS.md and rules, and give it tools it uses well.

On this page
Why set up the environment first?
Cursor's first recommendation is to configure a cloud agent's environment before you run it. Like a human developer, the agent does better work when its environment is set up correctly. Every other practice on this page depends on it, because an agent can't check its own work in a machine that can't run your code.
The order matters for a second reason. Cursor's trigger for the skills advice is an agent that has trouble testing its changes, and an agent whose environment never came up right shows exactly that symptom. If you reach for skills first, you may write careful instructions for a test command the machine could never have run.
Mistakes here cost more than they would on your laptop, because each fix needs a new Build. Saving an environment configuration starts one, and it runs your install command to completion before agents can start from it. Until an environment has a successful Build, agents start on Cursor's default image, without your setup.
Check which environment an agent will use, too. Cursor takes the first match: your personal saved environment, then the team's saved environment, then a committed .cursor/environment.json for single-repo runs. A saved environment reads that committed file only when its environment.json location points at it. Cursor suggests a personal environment for testing a new configuration before the whole team gets it. While yours exists, your runs on that repository won't pick up changes to the team environment.
Use the Cloud agent setup flow so Cursor has its environment configured, then layer access, context and tools on top of it. Cursor's agent-driven setup installs dependencies, verifies the environment and saves it after its first successful Build.
This exact topic is a hands-on Lesson: Review, verify & guardrails — about 5 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 make sure the agent can access what it needs?
Before you run a cloud agent, Cursor recommends checking three prerequisites. Each one decides whether the agent can run and test your code or stalls on missing access.
- Secrets
- Make sure the agent has the secrets it needs, such as API keys and database credentials, through the Secrets tab in your dashboard. For cloud roles, Cursor recommends OIDCOpenID Connect. The modern single sign-on standard, built as an identity layer on top of OAuth 2.0. Where SAML is XML and enterprise-legacy, OIDC is JSON and what newer tools implement first. Press Enter for the full definition. tokens over long-lived access keys.
- Egress controls
- If you have network access restrictions enabled, make sure all URLs your local development needs are on the allowlist.
- Local testability
- Your repo should run well locally without external services that a VM cannot reach. If it is hard for a human to test locally, it will be hard for an agent.
The three checks cost different amounts to fix. Secrets and egress are dashboard settings, quick to change once you know which one failed. Local testability belongs to the repo. If your tests need services that a VM can't reach, that is repo work, and it has to happen before an agent can help.
The egress check applies only if someone turned restrictions on. Cloud agents have internet access by default, and users, teams and saved environments can each restrict it. Even under Allowlist only, Cursor's own services and source control providers stay reachable. With a thin allowlist, the clone can succeed and the package install can still fail at the first host nobody added. The security and network page covers the modes.
How do skills, AGENTS.md and rules help configure the agent?
If a cloud agent has trouble testing its changes, Cursor recommends configuring it with skills and an AGENTS.md file. Cursor asks you to treat the agent as a smart but low-context human developer, and the way to get the right behavior is to give it the context it needs. You can commit project skills to the repo, sync personal skills for your own cloud agents, or publish a skill so teammates can install it.
Cursor describes its own setup. Its AGENTS.md lists tips for running and debugging the most-used microservices in its mono-repo. It also keeps many skills on how to test and debug key services, each with clear instructions on when to use it.
That split is also a context decision. A root AGENTS.md applies to the whole project, and nested AGENTS.md files apply when the agent works in their directory, so every line in the root file reaches every task. A skill loads on demand, when the agent judges it relevant, which makes it the right home for six paragraphs about one microservice.
The description carries the most weight. Cursor's skills docs say the agent uses it to decide relevance, and a skill without one is unlikely to be picked on its own, though you can still invoke it by name.
When a skill never fires, rewrite its description first. Cursor Agent SkillsReusable, model-invoked instructions (a SKILL.md with a name, description and steps) the agent loads only when its description matches the task. Press Enter for the full definition. covers the format.
Cursor's skills hold the in-depth details, such as how to debug a specific microservice or how to set up a third-party dependency when testing needs it.
For conventions, Cursor recommends rules. Cloud agents can read and follow rules at three levels, and each level has its own reach.
- User rules
- Set in Customize → Rules. They apply to your own sessions in every repository.
- Team rules
- Set in the Rules, Commands, Hooks dashboard. They apply to every team member in every repository.
- Repo rules
.cursor/rules/*.mdcfiles committed to the repository. They apply to every agent that uses it.
What tools should I give the agent?
Cursor has often found that agents are limited by the tools they can reach. It recommends using MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. and creating custom tools, so the agent can work with the same systems a human developer would.
A missing tool doesn't show up as an error. For example, an agent with no database access has nothing to query, so it works from whatever schema file is in the repo and writes something plausible against it. You find out at review, when the diff assumes a column that was renamed two releases ago.
To find the gap, read the transcript for workarounds. An agent that greps for a value it could have queried, or writes a parser for output a tool could have returned structured, is pointing at the next tool to add. Cursor's advice to iterate on tools based on how the agent uses them applies to the tools you already gave it, too.
What does it mean to mold the tools to the agent?
Cursor's advice goes past granting tools: build tools the agent is good at using, then iterate on them based on how it uses them. Cursor's own example shows where ordinary dev commands fall short.
At Cursor we have created a custom CLI for the model to run micro-services in our codebase. We found that when running custom dev commands, e.g. from a package.json file, some models would forget arguments, or agents would get distracted by noisy build logs which human developers knew to ignore.
The example holds two separate problems. A forgotten argument is an interface problem, and the fix is a command with fewer things to get wrong. Noisy build logs are an output problem. Nothing in a log marks which lines your team stopped reading years ago, so quieter output tends to work better than more instructions about what to ignore.
On a small team, we would skip this one. Cursor is describing a mono-repo full of microservices and a CLI built to drive it, and that CLI is a project with an owner and a maintenance cost. A repo with one test command and one dev server gets most of the benefit from an AGENTS.md line that names the command and the two flags people forget.
What should I check first when a cloud agent run goes wrong?
Work back through the same order: environment, access, context, then tools. Environment and access failures leave their evidence in logs and runs, not in the diff.
An install failure shows up first, in the environment's Builds tab, because the install command runs during a Build, before any agent starts from it. An access failure gets further, then stalls on one specific thing, such as an unset variable or a host that won't resolve. Context and tool problems are the confusing case: every command succeeds and the change is still wrong. Read the transcript closely when that happens.
The environment and access checks are mostly one-time setup. Skills and custom tools are not. Cursor's wording on tools is to iterate based on observations of how the agent uses them, and skills need the same treatment, because you learn which descriptions fail to fire only once agents run against them. Plan a second pass after the first bad week, not on day one.
Frequently asked questions
What is the most important step to improve a Cursor cloud agent?
Set up the environment first. Cursor recommends the Cloud agent setup flow so the environment is configured before you run an agent, because, like a human developer, the agent does better work when its environment is set up correctly.
What should I check before running a Cursor cloud agent?
Check three prerequisites. The agent needs the secrets it requires, through the Secrets tab. If network restrictions are on, all URLs your local development needs must be on the allowlist. And your repo should be testable locally without external services that a VM cannot reach.
How does Cursor recommend giving a cloud agent the right tools?
Use MCP and create custom tools so the agent can reach the same systems a developer would. Then mold those tools to the agent: build tools it is good at using, and iterate based on how it uses them.
Do cloud agents follow Cursor rules?
Yes. Cloud agents can read and follow rules at three levels: user rules set in Customize → Rules, team rules set in the Rules, Commands, Hooks dashboard, and repo rules committed to the repository as .mdc files in .cursor/rules.
In what order should I apply Cursor's cloud agent best practices?
Cursor states one ordering outright: set up the environment first. The page then covers access, context through skills, AGENTS.md and rules, and tools. Cursor's trigger for the skills advice is an agent having trouble testing its changes, which is also how an unconfigured environment presents. Configure skills first and you may document a test command the machine could never have run. When a run goes wrong, work back down the same order.
Sources & last verified
- Cursor Docs - Cloud Agent Best Practices
- Cursor - Cloud agent setup
- Cursor - Security & Network
- Cursor - Skills
- Cursor - Cloud Agent Builds
- Cursor - Rules (AGENTS.md)
Cursor ships frequently. Last updated October 28, 2026.