Cursor security for a team comes down to five controls: enforce Privacy Mode from the admin dashboard, keep secrets out of AI context with .cursorignore, restrict agent auto-run to an allowlist, review MCP servers and rules files like code, and gate every merge with CI checks. Cursor's defaults favour speed, so each needs a deliberate setting.
Where Cursor's security risk comes from
Cursor's risk comes from three directions: code leaving your network, the agent taking actions on your machine, and repository content steering the agent. Each needs a different control.
Code leaves your network because Cursor sends context to model providers to generate completions and agent steps. Cursor's security page describes how requests flow and what Privacy Mode changes.
The agent acts on your machine because Agent mode edits files and runs terminal commands. With auto-run on, it can run a command before anyone reads it.
Repository content steers the agent because Cursor reads rules files, READMEs, issues and MCP tool output as context. Hidden or malicious text in any of them is a prompt injection path. Security researchers have shown that invisible Unicode characters in rules files can push assistants toward inserting harmful code, and that the change is hard to spot in a normal diff view.
Data controls: Privacy Mode and ignore files
Turn on Privacy Mode for the whole team and enforce it from the admin dashboard. With Privacy Mode on, Cursor commits that your code is not stored by Cursor or its model providers for training. Leaving it to each developer means one forgotten toggle puts code outside that commitment.
Next, decide what the AI should never see. A .cursorignore file at the repo root uses gitignore syntax to exclude files from indexing and AI features. Cursor's ignore files documentation also covers .cursorindexingignore, which only skips indexing and still lets the AI read the file when asked.
A starting .cursorignore:
.env
.env.*
secrets/
*.pem
*.key
infra/prod/
customer-data/
Cursor does not promise that ignored files stay hidden from every feature. The agent's terminal commands and MCP tools can still read files on disk. Treat .cursorignore as a way to keep secrets out of prompts by accident, and keep real production secrets off developer machines.
Agent controls: auto-run and command limits
Agent auto-run is the setting with the largest security impact in Cursor. When it is on, the agent runs terminal commands without asking. Cursor lets you restrict auto-run with an allowlist of commands and a denylist, and Cursor's own docs note that the denylist is not a security boundary.
A safer setup:
- Keep auto-run off for most developers, or limit it to an allowlist of test, lint and build commands.
- Do not rely on a denylist to stop
curl,rmorgit push; an agent can reach the same effect with a different command. - Turn on the protections Cursor offers against deleting files, editing dotfiles and touching files outside the workspace.
- Run long unattended agent sessions inside a container or VM with no production credentials; see agent sandbox.
Background agents need extra care. They run in remote environments, can install packages and have internet access, so a poisoned issue or dependency can lead them to exfiltrate code or secrets. Give them repos and tokens scoped to the task, never an org-wide token.
Repository trust, rules files and MCP servers
Opening a repository in Cursor can run code from that repository. Cursor is built on VS Code, and VS Code's Workspace Trust feature decides whether tasks and extensions run automatically in a newly opened folder. Cursor has shipped with Workspace Trust turned off, so check security.workspace.trust.enabled and turn it on before anyone opens untrusted code such as a candidate's take-home or a fork from a stranger.
Rules files in .cursor/rules/ shape everything the agent writes. Protect them like CI config:
- Add
.cursor/to CODEOWNERS so a named reviewer approves rule changes. - Scan rules files for hidden and bidirectional Unicode characters in CI.
- Keep rules about security explicit: parameterised queries, no secrets in code, no disabled TLS verification.
MCP servers widen what the agent can reach and what can reach the agent. Project-level servers live in .cursor/mcp.json, so a pull request can add one. Review each server before approval, prefer read-only scopes, and update Cursor promptly, since researchers have disclosed flaws in how MCP configs were trusted and Cursor has patched them. The Model Context Protocol entry explains how these servers connect.
Admin controls for teams
Cursor's team and enterprise plans add central controls that individual settings cannot replace. Use them in this order:
- Enforce Privacy Mode for all members.
- Turn on SSO so access ends when someone leaves.
- Restrict which models and features members can use, if your plan allows it.
- Review usage and member lists each month.
Plans and feature names change, so confirm what your tier includes on Cursor's pricing and admin docs before you write policy around a setting.
The Cursor security checklist
Apply this list to each team and repository that uses Cursor.
- Privacy Mode enforced at the team level.
.cursorignorecommitted in each repo with secrets, keys and production config excluded.- Agent auto-run off, or limited to a reviewed allowlist.
- File deletion, dotfile and outside-workspace protections turned on.
- Workspace Trust enabled.
.cursor/and.vscode/covered by CODEOWNERS.- MCP servers reviewed and approved before use.
- Background agents scoped to single repos with short-lived tokens.
- Branch protection and CI security checks required before merge.
Catching what slips through, in CI
Editor settings reduce risk on one machine. CI is where you check the result, no matter which developer or tool wrote it. Each pull request should run secret scanning, dependency review and static analysis, and require a human approval from someone other than the author.
AI-written code needs one more layer, because agents fail in specific ways: hallucinated packages, removed auth checks and weakened tests. The Motiontic Security Layer (MSL) runs on each pull request inside the team's own CI and scores changes against the ARI-42 risk index. Each PR gets a comment listing every risk with its fix, and the team gets a dashboard and a buyer-ready PDF report for security reviews. Setup is a 15-minute call, and the first report arrives within 48 hours.
Teams choosing between editors can compare control surfaces in Motiontic's Claude Code vs Cursor and GitHub Copilot vs Cursor breakdowns.
FAQ
Is Cursor safe for proprietary code?
Cursor can suit proprietary code when Privacy Mode is enforced for the whole team and secrets are excluded from AI context. Read Cursor's security page for its data handling commitments, and pair the editor settings with CI checks on each pull request.
Does Cursor train on my code?
With Privacy Mode on, Cursor states that code is not stored or used for training by Cursor or its model providers. Without it, data handling follows Cursor's standard terms, so enforce Privacy Mode at the team level instead of relying on each developer.
Does .cursorignore fully protect secrets?
No. It keeps files out of indexing and AI context, but the agent's terminal and MCP tools can still read files on disk. Keep production secrets off developer machines and use a secrets manager.
Is Cursor's auto-run (YOLO) mode safe?
It is safe enough inside a sandboxed container with no production credentials and an allowlist of commands. On a developer laptop with real credentials, it lets the agent run commands nobody reviewed, which increases the blast radius of a mistake or injection.
How do I review code Cursor wrote before it ships?
Send all agent work through pull requests with branch protection, required human approval and automated security checks. See AI guardrails for the controls that sit around the agent.
Review your Cursor-written pull requests
Motiontic can run an ARI-42 review on recent PRs and show where agent-written code carries risk. Book a 20-minute call.



