Is Cursor AI Safe for Sensitive Code? A 2026 Security Guide
Team Sonomos · Sonomos
The Sonomos research team writes about AI privacy, data protection, and how to use generative AI safely at work.
Cursor is one of the fastest-growing AI coding tools of 2026. Its deep IDE integration and multi-file context make it far more capable than a tab-completion tool, and far more capable of sending sensitive code to a third-party server. This guide explains what Cursor actually transmits, how to configure it to reduce that exposure, and where its data practices stand against the compliance frameworks that matter most for engineering teams in regulated industries. It was checked against Cursor's own pages on 18 November 2026.
What Cursor transmits and where it goes
Cursor is a fork of VS Code with AI completions, a chat and agent panel, and codebase search built in. Understanding the data flow means separating four features.
Tab completions (Cursor Tab)
When Cursor Tab is enabled, Cursor sends the code around your cursor to its servers to generate a completion. What gets sent is the surrounding code context and file metadata, not your whole codebase.
Chat and the agent
The chat and agent panel sends whatever goes into the conversation: your message, any files you attach with @ mentions, and any code the agent reads as context. This is the highest-risk feature because developers paste log output, API responses and error traces, which can contain production credentials, customer data or PHI. Requests go to the model you pick, including models from Anthropic, OpenAI and Google.
Codebase search
Earlier versions of Cursor uploaded code to build a semantic index, and earlier versions of this guide told you to switch that off. Cursor's current search documentation describes something different: its search, Instant Grep, "builds and queries its index on your machine," Cursor "does not upload file paths or code to build a search index," and it "does not store embeddings of your codebase for search." When the agent opens a file that a search turns up, that file's content can still go into the model request.
Cloud Agents
Cloud Agents run tasks on Cursor's infrastructure. Cursor's enterprise privacy page says they store an encrypted copy of the repository while the agent runs and delete it when the agent completes, and that they are the only feature that requires Cursor to store code. For teams with data loss prevention (DLP) policies, Cloud Agents are now the feature to review first.
Cursor's data and privacy terms in 2026
- Privacy Mode. Cursor's security page says: "When enabled, we will not train on your data." It is available on the Free and Pro plans, team and enterprise admins can turn it on and enforce it so members cannot switch it off, and it is on by default for Enterprise teams.
- With Privacy Mode off. Cursor's data use page, updated 3 September 2026, says it may then use and store codebase data, prompts, editor actions and code snippets to improve its AI features and train models. Its privacy policy says it does not use Inputs or Suggestions for training unless they are flagged for security review, you report them as feedback, or you have explicitly agreed.
- Model providers. Cursor says most models run under its zero data retention agreements, so providers neither store inputs and outputs nor train on them. A few models fall outside those agreements because the provider keeps data for harm-prevention review; for Enterprise and Privacy Mode customers, requests to them fail until an admin approves that retention.
- Contracts and residency. Cursor offers a data processing agreement. On Enterprise, US-only data residency covering inference, processing and storage can be enabled per team. EU and APAC residency is still in development.
- BAA. Cursor signs a HIPAA business associate agreement on its Enterprise plan, and requires one before any protected health information goes in. The BAA covers the listed services (the desktop IDE's Agent, Tab and Edit, Cloud Agents, the CLI, Cursor for iOS, BugBot and Automations) only with Privacy Mode "enabled and locked organization-wide." Third-party services and integrations, including model providers, are not automatically covered, and a Teams plan has to move to Enterprise first.
- Certifications. Cursor holds ISO/IEC 27001:2022, ISO/IEC 42001:2023 and AIUC-1 certifications and a SOC 2 Type II attestation; reports and certificates are available on request through its trust center.
Is Cursor safer than GitHub Copilot?
The comparison depends on what you are evaluating:
| Feature | Cursor | GitHub Copilot Business |
|---|---|---|
| Training opt-out | Yes: Privacy Mode, on by default for Enterprise and enforceable by admins | Yes (org-level default) |
| Multi-file context in chat | Yes (@ mention files; the agent reads files) | Limited (Copilot Chat with workspace context) |
| Code stored by the vendor | Only by Cloud Agents, temporarily, encrypted | Verify against GitHub's current terms |
| BAA available | Yes, on Enterprise with Privacy Mode locked | Not confirmed; see our Copilot HIPAA guide |
| SOC 2 Type II | Yes, plus ISO 27001 and ISO 42001 | Yes (GitHub) |
| DPA | Yes | Yes (Copilot Business) |
For healthcare teams, the BAA is now the sharpest difference: Cursor will sign one on Enterprise, while we could not confirm a BAA covering GitHub Copilot.
See the companion post Source Code in AI Coding Assistants for a broader comparison of AI coding tools for security-conscious engineering teams. For healthcare developers specifically, see Is GitHub Copilot HIPAA Compliant? for the BAA and regulatory picture for the most common alternative. For the terminal-based Anthropic equivalent of this review, see Is Claude Code Safe for Sensitive Code?.
Settings to configure before using Cursor with sensitive code
1. Enable and enforce Privacy Mode
Turn on Privacy Mode in Cursor's settings. On a team, have an admin enforce it so members cannot turn it off, and use the Allowed Team IDs policy to stop people signing in to personal accounts on company devices. If you handle PHI, the BAA requires it locked organisation-wide.
2. Control Cloud Agents
Cloud Agents are the one feature that puts a copy of your repository on Cursor's servers. Decide which repositories may use them. Enterprise customers can run Cloud Agents' tool calls on their own machines through Self-Hosted Machines, though the agent loop and inference stay in Cursor's cloud.
3. Review and limit @ context inclusions
When using the chat panel, be intentional about which files you @ mention. Never include:
- Config files (
.env,config.yaml,secrets.json, anything that could contain API keys or database credentials) - Log files from production systems (may contain PHI, customer PII, or session tokens)
- Files with hardcoded values from real environments
4. Use .cursorignore
Create a .cursorignore file in your repository root with patterns for sensitive paths, so Cursor's completions and agent context exclude them:
.env
.env.*
secrets/
config/production.yaml
*.pem
*.key
5. Approve models deliberately
Enterprise admins decide which models members can use. Before approving a model that falls outside Cursor's zero data retention agreements, read what the provider keeps and for how long.
Shadow AI risk with Cursor
One of the practical challenges of Cursor in enterprise environments is that it is not deployed centrally: developers install it on their own workstations. This creates the same shadow AI dynamic as consumer ChatGPT, where the tool is widely used before IT or security teams know about it.
Mitigation strategies:
- Browser/network proxy inspection: Some organizations inspect TLS traffic to detect and log connections to Cursor's endpoints and upstream AI providers.
- Approved-software lists: Put Cursor on the list of tools that need IT approval, with configuration requirements (Privacy Mode enforced, Cloud Agents limited) as a condition of approval.
- Developer education: Clear guidance on what to configure and why works better than a blanket prohibition that drives underground use.
Source code as sensitive data: what the compliance frameworks say
For engineering teams in regulated industries, source code itself is often a protected asset distinct from customer data:
- SOC 2 (Confidentiality criterion): Proprietary source code is typically classified as confidential information. Transmitting it to a third-party AI service without a contractual commitment to confidentiality may violate the Confidentiality criterion.
- ISO 27001: Under information classification controls (A.5.12), source code is typically classified at a level that restricts external transmission without authorization.
- Financial services (GLBA/FFIEC): Algorithms and models may be considered trade secrets; internal business logic exposed in code context may constitute nonpublic business information.
- Healthcare (HIPAA): Source code is not itself PHI, but code that contains hardcoded patient identifiers, test fixtures with real patient data, or system prompts that reference patient categories may contain or constitute PHI.
Frequently asked questions
Does Cursor sell or share my code?
Cursor's published terms state that it does not sell user code. With Privacy Mode on, on any plan, Cursor commits not to train on your data. Cursor sends context to the model provider you choose (Anthropic, OpenAI, Google and others), and says most models run under its zero data retention agreements with those providers. Read the Cursor DPA and subprocessor list for your plan to understand the full chain.
Is Cursor safe for closed-source commercial software?
For most commercial software development, Cursor Teams or Enterprise with Privacy Mode enforced and Cloud Agents limited is a defensible configuration. Your code context (the snippet around the cursor, files the agent reads, and whatever you paste into chat) still goes to Cursor's servers and the model provider for inference. If your IP policy requires all code to remain on-premises, Cursor is not the right tool; consider a local model setup instead.
Can I use Cursor for healthcare software development?
You can use Cursor to write healthcare software. The restriction is on sending PHI through it. Cursor signs a BAA on its Enterprise plan, covering the listed services only when Privacy Mode is enabled and locked across the organisation, and not covering third-party integrations. Without that BAA and configuration, any prompt containing real PHI is a compliance exposure, so replace real patient data in test fixtures, logs and sample API responses with synthetic data before it reaches Cursor.
What is the difference between Cursor's Privacy Mode and disabling chat history?
Privacy Mode controls whether Cursor and its model providers may train on or store your data. Disabling chat history removes the visible history from the Cursor UI but does not change transmission or retention on Cursor's servers. For compliance purposes, the relevant setting is Privacy Mode, together with the retention terms in your DPA.
How does Cursor handle API keys and secrets in code?
Cursor does not specifically detect or suppress API keys and secrets. If your code includes a .env file with real credentials and you @ mention that file in the chat, those credentials are transmitted to Cursor's servers. Use .cursorignore to exclude credential files, and prefer environment-variable references over hardcoded values in the files you share with AI tools. A named entity recognition (NER) or secret-scanning tool at the IDE level can provide an additional safety layer.
Is there a self-hosted version of Cursor?
Not of the AI itself. Cursor's Self-Hosted Machines option, on the Enterprise plan, runs Cloud Agents' terminal commands and file edits on your own infrastructure, but "the agent loop, including inference and planning, runs in Cursor's cloud," and the file chunks the model reads leave your network. Teams that need fully on-premises AI code assistance should evaluate VS Code with Continue.dev and a local model, or a self-hosted model behind another IDE. See Locke vs self-hosted AI for what running a local model does and doesn't solve from a data-protection standpoint.
The bottom line
Cursor is one of the most capable AI coding environments available in 2026, and its terms have tightened: a BAA on Enterprise, ISO 27001 and ISO 42001 certification, zero data retention agreements with most model providers, and a search index that now stays on your machine. The risks are manageable with the right configuration: enforce Privacy Mode, decide where Cloud Agents may run, use .cursorignore for sensitive paths, and build synthetic test data into your workflow so that real production data never appears in AI prompts. For teams where those controls are not enough, such as firms whose IP policies require full on-premises processing, local model setups are the better fit.
Keep keys and secrets out of what your coding agent sends
Locke's local proxy screens the requests that command-line agents, scripts and SDKs such as Claude Code send to model APIs, and masks the API keys, tokens and other secrets it detects before they leave your machine. It does not recognise proprietary code, so your code is sent as written, and Cursor and Devin Desktop (formerly Windsurf) use a format Locke cannot read yet.
Sonomos, which publishes this blog, makes Locke. Free for one person on x64 Windows and Linux; macOS is coming soon.
This article is general information about privacy and AI, not legal advice, and reading it does not create a solicitor–client or attorney–client relationship. Regulatory requirements turn on your specific facts and jurisdiction and change over time. Consult qualified counsel before relying on anything here, and check the publication and last-reviewed dates above. We may revise posts, but we do not undertake to keep any post current as the law changes.
Reference pages for this post
Related Articles
Best Privacy-Focused AI in 2026: Chatbots That Keep Your Data Private
The most private AI runs locally, via Ollama or LM Studio. Lumo, Brave Leo and Venice say they keep no chat logs; Duck.ai hides your IP. Compared, Nov 2026.
Can My Employer See My AI Chats? ChatGPT, Claude, Gemini and Copilot
Yes, if your employer controls the account, the computer or the network. Work accounts on ChatGPT, Claude, Gemini and Copilot let it read or keep chats. A side-by-side table of what each vendor documents, as of November 2026.
Can My Employer See My Copilot Chats? Work vs Personal Accounts
Copilot chats on a work account sit in your mailbox, where your employer can search, hold and export them with Purview. A personal account sits outside the tenant, but a work laptop can still capture it. What Microsoft documents, as of November 2026.