Cursor and Claude Code Security Settings for Web3 Teams
Part of our guide to Web3 penetration testing

Quick answer. Use Cursor desktop Allowlist with Workspace reads and no effective terminal or MCP auto-approvals. Start Claude Code's local terminal in managed Manual mode; for both, sandbox shell commands, restrict egress and integrations, and separate production credentials and signing.
Video transcript
Let the agent draft deployment scripts. Require a separate identity for production deployments.
An approval prompt asks whether an action should run. A sandbox limits what it can reach. In Cursor, supported sandboxed commands can still run without a prompt, even with an empty allowlist.
In Cursor desktop, use Allowlist, Workspace reads, and sandboxing. Verify there are no terminal or M C P auto-approvals. In Claude Code's local terminal, start in managed Manual mode, disable Auto and Bypass, and require the Bash sandbox.
Use a development identity without production keys or tokens. Let the agent draft an unsigned transaction, then have a human independently verify and sign it on a separate device.
Review extensions by version and block user mods in Claude Code. Admit only approved M C P servers, approve tool calls separately, and restrict network access outside the terminal sandbox too.
Have Developer Platform deploy the policy and Security approve exceptions. Record who owns each exception, what it allows, and when it expires.
Before rollout and after updates, test file reads, network access, and blocked shell actions in a disposable clone. Decline Cursor retry prompts and verify neither agent retries outside the sandbox. Verify the workspace cannot reach production or signing.
Read the full article for the settings table and policy template. If a developer workstation can reach a signer, ask Guardian about an operational security audit.
Start With Workstation Access
Use coding agents to draft deployment scripts. In your Cursor security policy, require a separate identity for production deployments.
Treat issue comments, pull requests and external docs as data, not instructions. Researchers showed that untrusted content could steer tested Cursor and GitHub Copilot setups into running unauthorized commands.[1]
An OpSec audit checks whether developer access or stored secrets can reach production deployment or signing roles.
Compare Local Permission Settings
Use this baseline for Cursor's desktop editor and Claude Code's local terminal in trusted repos.
A permission prompt controls approval. A sandbox limits what a process can reach after it runs.
In Cursor, open Settings > Agents > Approvals & Execution; dashboard Run Mode controls take precedence when configured. Supported sandboxed commands can still run without prompting even if the terminal list is empty.[2, 3]
Avoid Run Everything. Auto-review can approve an unsandboxed retry after the sandbox blocks a command.
Manual prompts for most edits, shell commands and network requests, not all actions. Eligible sessions can start in Auto, and a starting mode does not prevent switching.[4]
Set permissions.disableAutoMode and permissions.disableBypassPermissionsMode to "disable" in managed settings. With top-level allowManagedPermissionRulesOnly true, put required allow, deny and ask rules in the effective managed source.[5]
Verify the effective sandbox.excludedCommands list is empty. The current admin-required sandbox ignores repository exclusions but can still load exclusions from user or launch settings.[6]
If every execution requires a human decision, use a workflow with agent execution disabled.
| Control | Cursor | Claude Code |
|---|---|---|
| Approval mode | Allowlist | Set permissions.defaultMode to default for Manual. |
| Shell containment | Enable and verify sandboxing on each supported host. Refuse unsandboxed requests. | In sandbox: enabled and failIfUnavailable true; autoAllowBashIfSandboxed and allowUnsandboxedCommands false. |
| File reads | Workspace reads: 3.23+. Enterprise: enforce Workspace; disable Read Control User Extensions. | Enable managed permissions.blockReadsOutsideWorkingDirectories for built-in file tools. Configure shell reads separately. |
| Sandboxed shell network | Use sandbox.json Only; set networkPolicy.default to deny. Verify only approved destinations are allowed. | Enable sandbox.network.allowManagedDomainsOnly; only managed allowedDomains and managed WebFetch domain allows count. |
Keep Command Allowlists Small
Start with no configured terminal pre-approvals. Never pre-approve an entire shell, interpreter, package manager or Git.
Keep publishing, deployment and signing commands out of agent allowlists.
Cursor's terminal rules can match prefixes or argument patterns. A git status entry also matches invocations with arguments.[7]
User and repository lists combine unless team policy takes precedence.[3]
Claude Code evaluates deny before ask, then allow. Bash rules can match the full command or use wildcards.[8]
Prefer exact Bash invocations in Claude Code. Treat Cursor pre-approvals as potentially unsandboxed until verified on the deployed mode and build; reject any that remove required isolation.[2]
Cursor's autoRun steers a classifier, while Claude's CLAUDE.md gives the model instructions. Neither is an enforced permission rule.
Review the working directory and the code a command will invoke, not just its spelling. A familiar test command can run a newly modified repository script.
Check any package an agent suggests against the registry and the project's upstream source. Slopsquatting means registering a package name a model invented.[9]
For npm projects, review the lockfile and use npm ci --ignore-scripts where compatible.
npm ci will not rewrite a mismatched lockfile. An explicit npm test still runs the named script despite --ignore-scripts.[10]
Separate Secrets From Code
Run coding agents under a development identity. Keep wallet seeds, deployer keys, upgrade credentials, production cloud sessions and package publishing tokens out of reach.
Do not forward SSH or signing agents into the workspace.
Use local simulations, disposable test keys and short-lived nonproduction credentials. Keep secrets out of prompts, tool output and support attachments.
Cursor's .cursorignore limits editor and agent context but does not block terminal or MCP access.[11]
Cursor Privacy Mode governs data handling for Cursor-routed models, not local credential access. Check provider retention exceptions and verify provider terms separately before enabling personal API keys.[12]
Claude's built-in Read deny rules are best-effort, and Bash sandboxing permits broad host reads by default.[6, 8]
Deny sensitive paths with managed sandbox.filesystem.denyRead; use allowManagedReadPathsOnly to accept allowRead entries only from managed settings. sandbox.credentials deny entries cover named files and environment variables only for sandboxed commands.
Let the agent prepare an unsigned transaction. On a separate signing device, a human independently verifies the chain, raw target, function and parameters against the approved change.[13]
Control Extensions and MCP
Manage Cursor extensions by full ID with AllowedExtensions. Use the install and update cooldown, and enable signature verification where supported.[3, 12]
Verify that the extension build installed across the fleet matches the reviewed build.
On October 29, 2026, Cursor's marketplace served tampered Claude Code extension builds for Windows and macOS. Cursor's November 13 update describes that exposure; Microsoft's analysis excluded its own marketplace and the npm CLI package.[14, 15, 16]
Claude Code's strictKnownMarketplaces restricts marketplace sources, not which plugin builds are approved.[5]
Block user mods with the built-in guard's managed allowManagedModsOnly option. Keep sec-default@builtin loaded and review organizational mods separately; other plugin components can still load.[17, 18]
Approve MCP servers separately from tool calls. In Cursor Enterprise, specify allowed tools and a network policy per server.[19]
An empty Tools field permits all tools on that server. Keep Cursor's separate mcpAllowlist for tool auto-approval empty.[7]
Deploy managed-mcp.json directly on devices with approved servers in mcpServers, or {} for none. Check the loaded inventory for separately managed servers, app-provided integrations and mods.[20]
Use a managed mcp__* ask rule for ordinary agent calls in local interactive sessions, not calls by mods. A narrower allow cannot override it; narrow the ask rule for reviewed exceptions.[8]
Give approved servers credentials that can only do the intended job. For a tool that reads contract metadata, use a credential with no write, deploy or signing authority.
Cursor's terminal sandbox network policy applies only to sandboxed commands. Use managed endpoint or network policy for other editor, extension and integration traffic.[2]
Claude's Bash sandbox does not cover WebFetch, local MCP servers, command hooks or plugin monitors.[6]
Copy This Team Policy
Google reported that attackers modified Claude Code settings in internal repositories after gaining access. Our Claude Code settings abuse analysis covers what happened at startup.[21]
Enable Cursor Workspace Trust with the device policy WorkspaceTrustEnabled. Restricted Mode limits AI features.[3, 22]
Inspect external repositories in a disposable environment with restricted egress and no inherited credentials.[23]
In Claude Code, use managed allowManagedHooksOnly. Review force-enabled plugins separately: their hooks are exempt.[5, 24]
Claude Code's noninteractive CLI and SDK sessions treat the folder as trusted for settings-file hooks. Those hooks can run without prior workspace approval unless enforced policy blocks them.
- Scope: Default to the table for approved repositories on managed developer workstations. Require separate policy approval for cloud and unattended use.
- Ownership: Developer Platform deploys fleet policy and tracks client versions. Security approves exceptions and owns incident response.
- Integrations: Assign an owner to each approved extension, plugin and MCP integration. Re-review whenever its version or permissions change.
- Exceptions: Record owner, repository, client and version, exact command and working directory or integration and version, credential scope, network destination, approver and expiry.
- Change control: Require code-owner review for agent settings, hooks, scripts and lockfiles. Pause auto-reloading development processes before agent edits.
- Response: Stop the session, notify Security and revoke or rotate affected credentials from a clean environment if exposure is suspected.
Test Before Rolling Out
Cursor's docs disagree on whether an empty permissions.json array overrides editor state. Clear lower-level entries where applicable and verify the resolved terminal and MCP lists on the deployed build.[3, 7]
In Claude Code, use /status to find the managed source and claude doctor to see what was dropped.[5]
Repeat the checks below after client or policy changes. Give cloud agents and unattended runners their own acceptance tests: Cursor's local Run Modes do not apply to Cloud Agents.[2, 25]
- Files: Place synthetic markers at representative protected locations. Check each built-in file tool and shell path for the expected prompt or block.
- Network: Verify a sandboxed command cannot reach an unapproved test destination. Test built-in web tools and MCP separately.
- Approvals: Check that an unlisted extension or server is blocked. Verify calls to admitted MCP tools still require approval.
- Fallback: Test a blocked command. Decline any Cursor retry prompt; reject silent unsandboxed execution. Verify Claude Code cannot retry outside the sandbox.
- Identity: Verify the workspace and runners have no production roles, publish tokens, signer sockets or access to the signing service.
Review the Path From Editor to Signer
If a workstation can reach a deployer, a release token or a signer, ask Guardian about an OpSec audit covering privileged access, deployment controls and signing procedures.
Frequently Asked Questions
Is Claude Code Plan mode a no-execution mode?
Plan can run commands from the built-in read-only set without prompting. It can also run classifier-approved commands when Auto is available and enabled during planning.[4]
Can Claude Code enforce this Bash sandbox on Windows?
Not on native Windows: with the local sandbox enabled and failIfUnavailable set to true, Claude Code refuses to start. WSL2 is supported, but verify Windows host isolation, including that the Unix-socket filter blocks Windows launches.[6]
Does Claude Code keep a local copy of my prompts?
Claude Code stores local transcripts in plaintext under ~/.claude/projects/. The default cleanup period is 30 days and can be changed with cleanupPeriodDays. Sessions started or last continued in Claude Desktop or Cowork are exempt by default.[26]
Related reading
- Malicious VS Code Extensions: GlassWorm and Crypto Theft
- Trail of Bits Skills (trailofbits/skills) for Claude Code
- Crypto OpSec for Founders and Teams: A Practical Baseline
Sources
- arXiv: Your AI, My Shell: Demystifying Prompt Injection Attacks on Agentic AI Coding Editors
- Cursor: Run Modes
- Cursor: Deployment Patterns
- Anthropic: Choose a permission mode
- Anthropic: Deploy managed settings
- Anthropic: Configure the sandboxed Bash tool
- Cursor: permissions.json reference
- Anthropic: Configure permissions
- arXiv: The Range Shrinks, the Threat Remains: Re-evaluating LLM Package Hallucinations on the 2026 Frontier-Model Cohort
- npm: npm ci
- Cursor: Ignore File
- Cursor: Security and Privacy Hardening
- Security Alliance: Secure Multisig Best Practices
- Cursor: Security notice for malicious Claude Code extension builds
- Cursor: An update on our recent security incident
- Microsoft Security Research: Inside a malicious Claude Code-branded extension and its persistent SSH backdoor
- Anthropic: Manage mods for your organization
- Anthropic: Claude Code built-in security guard README
- Cursor: Model and Integration Management
- Anthropic: Control MCP server access for your organization
- Google Threat Intelligence Group: GTIG AI Threat Tracker: Agentic Threat Activity Crosses a Significant Threshold
- Cursor: Agent Security
- Security Alliance: Handling untrusted code
- Anthropic: Hooks reference
- Anthropic: The enterprise guide to securing coding agents
- Anthropic: Data usage
- BleepingComputer: Cursor confirms security breach led to malicious Claude Code extension
- Model Context Protocol: Model Context Protocol: Security Best Practices
- Cursor: sandbox.json reference
- Cursor: Network controls