modified
--- a/security.md +++ b/security.md @@ -82,14 +82,14 @@ When you use [cloud sessions](</docs/en/claude-code-on-the-web>), additional security controls are in place. By default, a session runs its shell commands and file edits in an isolated, Anthropic-managed VM. 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: - * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains + * **Network access controls** : The session VM’s network access is limited by default and can be configured to be disabled or allow only specific domains. See [Access levels](</docs/en/cloud-environments#access-levels>) for what sessions can reach at every level * **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#github-proxy>) that attaches the GitHub credential on the server side. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for how you grant access * **Push restrictions** : The [GitHub proxy](</docs/en/cloud-environments#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 * **Audit logging** : All operations in cloud sessions are logged for compliance and audit purposes * **Automatic cleanup** : Session VMs are reclaimed after a period of inactivity * **Deletion** : You can [delete a session](</docs/en/claude-code-on-the-web#delete-sessions>) at any time. See [Cloud execution data flow](</docs/en/data-usage#cloud-execution-data-flow-and-dependencies>) for what Anthropic stores for a cloud session -For more details on cloud execution, see [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>); to configure network access for cloud sessions, see [Configure cloud environments](</docs/en/cloud-environments#network-access>). [Remote Control](</docs/en/remote-control>) 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#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. +For more details on cloud execution, see [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>). [Remote Control](</docs/en/remote-control>) 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#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. ## Security best practices
modified
--- a/security.md +++ b/security.md @@ -35,7 +35,7 @@ ### Core protections * **Permission system** : In Manual mode, sensitive operations require explicit approval - * **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#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) + * **Network command approval** : In Manual mode, commands such as `curl` and `wget` prompt you by default, so you can approve once or add an 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#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) ### Privacy safeguards @@ -50,7 +50,7 @@ ### Additional safeguards * **Network request approval** : In Manual mode, most tools that make network requests require user approval by default - * **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#webfetch-tool-behavior>) + * **Web page summaries** : For most WebFetch fetches, a separate model call reads the page, and Claude receives that call’s answer instead of the raw page. See [WebFetch tool behavior](</docs/en/tools-reference#webfetch-tool-behavior>) * **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#project-scope>) lists the sessions that skip it * Note: A `-p` session shows neither prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) lists what a repository’s files can run there * 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 @@ -80,9 +80,8 @@ ## Cloud execution security -When you use [cloud sessions](</docs/en/claude-code-on-the-web>), 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: +When you use [cloud sessions](</docs/en/claude-code-on-the-web>), additional security controls are in place. By default, a session runs its shell commands and file edits in an isolated, Anthropic-managed VM. 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: - * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains * **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#github-proxy>) that attaches the GitHub credential on the server side. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for how you grant access * **Push restrictions** : The [GitHub proxy](</docs/en/cloud-environments#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
modified
--- a/security.md +++ b/security.md @@ -17,7 +17,7 @@ To mitigate risks in agentic systems: - * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) 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 + * **Sandboxed Bash tool** : [Sandbox](</docs/en/sandboxing>) Bash commands with filesystem and network isolation. Configure with `/sandbox` * **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 * To read a folder without the prompt, add it as an [additional directory](</docs/en/permissions#working-directories>) * To restrict Bash commands at the operating system level, turn on [sandboxing](</docs/en/sandboxing#filesystem-isolation>) @@ -54,7 +54,7 @@ * **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#project-scope>) lists the sessions that skip it * Note: A `-p` session shows neither prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) lists what a repository’s files can run there * 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 - * **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#how-permissions-interact-with-sandboxing>) can run without it + * **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#how-permissions-interact-with-sandboxing>) in [auto-allow mode](</docs/en/sandboxing#auto-allow-mode>) can run without it * **Fail-closed matching** : In Manual mode, unmatched commands require approval by default * **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#credential-management>)
modified
Show diff (184 lines)
--- a/security.md +++ b/security.md @@ -1,22 +1,10 @@ -## +## How we approach security -​ - -How we approach security - -### - -​ - -Security foundation +### Security foundation Your code’s security is paramount. Claude Code is built with security at its core, developed according to Anthropic’s comprehensive security program. Learn more and access resources (SOC 2 Type 2 report, ISO 27001 certificate, etc.) at [Anthropic Trust Center](<https://trust.anthropic.com>). -### - -​ - -Permission-based architecture +### Permission-based architecture A 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#which-mode-a-session-starts-in>) covers earlier versions, other surfaces, and the settings that change the starting permission mode. @@ -25,11 +13,7 @@ You and your organization configure these permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). -### - -​ - -Built-in protections +### Built-in protections To mitigate risks in agentic systems: @@ -40,36 +24,20 @@ * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **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 -### - -​ - -User responsibility +### User responsibility You’re responsible for reviewing proposed code and commands for safety before approval. -## - -​ - -Protect against prompt injection +## Protect against prompt injection Prompt injection is a technique where an attacker attempts to override or manipulate an AI assistant’s instructions by inserting malicious text. Claude Code includes several safeguards against these attacks: -### - -​ - -Core protections +### Core protections * **Permission system** : In Manual mode, sensitive operations require explicit approval * **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#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) -### - -​ - -Privacy safeguards +### Privacy safeguards We have implemented several safeguards to protect your data, including: @@ -79,11 +47,7 @@ For full details, please review our [Commercial Terms of Service](<https://www.anthropic.com/legal/commercial-terms>) (for Team, Enterprise, and API users) or [Consumer Terms](<https://www.anthropic.com/legal/consumer-terms>) (for Free, Pro, Max, and Ultra users) and [Privacy Policy](<https://www.anthropic.com/legal/privacy>). -### - -​ - -Additional safeguards +### Additional safeguards * **Network request approval** : In Manual mode, most tools that make network requests require user approval by default * **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#webfetch-tool-behavior>) @@ -106,27 +70,15 @@ While these protections significantly reduce risk, no system is completely immune to all attacks. Always maintain good security practices when working with any AI tool. -## - -​ - -MCP security +## MCP security You 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#mcp-installation-scopes>) and [claude.ai connectors](</docs/en/mcp#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>). We 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. -## - -​ - -IDE security +## IDE security See [The built-in IDE MCP server](</docs/en/vs-code#the-built-in-ide-mcp-server>) for more information on running Claude Code in an IDE. -## - -​ - -Cloud execution security +## Cloud execution security When you use [cloud sessions](</docs/en/claude-code-on-the-web>), 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: @@ -140,28 +92,16 @@ For more details on cloud execution, see [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>); to configure network access for cloud sessions, see [Configure cloud environments](</docs/en/cloud-environments#network-access>). [Remote Control](</docs/en/remote-control>) 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#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. -## +## Security best practices -​ - -Security best practices - -### - -​ - -Working with sensitive code +### Working with sensitive code * Review all suggested changes before approval * Use project-specific permission settings for sensitive repositories * For additional isolation, run the whole Claude Code (local mode) process inside the [sandbox runtime](</docs/en/sandbox-environments#sandbox-runtime>) or a [dev container](</docs/en/devcontainer>) * Regularly audit your permission settings with `/permissions` -### - -​ - -Team security +### Team security * Use [managed settings](</docs/en/settings#where-settings-live>) to enforce organizational standards * Share approved permission configurations through version control @@ -169,11 +109,7 @@ * Monitor Claude Code usage through [OpenTelemetry metrics](</docs/en/monitoring-usage>) * Audit or block settings changes during sessions with [`ConfigChange` hooks](</docs/en/hooks#configchange>) -### - -​ - -Reporting security issues +### Reporting security issues If you discover a security vulnerability in Claude Code: @@ -182,11 +118,7 @@ 3. Include detailed reproduction steps 4. Allow time for us to address the issue before public disclosure -## - -​ - -Related resources +## Related resources * [Security guidance plugin](</docs/en/security-guidance>): have Claude review and fix vulnerabilities in its own code changes during the session * [`/security-review`](</docs/en/commands#all-commands>): run an on-demand security pass over the changes on your current branch
modified
--- a/security.md +++ b/security.md @@ -77,7 +77,7 @@ * Restricted access to user session data * User control over data training preferences. Consumer users can change their [privacy settings](<https://claude.ai/settings/privacy>) at any time. -For full details, please review our [Commercial Terms of Service](<https://www.anthropic.com/legal/commercial-terms>) (for Team, Enterprise, and API users) or [Consumer Terms](<https://www.anthropic.com/legal/consumer-terms>) (for Free, Pro, and Max users) and [Privacy Policy](<https://www.anthropic.com/legal/privacy>). +For full details, please review our [Commercial Terms of Service](<https://www.anthropic.com/legal/commercial-terms>) (for Team, Enterprise, and API users) or [Consumer Terms](<https://www.anthropic.com/legal/consumer-terms>) (for Free, Pro, Max, and Ultra users) and [Privacy Policy](<https://www.anthropic.com/legal/privacy>). ###
modified
--- a/security.md +++ b/security.md @@ -120,7 +120,7 @@ IDE security -See [VS Code security and privacy](</docs/en/vs-code#security-and-privacy>) for more information on running Claude Code in an IDE. +See [The built-in IDE MCP server](</docs/en/vs-code#the-built-in-ide-mcp-server>) for more information on running Claude Code in an IDE. ##
modified
--- a/security.md +++ b/security.md @@ -154,7 +154,7 @@ * Review all suggested changes before approval * Use project-specific permission settings for sensitive repositories - * Consider using [dev containers](</docs/en/devcontainer>) for additional isolation + * For additional isolation, run the whole Claude Code (local mode) process inside the [sandbox runtime](</docs/en/sandbox-environments#sandbox-runtime>) or a [dev container](</docs/en/devcontainer>) * Regularly audit your permission settings with `/permissions` ###
modified
--- a/security.md +++ b/security.md @@ -18,7 +18,12 @@ Permission-based architecture -In Manual mode, Claude Code starts with read-only permissions. When Claude Code 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. In Manual mode, Claude Code also asks before running Bash commands that can modify your system. It runs a built-in set of [read-only commands](</docs/en/permissions#read-only-commands>) such as `ls`, `cat`, and `git status` without asking. You and your organization configure these permissions directly. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-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#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#eliminate-prompts-with-auto-mode>). Which permission mode a session starts in depends on your plan, the surface you start it from, and your settings and your organization’s; see [Permission modes](</docs/en/permission-modes#which-mode-a-session-starts-in>). For detailed permission configuration, see [Permissions](</docs/en/permissions>). +A 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#which-mode-a-session-starts-in>) covers earlier versions, other surfaces, and the settings that change the starting permission mode. + + * **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#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#eliminate-prompts-with-auto-mode>) + * **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#read-only-commands>) such as `ls`, `cat`, and `git status` without asking + +You and your organization configure these permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). ### @@ -29,7 +34,9 @@ To mitigate risks in agentic systems: * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) 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 - * **Working directory boundary** : In Manual mode, Claude Code can only write to the folder where it was started and its subfolders, and can’t modify files in parent directories without explicit permission. In Manual mode, Claude Code also asks you before reading paths outside this boundary with the Read, Grep, and Glob tools. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled + * **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 + * To read a folder without the prompt, add it as an [additional directory](</docs/en/permissions#working-directories>) + * To restrict Bash commands at the operating system level, turn on [sandboxing](</docs/en/sandboxing#filesystem-isolation>) * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **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 @@ -39,7 +46,7 @@ User responsibility -Claude Code only has the permissions you grant it. You’re responsible for reviewing proposed code and commands for safety before approval. +You’re responsible for reviewing proposed code and commands for safety before approval. ## @@ -56,8 +63,6 @@ Core protections * **Permission system** : In Manual mode, sensitive operations require explicit approval - * **Context-aware analysis** : Detects potentially harmful instructions by analyzing the full request - * **Input sanitization** : Prevents command injection by processing user inputs * **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#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) ### @@ -81,14 +86,13 @@ Additional safeguards * **Network request approval** : In Manual mode, most tools that make network requests require user approval by default - * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts - * **Trust verification** : First-time codebase runs and new MCP servers require trust verification - * Note: Trust verification is disabled when running non-interactively with the `-p` flag + * **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#webfetch-tool-behavior>) + * **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#project-scope>) lists the sessions that skip it + * Note: A `-p` session shows neither prompt. [What runs before you trust a folder](</docs/en/permissions#what-runs-before-you-trust-a-folder>) lists what a repository’s files can run there * 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 - * **Command injection detection** : In Manual mode, suspicious bash commands require manual approval even if previously allowlisted + * **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#how-permissions-interact-with-sandboxing>) can run without it * **Fail-closed matching** : In Manual mode, unmatched commands require approval by default - * **Natural language descriptions** : Complex bash commands include explanations for user understanding - * **Secure credential storage** : API keys and tokens are stored in the macOS Keychain when available, and protected by file permissions on Windows and Linux. See [Credential Management](</docs/en/authentication#credential-management>) + * **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#credential-management>) **Windows WebDAV security risk** : When running Claude Code on Windows, we recommend against enabling WebDAV or allowing Claude Code to access paths such as `\\*` that may contain WebDAV subdirectories. [WebDAV has been deprecated by Microsoft](<https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#:~:text=The%20Webclient%20\(WebDAV\)%20service%20is%20deprecated>) due to security risks. Enabling WebDAV may allow Claude Code to trigger network requests to remote hosts, bypassing the permission system. @@ -108,7 +112,7 @@ MCP security -Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control. We 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. +You 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#mcp-installation-scopes>) and [claude.ai connectors](</docs/en/mcp#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>). We 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. ## @@ -129,7 +133,7 @@ * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains * **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#github-proxy>) that attaches the GitHub credential on the server side. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for how you grant access - * **Branch restrictions** : Git push operations are restricted to the current working branch + * **Push restrictions** : The [GitHub proxy](</docs/en/cloud-environments#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 * **Audit logging** : All operations in cloud sessions are logged for compliance and audit purposes * **Automatic cleanup** : Session VMs are reclaimed after a period of inactivity * **Deletion** : You can [delete a session](</docs/en/claude-code-on-the-web#delete-sessions>) at any time. See [Cloud execution data flow](</docs/en/data-usage#cloud-execution-data-flow-and-dependencies>) for what Anthropic stores for a cloud session
modified
--- a/security.md +++ b/security.md @@ -128,10 +128,11 @@ * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains - * **Credential protection** : Authentication is handled through a secure proxy that uses a scoped credential inside the sandbox, which is then translated to your actual GitHub authentication token + * **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#github-proxy>) that attaches the GitHub credential on the server side. See [GitHub authentication options](</docs/en/claude-code-on-the-web#github-authentication-options>) for how you grant access * **Branch restrictions** : Git push operations are restricted to the current working branch * **Audit logging** : All operations in cloud sessions are logged for compliance and audit purposes * **Automatic cleanup** : Session VMs are reclaimed after a period of inactivity + * **Deletion** : You can [delete a session](</docs/en/claude-code-on-the-web#delete-sessions>) at any time. See [Cloud execution data flow](</docs/en/data-usage#cloud-execution-data-flow-and-dependencies>) for what Anthropic stores for a cloud session For more details on cloud execution, see [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>); to configure network access for cloud sessions, see [Configure cloud environments](</docs/en/cloud-environments#network-access>). [Remote Control](</docs/en/remote-control>) 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#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.
modified
--- a/security.md +++ b/security.md @@ -124,7 +124,7 @@ Cloud execution security -When using [Claude Code on the web](</docs/en/claude-code-on-the-web>), 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: +When you use [cloud sessions](</docs/en/claude-code-on-the-web>), 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: * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains @@ -133,7 +133,7 @@ * **Audit logging** : All operations in cloud sessions are logged for compliance and audit purposes * **Automatic cleanup** : Session VMs are reclaimed after a period of inactivity -For more details on cloud execution, see [Claude Code on the web](</docs/en/claude-code-on-the-web>); to configure network access for cloud sessions, see [Configure cloud environments](</docs/en/cloud-environments#network-access>). [Remote Control](</docs/en/remote-control>) 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#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. +For more details on cloud execution, see [Use Claude Code in the cloud](</docs/en/claude-code-on-the-web>); to configure network access for cloud sessions, see [Configure cloud environments](</docs/en/cloud-environments#network-access>). [Remote Control](</docs/en/remote-control>) 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#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. ##
modified
--- a/security.md +++ b/security.md @@ -58,7 +58,7 @@ * **Permission system** : In Manual mode, sensitive operations require explicit approval * **Context-aware analysis** : Detects potentially harmful instructions by analyzing the full request * **Input sanitization** : Prevents command injection by processing user inputs - * **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 block them entirely, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>) + * **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#bash-rule-limits>); for network enforcement that doesn’t depend on the command text, see [sandbox network isolation](</docs/en/sandboxing#network-isolation>) ###
modified
--- a/security.md +++ b/security.md @@ -29,7 +29,7 @@ To mitigate risks in agentic systems: * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) 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 - * **Working directory boundary** : In Manual mode, Claude Code can only write to the folder where it was started and its subfolders, and can’t modify files in parent directories without explicit permission. In Manual mode, Claude Code also asks you before reading paths outside this boundary with the Read, Grep, and Glob tools. In auto mode it reads them without asking. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled + * **Working directory boundary** : In Manual mode, Claude Code can only write to the folder where it was started and its subfolders, and can’t modify files in parent directories without explicit permission. In Manual mode, Claude Code also asks you before reading paths outside this boundary with the Read, Grep, and Glob tools. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **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
modified
--- a/security.md +++ b/security.md @@ -158,7 +158,7 @@ Team security - * Use [managed settings](</docs/en/settings#settings-files>) to enforce organizational standards + * Use [managed settings](</docs/en/settings#where-settings-live>) to enforce organizational standards * Share approved permission configurations through version control * Train team members on security best practices * Monitor Claude Code usage through [OpenTelemetry metrics](</docs/en/monitoring-usage>)
modified
--- a/security.md +++ b/security.md @@ -18,7 +18,7 @@ Permission-based architecture -Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. Claude Code requires approval before running Bash commands that can modify your system. A built-in set of [read-only commands](</docs/en/permissions#read-only-commands>) such as `ls`, `cat`, and `git status` runs without a prompt. This approach lets users and organizations configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). +In Manual mode, Claude Code starts with read-only permissions. When Claude Code 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. In Manual mode, Claude Code also asks before running Bash commands that can modify your system. It runs a built-in set of [read-only commands](</docs/en/permissions#read-only-commands>) such as `ls`, `cat`, and `git status` without asking. You and your organization configure these permissions directly. In [auto mode](</docs/en/permission-modes#eliminate-prompts-with-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#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#eliminate-prompts-with-auto-mode>). Which permission mode a session starts in depends on your plan, the surface you start it from, and your settings and your organization’s; see [Permission modes](</docs/en/permission-modes#which-mode-a-session-starts-in>). For detailed permission configuration, see [Permissions](</docs/en/permissions>). ### @@ -29,7 +29,7 @@ To mitigate risks in agentic systems: * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) 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 - * **Working directory boundary** : Claude Code can only write to the folder where it was started and its subfolders, and cannot modify files in parent directories without explicit permission. Reading paths outside this boundary with the Read, Grep, and Glob tools is possible after an approval prompt. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled + * **Working directory boundary** : In Manual mode, Claude Code can only write to the folder where it was started and its subfolders, and can’t modify files in parent directories without explicit permission. In Manual mode, Claude Code also asks you before reading paths outside this boundary with the Read, Grep, and Glob tools. In auto mode it reads them without asking. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **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 @@ -55,10 +55,10 @@ Core protections - * **Permission system** : Sensitive operations require explicit approval + * **Permission system** : In Manual mode, sensitive operations require explicit approval * **Context-aware analysis** : Detects potentially harmful instructions by analyzing the full request * **Input sanitization** : Prevents command injection by processing user inputs - * **Network command approval** : Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. 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 block them entirely, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>) + * **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 block them entirely, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>) ### @@ -80,13 +80,13 @@ Additional safeguards - * **Network request approval** : Tools that make network requests require user approval by default + * **Network request approval** : In Manual mode, most tools that make network requests require user approval by default * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts * **Trust verification** : First-time codebase runs and new MCP servers require trust verification * Note: Trust verification is disabled when running non-interactively with the `-p` flag * 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 - * **Command injection detection** : Suspicious bash commands require manual approval even if previously allowlisted - * **Fail-closed matching** : Unmatched commands default to requiring manual approval + * **Command injection detection** : In Manual mode, suspicious bash commands require manual approval even if previously allowlisted + * **Fail-closed matching** : In Manual mode, unmatched commands require approval by default * **Natural language descriptions** : Complex bash commands include explanations for user understanding * **Secure credential storage** : API keys and tokens are stored in the macOS Keychain when available, and protected by file permissions on Windows and Linux. See [Credential Management](</docs/en/authentication#credential-management>)
modified
--- a/security.md +++ b/security.md @@ -124,7 +124,7 @@ Cloud execution security -When using [Claude Code on the web](</docs/en/claude-code-on-the-web>), additional security controls are in place: +When using [Claude Code on the web](</docs/en/claude-code-on-the-web>), 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: * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains
modified
--- a/security.md +++ b/security.md @@ -28,7 +28,7 @@ To mitigate risks in agentic systems: - * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Enable with `/sandbox` to define boundaries where Claude Code can work autonomously + * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) 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 * **Working directory boundary** : Claude Code can only write to the folder where it was started and its subfolders, and cannot modify files in parent directories without explicit permission. Reading paths outside this boundary with the Read, Grep, and Glob tools is possible after an approval prompt. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **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 @@ -191,3 +191,4 @@ * [Monitoring usage](</docs/en/monitoring-usage>): track and audit Claude Code activity * [Development containers](</docs/en/devcontainer>): secure, isolated environments * [Anthropic Trust Center](<https://trust.anthropic.com>): security certifications and compliance + * [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
modified
--- a/security.md +++ b/security.md @@ -130,10 +130,10 @@ * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains * **Credential protection** : Authentication is handled through a secure proxy that uses a scoped credential inside the sandbox, which is then translated to your actual GitHub authentication token * **Branch restrictions** : Git push operations are restricted to the current working branch - * **Audit logging** : All operations in cloud environments are logged for compliance and audit purposes - * **Automatic cleanup** : Cloud environments are automatically terminated after session completion + * **Audit logging** : All operations in cloud sessions are logged for compliance and audit purposes + * **Automatic cleanup** : Session VMs are reclaimed after a period of inactivity -For more details on cloud execution, see [Claude Code on the web](</docs/en/claude-code-on-the-web>). [Remote Control](</docs/en/remote-control>) 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#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. +For more details on cloud execution, see [Claude Code on the web](</docs/en/claude-code-on-the-web>); to configure network access for cloud sessions, see [Configure cloud environments](</docs/en/cloud-environments#network-access>). [Remote Control](</docs/en/remote-control>) 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#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. ## @@ -184,6 +184,7 @@ Related resources * [Security guidance plugin](</docs/en/security-guidance>): have Claude review and fix vulnerabilities in its own code changes during the session + * [`/security-review`](</docs/en/commands#all-commands>): run an on-demand security pass over the changes on your current branch * [Sandbox environments](</docs/en/sandbox-environments>): compare isolation approaches and choose one for your threat model * [Sandboxing](</docs/en/sandboxing>): filesystem and network isolation for Bash commands * [Permissions](</docs/en/permissions>): configure permissions and access controls
modified
--- a/security.md +++ b/security.md @@ -133,7 +133,7 @@ * **Audit logging** : All operations in cloud environments are logged for compliance and audit purposes * **Automatic cleanup** : Cloud environments are automatically terminated after session completion -For more details on cloud execution, see [Claude Code on the web](</docs/en/claude-code-on-the-web>). [Remote Control](</docs/en/remote-control>) 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 the same data that flows during any local Claude Code session travels through the Anthropic API over TLS. 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. +For more details on cloud execution, see [Claude Code on the web](</docs/en/claude-code-on-the-web>). [Remote Control](</docs/en/remote-control>) 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#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. ##
modified
--- a/security.md +++ b/security.md @@ -18,7 +18,7 @@ Permission-based architecture -Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. Claude Code requires approval before running Bash commands that can modify your system. A built-in set of read-only commands such as `ls`, `cat`, and `git status` runs without a prompt. This approach lets users and organizations configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). +Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. Claude Code requires approval before running Bash commands that can modify your system. A built-in set of [read-only commands](</docs/en/permissions#read-only-commands>) such as `ls`, `cat`, and `git status` runs without a prompt. This approach lets users and organizations configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). ### @@ -29,7 +29,7 @@ To mitigate risks in agentic systems: * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Enable with `/sandbox` to define boundaries where Claude Code can work autonomously - * **Write access restriction** : Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary + * **Working directory boundary** : Claude Code can only write to the folder where it was started and its subfolders, and cannot modify files in parent directories without explicit permission. Reading paths outside this boundary with the Read, Grep, and Glob tools is possible after an approval prompt. Extend the boundary with [additional directories](</docs/en/permissions#working-directories>) to skip the prompt, or restrict the broader read access available to read-only Bash commands with [sandbox `denyRead` rules](</docs/en/sandboxing#filesystem-isolation>), which apply only when sandboxing is enabled * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization * **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
modified
--- a/security.md +++ b/security.md @@ -18,7 +18,7 @@ Permission-based architecture -Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. We designed Claude Code to be transparent and secure. For example, we require approval for bash commands before executing them, giving you direct control. This approach enables users and organizations to configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). +Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. Claude Code requires approval before running Bash commands that can modify your system. A built-in set of read-only commands such as `ls`, `cat`, and `git status` runs without a prompt. This approach lets users and organizations configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). ### @@ -58,7 +58,7 @@ * **Permission system** : Sensitive operations require explicit approval * **Context-aware analysis** : Detects potentially harmful instructions by analyzing the full request * **Input sanitization** : Prevents command injection by processing user inputs - * **Command blocklist** : Blocks risky commands that fetch arbitrary content from the web like `curl` and `wget` by default. When explicitly allowed, be aware of [permission pattern limitations](</docs/en/permissions#tool-specific-permission-rules>) + * **Network command approval** : Commands that fetch content from the web such as `curl` and `wget` are not auto-approved by default. 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 block them entirely, add them to [`permissions.deny`](</docs/en/permissions#tool-specific-permission-rules>) ### @@ -83,12 +83,12 @@ * **Network request approval** : Tools that make network requests require user approval by default * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts * **Trust verification** : First-time codebase runs and new MCP servers require trust verification - * Note: Trust verification is disabled when running non-interactively with the `-p` flag. The exception is [`--worktree`](</docs/en/worktrees>), which still requires that trust has been accepted for the directory + * Note: Trust verification is disabled when running non-interactively with the `-p` flag * 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 * **Command injection detection** : Suspicious bash commands require manual approval even if previously allowlisted * **Fail-closed matching** : Unmatched commands default to requiring manual approval * **Natural language descriptions** : Complex bash commands include explanations for user understanding - * **Secure credential storage** : API keys and tokens are encrypted. See [Credential Management](</docs/en/authentication#credential-management>) + * **Secure credential storage** : API keys and tokens are stored in the macOS Keychain when available, and protected by file permissions on Windows and Linux. See [Credential Management](</docs/en/authentication#credential-management>) **Windows WebDAV security risk** : When running Claude Code on Windows, we recommend against enabling WebDAV or allowing Claude Code to access paths such as `\\*` that may contain WebDAV subdirectories. [WebDAV has been deprecated by Microsoft](<https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#:~:text=The%20Webclient%20\(WebDAV\)%20service%20is%20deprecated>) due to security risks. Enabling WebDAV may allow Claude Code to trigger network requests to remote hosts, bypassing the permission system.
modified
--- a/security.md +++ b/security.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - ## ​
modified
--- a/security.md +++ b/security.md @@ -189,6 +189,7 @@ Related resources + * [Security guidance plugin](</docs/en/security-guidance>): have Claude review and fix vulnerabilities in its own code changes during the session * [Sandbox environments](</docs/en/sandbox-environments>): compare isolation approaches and choose one for your threat model * [Sandboxing](</docs/en/sandboxing>): filesystem and network isolation for Bash commands * [Permissions](</docs/en/permissions>): configure permissions and access controls
modified
--- a/security.md +++ b/security.md @@ -189,8 +189,9 @@ Related resources - * [Sandboxing](</docs/en/sandboxing>) \- Filesystem and network isolation for bash commands - * [Permissions](</docs/en/permissions>) \- Configure permissions and access controls - * [Monitoring usage](</docs/en/monitoring-usage>) \- Track and audit Claude Code activity - * [Development containers](</docs/en/devcontainer>) \- Secure, isolated environments - * [Anthropic Trust Center](<https://trust.anthropic.com>) \- Security certifications and compliance + * [Sandbox environments](</docs/en/sandbox-environments>): compare isolation approaches and choose one for your threat model + * [Sandboxing](</docs/en/sandboxing>): filesystem and network isolation for Bash commands + * [Permissions](</docs/en/permissions>): configure permissions and access controls + * [Monitoring usage](</docs/en/monitoring-usage>): track and audit Claude Code activity + * [Development containers](</docs/en/devcontainer>): secure, isolated environments + * [Anthropic Trust Center](<https://trust.anthropic.com>): security certifications and compliance
modified
--- a/security.md +++ b/security.md @@ -90,6 +90,7 @@ * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts * **Trust verification** : First-time codebase runs and new MCP servers require trust verification * Note: Trust verification is disabled when running non-interactively with the `-p` flag. The exception is [`--worktree`](</docs/en/worktrees>), which still requires that trust has been accepted for the directory + * 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 * **Command injection detection** : Suspicious bash commands require manual approval even if previously allowlisted * **Fail-closed matching** : Unmatched commands default to requiring manual approval * **Natural language descriptions** : Complex bash commands include explanations for user understanding
modified
--- a/security.md +++ b/security.md @@ -113,7 +113,7 @@ MCP security -Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control. We 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 does not manage or audit any MCP servers. +Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control. We 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. ##
modified
--- a/security.md +++ b/security.md @@ -89,7 +89,7 @@ * **Network request approval** : Tools that make network requests require user approval by default * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts * **Trust verification** : First-time codebase runs and new MCP servers require trust verification - * Note: Trust verification is disabled when running non-interactively with the `-p` flag + * Note: Trust verification is disabled when running non-interactively with the `-p` flag. The exception is [`--worktree`](</docs/en/worktrees>), which still requires that trust has been accepted for the directory * **Command injection detection** : Suspicious bash commands require manual approval even if previously allowlisted * **Fail-closed matching** : Unmatched commands default to requiring manual approval * **Natural language descriptions** : Complex bash commands include explanations for user understanding
modified
--- a/security.md +++ b/security.md @@ -37,7 +37,7 @@ * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Enable with `/sandbox` to define boundaries where Claude Code can work autonomously * **Write access restriction** : Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization - * **Accept Edits mode** : Batch accept multiple edits while maintaining permission prompts for commands with side effects + * **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 ###
modified
--- a/security.md +++ b/security.md @@ -1,3 +1,9 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + ## ​
modified
--- a/security.md +++ b/security.md @@ -148,7 +148,7 @@ * Review all suggested changes before approval * Use project-specific permission settings for sensitive repositories - * Consider using [devcontainers](</docs/en/devcontainer>) for additional isolation + * Consider using [dev containers](</docs/en/devcontainer>) for additional isolation * Regularly audit your permission settings with `/permissions` ### @@ -172,7 +172,7 @@ If you discover a security vulnerability in Claude Code: 1. Do not disclose it publicly - 2. Report it through our [HackerOne program](<https://hackerone.com/anthropic-vdp/reports/new?type=team&report_type=vulnerability>) + 2. Report it through our [HackerOne program](<https://hackerone.com/4f1f16ba-10d3-4d09-9ecc-c721aad90f24/embedded_submissions/new>) 3. Include detailed reproduction steps 4. Allow time for us to address the issue before public disclosure
added
Show diff (192 lines)
--- a/security.md +++ b/security.md @@ -0,0 +1,189 @@ +## + +​ + +How we approach security + +### + +​ + +Security foundation + +Your code’s security is paramount. Claude Code is built with security at its core, developed according to Anthropic’s comprehensive security program. Learn more and access resources (SOC 2 Type 2 report, ISO 27001 certificate, etc.) at [Anthropic Trust Center](<https://trust.anthropic.com>). + +### + +​ + +Permission-based architecture + +Claude Code uses strict read-only permissions by default. When additional actions are needed (editing files, running tests, executing commands), Claude Code requests explicit permission. Users control whether to approve actions once or allow them automatically. We designed Claude Code to be transparent and secure. For example, we require approval for bash commands before executing them, giving you direct control. This approach enables users and organizations to configure permissions directly. For detailed permission configuration, see [Permissions](</docs/en/permissions>). + +### + +​ + +Built-in protections + +To mitigate risks in agentic systems: + + * **Sandboxed bash tool** : [Sandbox](</docs/en/sandboxing>) bash commands with filesystem and network isolation, reducing permission prompts while maintaining security. Enable with `/sandbox` to define boundaries where Claude Code can work autonomously + * **Write access restriction** : Claude Code can only write to the folder where it was started and its subfolders—it cannot modify files in parent directories without explicit permission. While Claude Code can read files outside the working directory (useful for accessing system libraries and dependencies), write operations are strictly confined to the project scope, creating a clear security boundary + * **Prompt fatigue mitigation** : Support for allowlisting frequently used safe commands per-user, per-codebase, or per-organization + * **Accept Edits mode** : Batch accept multiple edits while maintaining permission prompts for commands with side effects + +### + +​ + +User responsibility + +Claude Code only has the permissions you grant it. You’re responsible for reviewing proposed code and commands for safety before approval. + +## + +​ + +Protect against prompt injection + +Prompt injection is a technique where an attacker attempts to override or manipulate an AI assistant’s instructions by inserting malicious text. Claude Code includes several safeguards against these attacks: + +### + +​ + +Core protections + + * **Permission system** : Sensitive operations require explicit approval + * **Context-aware analysis** : Detects potentially harmful instructions by analyzing the full request + * **Input sanitization** : Prevents command injection by processing user inputs + * **Command blocklist** : Blocks risky commands that fetch arbitrary content from the web like `curl` and `wget` by default. When explicitly allowed, be aware of [permission pattern limitations](</docs/en/permissions#tool-specific-permission-rules>) + +### + +​ + +Privacy safeguards + +We have implemented several safeguards to protect your data, including: + + * Limited retention periods for sensitive information (see the [Privacy Center](<https://privacy.anthropic.com/en/articles/10023548-how-long-do-you-store-my-data>) to learn more) + * Restricted access to user session data + * User control over data training preferences. Consumer users can change their [privacy settings](<https://claude.ai/settings/privacy>) at any time. + +For full details, please review our [Commercial Terms of Service](<https://www.anthropic.com/legal/commercial-terms>) (for Team, Enterprise, and API users) or [Consumer Terms](<https://www.anthropic.com/legal/consumer-terms>) (for Free, Pro, and Max users) and [Privacy Policy](<https://www.anthropic.com/legal/privacy>). + +### + +​ + +Additional safeguards + + * **Network request approval** : Tools that make network requests require user approval by default + * **Isolated context windows** : Web fetch uses a separate context window to avoid injecting potentially malicious prompts + * **Trust verification** : First-time codebase runs and new MCP servers require trust verification + * Note: Trust verification is disabled when running non-interactively with the `-p` flag + * **Command injection detection** : Suspicious bash commands require manual approval even if previously allowlisted + * **Fail-closed matching** : Unmatched commands default to requiring manual approval + * **Natural language descriptions** : Complex bash commands include explanations for user understanding + * **Secure credential storage** : API keys and tokens are encrypted. See [Credential Management](</docs/en/authentication#credential-management>) + +**Windows WebDAV security risk** : When running Claude Code on Windows, we recommend against enabling WebDAV or allowing Claude Code to access paths such as `\\*` that may contain WebDAV subdirectories. [WebDAV has been deprecated by Microsoft](<https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#:~:text=The%20Webclient%20\(WebDAV\)%20service%20is%20deprecated>) due to security risks. Enabling WebDAV may allow Claude Code to trigger network requests to remote hosts, bypassing the permission system. + +**Best practices for working with untrusted content** : + + 1. Review suggested commands before approval + 2. Avoid piping untrusted content directly to Claude + 3. Verify proposed changes to critical files + 4. Use virtual machines (VMs) to run scripts and make tool calls, especially when interacting with external web services + 5. Report suspicious behavior with `/feedback` + +While these protections significantly reduce risk, no system is completely immune to all attacks. Always maintain good security practices when working with any AI tool. + +## + +​ + +MCP security + +Claude Code allows users to configure Model Context Protocol (MCP) servers. The list of allowed MCP servers is configured in your source code, as part of Claude Code settings engineers check into source control. We 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 does not manage or audit any MCP servers. + +## + +​ + +IDE security + +See [VS Code security and privacy](</docs/en/vs-code#security-and-privacy>) for more information on running Claude Code in an IDE. + +## + +​ + +Cloud execution security + +When using [Claude Code on the web](</docs/en/claude-code-on-the-web>), additional security controls are in place: + + * **Isolated virtual machines** : Each cloud session runs in an isolated, Anthropic-managed VM + * **Network access controls** : Network access is limited by default and can be configured to be disabled or allow only specific domains + * **Credential protection** : Authentication is handled through a secure proxy that uses a scoped credential inside the sandbox, which is then translated to your actual GitHub authentication token + * **Branch restrictions** : Git push operations are restricted to the current working branch + * **Audit logging** : All operations in cloud environments are logged for compliance and audit purposes + * **Automatic cleanup** : Cloud environments are automatically terminated after session completion + +For more details on cloud execution, see [Claude Code on the web](</docs/en/claude-code-on-the-web>). [Remote Control](</docs/en/remote-control>) 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 the same data that flows during any local Claude Code session travels through the Anthropic API over TLS. 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. + +## + +​ + +Security best practices + +### + +​ + +Working with sensitive code + + * Review all suggested changes before approval + * Use project-specific permission settings for sensitive repositories + * Consider using [devcontainers](</docs/en/devcontainer>) for additional isolation + * Regularly audit your permission settings with `/permissions` + +### + +​ + +Team security + + * Use [managed settings](</docs/en/settings#settings-files>) to enforce organizational standards + * Share approved permission configurations through version control + * Train team members on security best practices + * Monitor Claude Code usage through [OpenTelemetry metrics](</docs/en/monitoring-usage>) + * Audit or block settings changes during sessions with [`ConfigChange` hooks](</docs/en/hooks#configchange>) + +### + +​ + +Reporting security issues + +If you discover a security vulnerability in Claude Code: + + 1. Do not disclose it publicly + 2. Report it through our [HackerOne program](<https://hackerone.com/anthropic-vdp/reports/new?type=team&report_type=vulnerability>) + 3. Include detailed reproduction steps + 4. Allow time for us to address the issue before public disclosure + +## + +​ + +Related resources + + * [Sandboxing](</docs/en/sandboxing>) \- Filesystem and network isolation for bash commands + * [Permissions](</docs/en/permissions>) \- Configure permissions and access controls + * [Monitoring usage](</docs/en/monitoring-usage>) \- Track and audit Claude Code activity + * [Development containers](</docs/en/devcontainer>) \- Secure, isolated environments + * [Anthropic Trust Center](<https://trust.anthropic.com>) \- Security certifications and compliance