14 14
15### Permission-based architecture15### Permission-based architecture
16 16
17A session's permission mode sets which actions Claude can take without asking you first. Auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions. [Which mode a session starts in](/docs/en/permission-modes.md#which-mode-a-session-starts-in) covers earlier versions, other surfaces, and the settings that change the starting permission mode.17A session's permission mode sets which actions Claude can take without asking you first. Auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions. [Which mode a session starts in](https://code.claude.com/docs/en/permission-modes.md#which-mode-a-session-starts-in) covers earlier versions, other surfaces, and the settings that change the starting permission mode.
18 18
19* **Auto mode**: A separate classifier model reviews actions instead of you and blocks the ones it judges unsafe. [How the classifier evaluates actions](/docs/en/permission-modes.md#how-the-classifier-evaluates-actions) lists which actions Claude Code approves outright, which it sends to the classifier, and which Claude Code still asks you about. Your explicit ask and deny rules still apply, and your organization can [turn auto mode off](/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode)19* **Auto mode**: A separate classifier model reviews actions instead of you and blocks the ones it judges unsafe. [How the classifier evaluates actions](https://code.claude.com/docs/en/permission-modes.md#how-the-classifier-evaluates-actions) lists which actions Claude Code approves outright, which it sends to the classifier, and which Claude Code still asks you about. Your explicit ask and deny rules still apply, and your organization can [turn auto mode off](https://code.claude.com/docs/en/permission-modes.md#eliminate-prompts-with-auto-mode)
20* **Manual mode**: Claude Code starts with read-only permissions. When it needs to edit files, run tests, or execute commands, it asks you first, and you choose whether to approve the action once or allow it from then on. It runs a built-in set of [read-only commands](/docs/en/permissions.md#read-only-commands) such as `ls`, `cat`, and `git status` without asking20* **Manual mode**: Claude Code starts with read-only permissions. When it needs to edit files, run tests, or execute commands, it asks you first, and you choose whether to approve the action once or allow it from then on. It runs a built-in set of [read-only commands](https://code.claude.com/docs/en/permissions.md#read-only-commands) such as `ls`, `cat`, and `git status` without asking
21 21
22You and your organization configure these permissions directly. For detailed permission configuration, see [Permissions](/docs/en/permissions.md).22You and your organization configure these permissions directly. For detailed permission configuration, see [Permissions](https://code.claude.com/docs/en/permissions.md).
23 23
24### Built-in protections24### Built-in protections
25 25
26To mitigate risks in agentic systems:26To mitigate risks in agentic systems:
27 27
28* **Sandboxed bash tool**: [Sandbox](/docs/en/sandboxing.md) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Configure with `/sandbox` to define boundaries where Claude Code can work autonomously28* **Sandboxed bash tool**: [Sandbox](https://code.claude.com/docs/en/sandboxing.md) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Configure with `/sandbox` to define boundaries where Claude Code can work autonomously
29* **Working directory boundary**: In Manual mode, Claude Code asks you before its file tools read or write outside the folder where it was started and its subfolders. The boundary is a permission prompt, so a Bash command you approve can still write anywhere your user account can29* **Working directory boundary**: In Manual mode, Claude Code asks you before its file tools read or write outside the folder where it was started and its subfolders. The boundary is a permission prompt, so a Bash command you approve can still write anywhere your user account can
30 * To read a folder without the prompt, add it as an [additional directory](/docs/en/permissions.md#working-directories)30 * To read a folder without the prompt, add it as an [additional directory](https://code.claude.com/docs/en/permissions.md#working-directories)
31 * To restrict Bash commands at the operating system level, turn on [sandboxing](/docs/en/sandboxing.md#filesystem-isolation)31 * To restrict Bash commands at the operating system level, turn on [sandboxing](https://code.claude.com/docs/en/sandboxing.md#filesystem-isolation)
32* **Prompt fatigue mitigation**: Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization32* **Prompt fatigue mitigation**: Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization
33* **Accept Edits mode**: Auto-approves file edits and a fixed set of filesystem Bash commands like `mkdir`, `touch`, `rm`, `mv`, `cp`, and `sed` for paths in the working directory. Other Bash commands and out-of-scope paths still prompt33* **Accept Edits mode**: Auto-approves file edits and a fixed set of filesystem Bash commands like `mkdir`, `touch`, `rm`, `mv`, `cp`, and `sed` for paths in the working directory. Other Bash commands and out-of-scope paths still prompt
34 34
43### Core protections43### Core protections
44 44
45* **Permission system**: In Manual mode, sensitive operations require explicit approval45* **Permission system**: In Manual mode, sensitive operations require explicit approval
46* **Network command approval**: Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. In Manual mode they prompt like any other non-read-only Bash command, so you can still approve once or add an explicit allow rule like `Bash(curl *)`. To stop Claude from running them, add them to [`permissions.deny`](/docs/en/permissions#tool-specific-permission-rules). A deny rule matches the command [as written](/docs/en/permissions.md#bash-rule-limits); for network enforcement that doesn't depend on the command text, see [sandbox network isolation](/docs/en/sandboxing.md#network-isolation)46* **Network command approval**: Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. In Manual mode they prompt like any other non-read-only Bash command, so you can still approve once or add an explicit allow rule like `Bash(curl *)`. To stop Claude from running them, add them to [`permissions.deny`](https://code.claude.com/docs/en/permissions#tool-specific-permission-rules). A deny rule matches the command [as written](https://code.claude.com/docs/en/permissions.md#bash-rule-limits); for network enforcement that doesn't depend on the command text, see [sandbox network isolation](https://code.claude.com/docs/en/sandboxing.md#network-isolation)
47 47
48### Privacy safeguards48### Privacy safeguards
49 49
58### Additional safeguards58### Additional safeguards
59 59
60* **Network request approval**: In Manual mode, most tools that make network requests require user approval by default60* **Network request approval**: In Manual mode, most tools that make network requests require user approval by default
61* **Web page summaries**: For most fetches, WebFetch runs a separate model call over the page, and Claude receives that call's answer instead of the raw page. See [WebFetch tool behavior](/docs/en/tools-reference.md#webfetch-tool-behavior)61* **Web page summaries**: For most fetches, WebFetch runs a separate model call over the page, and Claude receives that call's answer instead of the raw page. See [WebFetch tool behavior](https://code.claude.com/docs/en/tools-reference.md#webfetch-tool-behavior)
62* **Trust verification**: In an interactive session, Claude Code shows the workspace trust dialog when you start it in a folder you haven't trusted. Servers in a project's `.mcp.json` have their own approval prompt, and [Project scope](/docs/en/mcp.md#project-scope) lists the sessions that skip it62* **Trust verification**: In an interactive session, Claude Code shows the workspace trust dialog when you start it in a folder you haven't trusted. Servers in a project's `.mcp.json` have their own approval prompt, and [Project scope](https://code.claude.com/docs/en/mcp.md#project-scope) lists the sessions that skip it
63 * Note: A `-p` session shows neither prompt. [What runs before you trust a folder](/docs/en/permissions.md#what-runs-before-you-trust-a-folder) lists what a repository's files can run there63 * Note: A `-p` session shows neither prompt. [What runs before you trust a folder](https://code.claude.com/docs/en/permissions.md#what-runs-before-you-trust-a-folder) lists what a repository's files can run there
64 * Note: When you start Claude Code directly in your home directory, trust acceptance is held for the current session only and is not written to disk, so the prompt reappears on each launch. There is no setting to persist it. Start Claude Code from a project subdirectory instead, where trust acceptance is saved per directory64 * Note: When you start Claude Code directly in your home directory, trust acceptance is held for the current session only and is not written to disk, so the prompt reappears on each launch. There is no setting to persist it. Start Claude Code from a project subdirectory instead, where trust acceptance is saved per directory
65* **Command injection detection**: In Manual mode, Claude Code asks before running a Bash command it can't fully analyze. An allow rule for part of a command, such as `Bash(git *)`, doesn't skip that prompt. [Sandboxed commands](/docs/en/permissions.md#how-permissions-interact-with-sandboxing) can run without it65* **Command injection detection**: In Manual mode, Claude Code asks before running a Bash command it can't fully analyze. An allow rule for part of a command, such as `Bash(git *)`, doesn't skip that prompt. [Sandboxed commands](https://code.claude.com/docs/en/permissions.md#how-permissions-interact-with-sandboxing) can run without it
66* **Fail-closed matching**: In Manual mode, unmatched commands require approval by default66* **Fail-closed matching**: In Manual mode, unmatched commands require approval by default
67* **Secure credential storage**: API keys and tokens are stored in the macOS Keychain when available. On Linux they're stored in a file with mode `0600`, and on Windows in a file that inherits the access controls of your user profile directory. See [Credential Management](/docs/en/authentication.md#credential-management)67* **Secure credential storage**: API keys and tokens are stored in the macOS Keychain when available. On Linux they're stored in a file with mode `0600`, and on Windows in a file that inherits the access controls of your user profile directory. See [Credential Management](https://code.claude.com/docs/en/authentication.md#credential-management)
68 68
69> [!WARNING]69> [!WARNING]
70>70>
86 86
87## MCP security87## MCP security
88 88
89You can connect Claude Code to Model Context Protocol (MCP) servers. Project-scoped servers are defined in `.mcp.json`, which you can check into source control. Servers at [other scopes](/docs/en/mcp.md#mcp-installation-scopes) and [claude.ai connectors](/docs/en/mcp.md#how-connectors-reach-claude-code) are configured outside the repository, and plugins can add servers too, so reviewing `.mcp.json` doesn't show every server a session can load. To restrict which servers run in your organization, see [Managed MCP configuration](/docs/en/managed-mcp.md).89You can connect Claude Code to Model Context Protocol (MCP) servers. Project-scoped servers are defined in `.mcp.json`, which you can check into source control. Servers at [other scopes](https://code.claude.com/docs/en/mcp.md#mcp-installation-scopes) and [claude.ai connectors](https://code.claude.com/docs/en/mcp.md#how-connectors-reach-claude-code) are configured outside the repository, and plugins can add servers too, so reviewing `.mcp.json` doesn't show every server a session can load. To restrict which servers run in your organization, see [Managed MCP configuration](https://code.claude.com/docs/en/managed-mcp.md).
90 90
91We encourage either writing your own MCP servers or using MCP servers from providers that you trust. You are able to configure Claude Code permissions for MCP servers. Anthropic reviews connectors against its [listing criteria](https://claude.com/docs/connectors/building/review-criteria) before adding them to the [Anthropic Directory](https://claude.ai/directory), but does not security-audit or manage any MCP server.91We encourage either writing your own MCP servers or using MCP servers from providers that you trust. You are able to configure Claude Code permissions for MCP servers. Anthropic reviews connectors against its [listing criteria](https://claude.com/docs/connectors/building/review-criteria) before adding them to the [Anthropic Directory](https://claude.ai/directory), but does not security-audit or manage any MCP server.
92 92
93## IDE security93## IDE security
94 94
95See [The built-in IDE MCP server](/docs/en/vs-code.md#the-built-in-ide-mcp-server) for more information on running Claude Code in an IDE.95See [The built-in IDE MCP server](https://code.claude.com/docs/en/vs-code.md#the-built-in-ide-mcp-server) for more information on running Claude Code in an IDE.
96 96
97## Cloud execution security97## Cloud execution security
98 98
99When you use [cloud sessions](/docs/en/claude-code-on-the-web.md), additional security controls are in place. Sessions your organization routes to a [self-hosted environment](/docs/en/self-hosted-environments) run on your own infrastructure, where isolation, network egress, and git credentials are your deployment's responsibility. In Anthropic-hosted environments:99When you use [cloud sessions](https://code.claude.com/docs/en/claude-code-on-the-web.md), additional security controls are in place. Sessions your organization routes to a [self-hosted environment](https://code.claude.com/docs/en/self-hosted-environments) run on your own infrastructure, where isolation, network egress, and git credentials are your deployment's responsibility. In Anthropic-hosted environments:
100 100
101* **Isolated virtual machines**: Each cloud session runs in an isolated, Anthropic-managed VM101* **Isolated virtual machines**: Each cloud session runs in an isolated, Anthropic-managed VM
102* **Network access controls**: Network access is limited by default and can be configured to be disabled or allow only specific domains102* **Network access controls**: Network access is limited by default and can be configured to be disabled or allow only specific domains
103* **Credential protection**: GitHub credentials are stored encrypted on Anthropic's servers and never enter the session VM. The VM holds a short-lived credential scoped to that session, and GitHub traffic goes through an [Anthropic proxy](/docs/en/cloud-environments.md#github-proxy) that attaches the GitHub credential on the server side. See [GitHub authentication options](/docs/en/claude-code-on-the-web.md#github-authentication-options) for how you grant access103* **Credential protection**: GitHub credentials are stored encrypted on Anthropic's servers and never enter the session VM. The VM holds a short-lived credential scoped to that session, and GitHub traffic goes through an [Anthropic proxy](https://code.claude.com/docs/en/cloud-environments.md#github-proxy) that attaches the GitHub credential on the server side. See [GitHub authentication options](https://code.claude.com/docs/en/claude-code-on-the-web.md#github-authentication-options) for how you grant access
104* **Push restrictions**: The [GitHub proxy](/docs/en/cloud-environments.md#github-proxy) rejects branch deletions and pushes of anything other than a branch, such as a tag. GitHub decides which branches a session can update by applying your repository's branch protection rules and rulesets to the GitHub access you connected. A rule that access can bypass doesn't block a session's push104* **Push restrictions**: The [GitHub proxy](https://code.claude.com/docs/en/cloud-environments.md#github-proxy) rejects branch deletions and pushes of anything other than a branch, such as a tag. GitHub decides which branches a session can update by applying your repository's branch protection rules and rulesets to the GitHub access you connected. A rule that access can bypass doesn't block a session's push
105* **Audit logging**: All operations in cloud sessions are logged for compliance and audit purposes105* **Audit logging**: All operations in cloud sessions are logged for compliance and audit purposes
106* **Automatic cleanup**: Session VMs are reclaimed after a period of inactivity106* **Automatic cleanup**: Session VMs are reclaimed after a period of inactivity
107* **Deletion**: You can [delete a session](/docs/en/claude-code-on-the-web.md#delete-sessions) at any time. See [Cloud execution data flow](/docs/en/data-usage.md#cloud-execution-data-flow-and-dependencies) for what Anthropic stores for a cloud session107* **Deletion**: You can [delete a session](https://code.claude.com/docs/en/claude-code-on-the-web.md#delete-sessions) at any time. See [Cloud execution data flow](https://code.claude.com/docs/en/data-usage.md#cloud-execution-data-flow-and-dependencies) for what Anthropic stores for a cloud session
108 108
109For more details on cloud execution, see [Use Claude Code in the cloud](/docs/en/claude-code-on-the-web.md); to configure network access for cloud sessions, see [Configure cloud environments](/docs/en/cloud-environments.md#network-access).109For more details on cloud execution, see [Use Claude Code in the cloud](https://code.claude.com/docs/en/claude-code-on-the-web.md); to configure network access for cloud sessions, see [Configure cloud environments](https://code.claude.com/docs/en/cloud-environments.md#network-access).
110 110
111[Remote Control](/docs/en/remote-control.md) sessions work differently: the web interface connects to a Claude Code process running on your local machine. All code execution and file access stays local, and session traffic travels through the Anthropic API over TLS; while connected, the session transcript is stored on Anthropic servers to sync the conversation across devices, as described in [Connection and security](/docs/en/remote-control.md#connection-and-security). No cloud VMs or sandboxing are involved. The connection uses multiple short-lived, narrowly scoped credentials, each limited to a specific purpose and expiring independently, to limit the blast radius of any single compromised credential.111[Remote Control](https://code.claude.com/docs/en/remote-control.md) sessions work differently: the web interface connects to a Claude Code process running on your local machine. All code execution and file access stays local, and session traffic travels through the Anthropic API over TLS; while connected, the session transcript is stored on Anthropic servers to sync the conversation across devices, as described in [Connection and security](https://code.claude.com/docs/en/remote-control.md#connection-and-security). No cloud VMs or sandboxing are involved. The connection uses multiple short-lived, narrowly scoped credentials, each limited to a specific purpose and expiring independently, to limit the blast radius of any single compromised credential.
112 112
113## Security best practices113## Security best practices
114 114
116 116
117* Review all suggested changes before approval117* Review all suggested changes before approval
118* Use project-specific permission settings for sensitive repositories118* Use project-specific permission settings for sensitive repositories
119* For additional isolation, run the whole Claude Code (local mode) process inside the [sandbox runtime](/docs/en/sandbox-environments.md#sandbox-runtime) or a [dev container](/docs/en/devcontainer.md)119* For additional isolation, run the whole Claude Code (local mode) process inside the [sandbox runtime](https://code.claude.com/docs/en/sandbox-environments.md#sandbox-runtime) or a [dev container](https://code.claude.com/docs/en/devcontainer.md)
120* Regularly audit your permission settings with `/permissions`120* Regularly audit your permission settings with `/permissions`
121 121
122### Team security122### Team security
123 123
124* Use [managed settings](/docs/en/settings.md#where-settings-live) to enforce organizational standards124* Use [managed settings](https://code.claude.com/docs/en/settings.md#where-settings-live) to enforce organizational standards
125* Share approved permission configurations through version control125* Share approved permission configurations through version control
126* Train team members on security best practices126* Train team members on security best practices
127* Monitor Claude Code usage through [OpenTelemetry metrics](/docs/en/monitoring-usage.md)127* Monitor Claude Code usage through [OpenTelemetry metrics](https://code.claude.com/docs/en/monitoring-usage.md)
128* Audit or block settings changes during sessions with [`ConfigChange` hooks](/docs/en/hooks#configchange)128* Audit or block settings changes during sessions with [`ConfigChange` hooks](https://code.claude.com/docs/en/hooks#configchange)
129 129
130### Reporting security issues130### Reporting security issues
131 131
138 138
139## Related resources139## Related resources
140 140
141* [Security guidance plugin](/docs/en/security-guidance.md): have Claude review and fix vulnerabilities in its own code changes during the session141* [Security guidance plugin](https://code.claude.com/docs/en/security-guidance.md): have Claude review and fix vulnerabilities in its own code changes during the session
142* [`/security-review`](/docs/en/commands#all-commands): run an on-demand security pass over the changes on your current branch142* [`/security-review`](https://code.claude.com/docs/en/commands#all-commands): run an on-demand security pass over the changes on your current branch
143* [Sandbox environments](/docs/en/sandbox-environments.md): compare isolation approaches and choose one for your threat model143* [Sandbox environments](https://code.claude.com/docs/en/sandbox-environments.md): compare isolation approaches and choose one for your threat model
144* [Sandboxing](/docs/en/sandboxing.md): filesystem and network isolation for Bash commands144* [Sandboxing](https://code.claude.com/docs/en/sandboxing.md): filesystem and network isolation for Bash commands
145* [Permissions](/docs/en/permissions.md): configure permissions and access controls145* [Permissions](https://code.claude.com/docs/en/permissions.md): configure permissions and access controls
146* [Monitoring usage](/docs/en/monitoring-usage.md): track and audit Claude Code activity146* [Monitoring usage](https://code.claude.com/docs/en/monitoring-usage.md): track and audit Claude Code activity
147* [Development containers](/docs/en/devcontainer.md): secure, isolated environments147* [Development containers](https://code.claude.com/docs/en/devcontainer.md): secure, isolated environments
148* [Anthropic Trust Center](https://trust.anthropic.com): security certifications and compliance148* [Anthropic Trust Center](https://trust.anthropic.com): security certifications and compliance
149* [CISO's guide to agentic AI](https://claude.com/blog/ciso-guide-to-agentic-ai): a security leader's framework for assessing agentic AI deployments149* [CISO's guide to agentic AI](https://claude.com/blog/ciso-guide-to-agentic-ai): a security leader's framework for assessing agentic AI deployments