What Cursor offers for security today
Cursor has two kinds of security features, and they answer different questions. The first kind limits what the agent may do on your machine and what happens to your code. The second kind reviews the code the agent writes.
Controls on the agent are described in Cursor's agent security documentation. By default, terminal commands need your approval, and every connection to an external tool over MCP needs approval too. The run modes documentation describes three modes that decide what runs without asking: an allowlist of trusted actions, an automatic review mode that adds a sandbox and a classifier, and a mode that runs every tool call. The sandbox limits file access and blocks network access by default. On macOS it uses Seatbelt, on Linux it uses Landlock and seccomp.
Controls on your code are separate. A .cursorignore file blocks the agent from reading listed files. With privacy mode turned on, your code is never used for training, according to Cursor's privacy page, and admins can enforce the setting for the whole organisation. Rules add standing instructions to the agent, and hooks run your own scripts at defined points of the agent loop. These features protect your workstation, your credentials and your source. They do not judge whether the generated code is safe.
Reviews of the code come in several layers. This is how Cursor's documentation describes them:
| Feature | When it runs | What it does |
|---|---|---|
/review-security | When you run it | Runs a security review of your branch changes from your own agent before you push (security review documentation). |
| Agent review | When you run it, or automatically | A dedicated code review of your local changes inside the editor, with a quick and a deep level (agent review documentation). |
| Bugbot | On pull requests | Reviews pull requests and identifies bugs, security issues and code quality problems, then leaves comments with fix suggestions (Bugbot documentation). |
| Security reviewer agents | On pull requests | Check pull requests for security bugs, risky patterns and vulnerabilities before they merge. They require cloud agents (security review documentation). |
| Vulnerability remediation | On a schedule | Scanner agents look for security issues in code that is already merged. For a confirmed finding an agent can open a draft fix for you to review, when that option is turned on (remediation documentation). |
What Bugbot and the security review check
According to the Bugbot documentation, Bugbot analyses the diff of a pull request and leaves comments with explanations and fix suggestions. It runs on every update of the pull request, or when someone comments cursor review or bugbot run. It reads earlier comments on the pull request as context. You can give it project context in .cursor/BUGBOT.md files. The project rules in .cursor/rules do not apply to Bugbot runs.
The same page documents several limits:
- Large pull requests are skipped. Above its review-size limit Bugbot does not review the change and posts a comment asking you to split it.
- Generated files are left out. Files marked
linguist-generatedin.gitattributesare not reviewed. - Credential files are not read. Bugbot does not read the contents of files whose path looks like a credential file, such as
.envor*.pem. Source code that hardcodes a key is reviewed as usual. - Findings do not block a merge by default. A run with findings ends with a
neutralstatus. The documentation states that requiring the status alone does not block merges on findings. A failing status needs a separate setting, where it is available for your organisation.
The security review documentation describes a narrower tool. The reviewer agents include built-in security checks that you can enable or disable one by one, and you can add custom instructions about what to prioritise. They report findings through the tools you connect, for example to a chat channel or an issue tracker. The page lists the supported source control providers and the two that are not supported. To decide whether a reported issue was fixed, Cursor uses a language model to review the later diffs.
The /review-security skill runs the same review locally. By default it covers every change relative to the base branch, committed or not. A typical run looks like this:
> /review-security
(the agent reads the changes on your branch and reports findings)
> Fix the missing ownership check in orders/views.py and run the review again.What a model-based review can and cannot be relied on for
A model reads code the way a person does. That makes it good at questions that need context: is this endpoint missing an ownership check, does this function trust a value it should not, does the fix break the caller. A review of a diff also arrives early, while the change is still small and cheap to correct.
The same property sets the limits. Cursor's documentation on model safety and controls is direct about how language models behave:
- They are not repeatable. The page says that models can produce different outputs for the same input.
- They can be wrong with confidence. The page says that models can produce facts or code that seems plausible but is wrong.
- They can be steered by what they read. The page says that models can be influenced by carefully crafted prompts, known as prompt injection. Text in a file or a pull request is input to the model.
- A model check is not a hard boundary. The run modes documentation has a section stating that the automatic review mode is not a security boundary, because its classifier can make mistakes. The page on model safety and controls describes rules as steering: they improve the agent's behaviour but do not enforce it.
Cursor wrote these statements about the agent, not about Bugbot. They describe the technology, so they apply to any reviewer built on a language model, from any vendor. There is also a general point that applies to any author and any reviewer. A reviewer built on the same kind of model as the author tends to share the author's blind spots. A check that works in a different way reduces that.
So rely on a model-based review to find problems early and to explain them. Do not use an empty review as proof that a release is clean, and do not use it as the control an auditor will ask you to repeat.
Where an independent scanner fits
Cursor's own guidance points the same way. Its page on model safety and controls says you cannot rely on a language model to always make safe decisions, and recommends combining model steering with deterministic controls. It lists scanning generated code for vulnerabilities before it is written to disk as one use of hooks. The remediation documentation says its agents can also verify and fix findings that come from another security tool.
A rule-based scanner adds three things a model review does not:
- Repeatability. The same rule on the same code gives the same result, so a finding that disappears has been fixed, not overlooked.
- Systematic coverage. Static application security testing (SAST) traces data flows through the whole project against a fixed rule set, and software composition analysis checks every dependency against known vulnerabilities. A review of a diff looks at what changed.
- A gate and a record. A scan can fail a pipeline, and its report is evidence for a team lead or an auditor.
The scanner does not have to wait for CI. The agent in Cursor can run terminal commands and use external tools, so it can call a scanner that has an API. The scan can sit inside the agent loop: write, scan, read the findings, fix, scan again. With DerScanner the agent reads the API description at docs.derscanner.com and connects by itself, which takes three minutes. The steps are on the page about connecting a coding agent to DerScanner. DerScanner runs in the cloud, on-premise or in a network with no internet access.
One practical note. The sandbox blocks network access by default, so a sandboxed command may not reach the scanner. Approve the call when Cursor asks, or add the scanner's address to the network settings in sandbox.json, as the run modes documentation describes.
Checklist: Cursor settings
These settings come from Cursor's agent security, run modes and ignore file documentation, and from its page on model safety and controls.
- Choose the run mode on purpose. The documentation calls the automatic review mode the safest useful setup for most people. The mode that runs everything has no sandbox and no classifier. Keep it away from repositories and machines that hold anything you care about.
- Keep the allowlist short. Cursor describes the allowlist as best-effort, not a security boundary, and recommends combining it with other controls such as hooks.
- List secret files in
.cursorignore. Know its limit: the documentation says that terminal commands and MCP tools can still read ignored files. For real protection Cursor's page on model safety and controls recommends file system permissions or encryption. - Turn on privacy mode, and enforce it from the dashboard if you manage a team.
- Be careful with MCP servers. Cursor's documentation on MCP advises installing servers only from trusted developers and giving them restricted API keys.
- Write the security rules down. Put them in a project rule that always applies, and in
.cursor/BUGBOT.mdfor reviews. On team and enterprise plans an admin can make a rule required for everyone. - Use the admin controls. Enterprise teams can set run mode policies in the team dashboard and stop agents from modifying the
.cursordirectory.
# Secrets and credentials
**/.env
**/.env.*
**/credentials.json
**/*.key
**/*.pem---
description: Security requirements for this repo
alwaysApply: true
---
- Every route under /admin checks the admin role before any database read.
- Build SQL with parameters, never with string formatting.
- Read credentials from the secret manager, never from source files.Checklist: review habits
- Run
/review-securitybefore you push a significant change. - Read the diff yourself for anything that touches authentication, authorization, payments or personal data. The agent saves its edits to disk immediately, so keep the work in version control and review before you commit.
- Keep pull requests small. Bugbot skips a pull request above its size limit, and a person reviews a small change better too.
- Give the agent an independent scanner and one standing instruction: scan after each change, fix the findings, scan again.
- Keep a SAST and dependency scan in CI as the gate. Do not let the agent that wrote the code be the only reviewer.
- Do not open untrusted repositories with the agent, and do not paste untrusted content into it.
- When a finding is suppressed, record who decided and why. A person makes that call, not the agent.
The same approach for another agent is in the guide to Claude Code security review. For the risks this checklist is meant to catch, see vibe coding security risks. For a full team process, from the agent loop to release, see how to secure AI-generated code.
