Cursor and Claude Code in Your Company: Risks and Controls for IT

AI coding agents read your code, run shell commands and launch MCP servers with the developer's permissions. Here is what has actually gone wrong, the controls Cursor and Anthropic ship for admins, and how to find both tools on your endpoints.

By Kuntur team · Published · Updated

What these tools actually do on a laptop

Cursor is a VS Code-based editor with an agent that reads the codebase, edits files and runs terminal commands. Claude Code is Anthropic's coding agent; it runs in a terminal, in VS Code and JetBrains extensions, and in the Claude desktop app, and does the same things. Both run as the logged-in user, which means they can reach whatever that user can: source code, SSH keys, cloud CLI credentials in the home directory, internal services on the VPN.

That is the point of them, and it is also why they need different controls from a web chatbot. A proxy sees the model traffic but not the shell commands the agent runs locally, the files it read to build context, or the MCP servers it launched. Most of the useful controls sit in the products' own configuration and on the endpoint.

The documented risks

File and terminal access

Both agents read files to build context and can run shell commands. By default each asks before running commands, but users can approve a command permanently. In Claude Code, "Yes, and don't ask again" saves an allow rule to .claude/settings.local.json. In Cursor, the Allowlist run mode runs listed commands without asking. Over a few weeks, a developer's allowlist tends to grow until it covers most of what an attacker would want.

Cursor's default Read Access setting is "System", which lets the agent read files outside the workspace without asking. Claude Code reads freely inside the working directory and any additional directories.

Auto-execution modes

Claude Code has a bypassPermissions mode (the --dangerously-skip-permissions flag) that skips permission prompts; Anthropic's docs say to use it only in isolated environments like containers or VMs. It also has an auto mode, where a classifier reviews actions instead of the user. Cursor has Run Everything, which runs every tool call automatically with no sandbox, and Auto-review, which sandboxes shell commands when it can and sends the rest to a classifier. Cursor's own documentation says Auto-review is not a security boundary.

Prompt injection that becomes code execution

Anything the agent reads can carry instructions: a README, an issue, a web page, the output of an MCP tool. Combined with command execution, this has produced real CVEs:

All three are fixed. The lesson is structural: any repository a developer opens, and any MCP server they add, is input to a program that can run commands. Version currency matters, and so does limiting what runs without approval.

MCP servers

MCP servers extend both agents with tools. A stdio server is a command the client launches with the user's permissions; a remote server is a URL, often with a token stored in plain text in the config file. They are configured per user (~/.cursor/mcp.json, ~/.claude.json) and per project (.cursor/mcp.json, .mcp.json), so cloning a repository can bring servers with it. See How to detect MCP servers for every location.

Secrets in context

If the agent can read .env, ~/.aws/credentials or a kubeconfig, their contents can end up in a prompt sent to the model provider. Ignore files help less than people think. Cursor's .cursorignore blocks the agent's own read and context access, but Cursor's docs note terminal and MCP tools cannot honor it. Claude Code does not read .claudeignore at all; you need Read deny rules, and those apply to Claude's file tools, not to a cat run through an approved shell command.

Claude Code also keeps session transcripts in plain text under ~/.claude/projects/ for 30 days by default (cleanupPeriodDays changes it). Anything a session read, including secrets, can sit there.

Extensions

Cursor installs VS Code-compatible extensions from Open VSX. An extension runs with the editor's privileges, outside the agent's permission system entirely. Treat the extension list as part of the attack surface, not an afterthought.

Controls the products give you

Both vendors now ship real admin controls. Use them before building your own.

Claude Code: managed settings

Managed settings sit above user, project and command-line settings and cannot be overridden by them. Deliver them as a file, an MDM profile, or from the claude.ai admin console (server-managed settings):

DeliveryLocation
File, WindowsC:\Program Files\ClaudeCode\managed-settings.json (the old C:\ProgramData path is no longer read)
File, macOS/Library/Application Support/ClaudeCode/managed-settings.json
File, Linux and WSL/etc/claude-code/managed-settings.json
Windows policyREG_SZ value Settings under HKLM\SOFTWARE\Policies\ClaudeCode holding the JSON
macOS profileManaged preferences domain com.anthropic.claudecode
Managed MCPmanaged-mcp.json in the same system directory, or the allowedMcpServers / deniedMcpServers keys

A reasonable starting policy disables the bypass and auto modes, makes only your permission rules count, keeps agents away from common secret files, and restricts MCP to an allowlist:

{
  "permissions": {
    "disableBypassPermissionsMode": "disable",
    "disableAutoMode": "disable",
    "deny": [
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(~/.aws/**)",
      "Read(~/.ssh/**)"
    ]
  },
  "allowManagedPermissionRulesOnly": true,
  "allowManagedMcpServersOnly": true,
  "allowedMcpServers": [
    { "serverName": "github" }
  ]
}

Check the settings reference for the exact entry format of each key on your version before deploying. On a test machine, run /status inside Claude Code: the Setting sources line should list Enterprise managed settings with the source in parentheses. claude doctor lists any entries it rejected. Note that a local administrator can edit a managed file, which is why MDM redeployment and the HKLM key exist.

On data: under commercial terms (Team, Enterprise, API), Anthropic does not train models on Claude Code prompts or code, and standard retention is 30 days; zero data retention is available for qualified Enterprise accounts. Consumer Pro and Max accounts follow the user's own training setting, which is a good reason to require company accounts.

Cursor: team and enterprise settings

Most of these are dashboard settings tied to the Cursor team. They only apply to people signed in to your team, which is why Allowed Team IDs matters.

Detect installation and use on endpoints

Policies in vendor dashboards cover the people you know about. To find the rest, check endpoints. Common footprints:

SignalCursorClaude Code
Binary (Windows)Per-user install under %LOCALAPPDATA%\Programs\cursor\Native installer: %USERPROFILE%\.local\bin\claude.exe; also WinGet Anthropic.ClaudeCode or npm @anthropic-ai/claude-code
Binary (macOS/Linux)/Applications/Cursor.app; AppImage or package on Linux~/.local/bin/claude linking into ~/.local/share/claude/versions/; Homebrew cask claude-code
User config~/.cursor/ (extensions, mcp.json)~/.claude/ (settings, transcripts) and ~/.claude.json (MCP servers, project trust)
Project config.cursor/, .cursorignore.claude/settings.json, .claude/settings.local.json, .mcp.json, CLAUDE.md
ProcessCursor / Cursor.execlaude / claude.exe

The Claude Code extension for VS Code and Cursor, and the Claude desktop app, also write to ~/.claude/, so that folder indicates use through any of them.

Windows (read-only)

# Installed binaries
$paths = "$env:LOCALAPPDATA\Programs\cursor\Cursor.exe",
         "$env:USERPROFILE\.local\bin\claude.exe"
$paths | Where-Object { Test-Path $_ } |
  ForEach-Object { Get-Item $_ | Select-Object FullName, @{n='Version'; e={ $_.VersionInfo.ProductVersion }} } | Format-Table -AutoSize
Get-Command claude -ErrorAction SilentlyContinue | Select-Object Source, Version | Format-Table -AutoSize

# Running now
Get-Process -Name Cursor, claude -ErrorAction SilentlyContinue | Select-Object Name, Id, Path | Format-Table -AutoSize

# Is Claude Code managed on this machine?
Test-Path 'C:\Program Files\ClaudeCode\managed-settings.json'
(Get-ItemProperty 'HKLM:\SOFTWARE\Policies\ClaudeCode' -Name Settings -ErrorAction SilentlyContinue).Settings

# Has anyone enabled bypass mode in their own settings?
$s = "$env:USERPROFILE\.claude\settings.json"
if (Test-Path $s) { Select-String -Path $s -Pattern 'bypassPermissions|defaultMode' }

# MCP servers configured for each tool
foreach ($f in "$env:USERPROFILE\.cursor\mcp.json", "$env:USERPROFILE\.claude.json") {
  if (Test-Path $f) {
    $j = Get-Content $f -Raw | ConvertFrom-Json
    if ($j.mcpServers) { $j.mcpServers.PSObject.Properties.Name | ForEach-Object { "$f : $_" } }
  }
}

Run it in the user's context (Intune Remediations in user context, or a logon script): %USERPROFILE% and %LOCALAPPDATA% resolve to the signed-in user. Project-scoped MCP servers in ~/.claude.json live under per-project keys, which this top-level check does not walk; the MCP guide has a fuller version.

macOS and Linux

# installed
ls -d /Applications/Cursor.app 2>/dev/null
ls -l ~/.local/bin/claude 2>/dev/null; command -v claude cursor 2>/dev/null
claude --version 2>/dev/null

# running
pgrep -fl 'Cursor|claude'

# managed policy present?
ls -l "/Library/Application Support/ClaudeCode/managed-settings.json" /etc/claude-code/managed-settings.json 2>/dev/null
defaults read com.anthropic.claudecode 2>/dev/null    # macOS profile

# bypass mode in user settings, and MCP servers
grep -E 'bypassPermissions|defaultMode' ~/.claude/settings.json 2>/dev/null
jq -r '.mcpServers // {} | keys[]' ~/.cursor/mcp.json ~/.claude.json 2>/dev/null

# repositories that ship agent config
find ~ -maxdepth 4 \( -name '.mcp.json' -o -path '*/.cursor/mcp.json' -o -path '*/.claude/settings.json' \) 2>/dev/null

What to alert on

Automate it

On a single Windows PC, the free Kuntur scanner lists Cursor, Claude Code and other AI apps, CLIs, IDE and browser extensions, MCP servers and local models. It runs locally with no account or admin rights and writes an HTML report to the Desktop without uploading anything.

  1. Download scan.ps1.
  2. Read it. It's plain text; here's what it does.
  3. Check its SHA-256 against the published hash: Get-FileHash .\scan.ps1 -Algorithm SHA256
  4. Run it: powershell -ExecutionPolicy Bypass -File .\scan.ps1

Windows shortcut, if you trust the source (PowerShell)

irm https://app.kuntur.io/scan.ps1 | iex

You can read the script before running it, and what it collects is documented.

Across a fleet, the Kuntur agent keeps that inventory current on Windows, macOS and Linux so you can see who runs Cursor or Claude Code and which MCP servers they added, mark each one approved or unauthorized, and keep an audit log of the decisions. It does not change agent settings, block, or uninstall anything; enforcement stays with the managed settings and team policies above. See pricing or the deployment guides.

FAQ

Is Claude Code safe to use in a company?
It can be, with managed settings that disable bypass and auto modes, deny reads of secret files, restrict MCP servers, and company accounts under commercial terms, where Anthropic does not train on prompts or code.
How do I stop Cursor from running commands automatically?
Set the team Run Mode policy so users cannot pick Run Everything. Cursor recommends Auto-review with sandboxing and hooks, and notes that Auto-review is not a security boundary.
Where is Claude Code managed-settings.json on Windows?
C:\Program Files\ClaudeCode\managed-settings.json. Policy can also be delivered as a Settings registry value under HKLM\SOFTWARE\Policies\ClaudeCode or from the claude.ai admin console.
Does .cursorignore stop the agent from reading secrets?
Only partly. It blocks the agent's own read and context access, but Cursor documents that terminal and MCP tools cannot honor it, so pair it with approvals and file permissions.

Sources

  1. Claude Code docs: Settings files and precedence
  2. Claude Code docs: Deploy managed settings
  3. Claude Code docs: Configure permissions
  4. Claude Code docs: Data usage
  5. Claude Code docs: Advanced setup (install locations)
  6. Cursor docs: Security and privacy hardening
  7. Cursor docs: Run modes
  8. Cursor docs: Privacy and data governance
  9. Tenable: CVE-2025-54135 and CVE-2025-54136 in Cursor
  10. Tenable: CVE-2025-54795 in Claude Code

More guides: