Security - Claude Code Docs (original) (raw)

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.

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.

Built-in protections

To mitigate risks in agentic systems:

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

Privacy safeguards

We have implemented several safeguards to protect your data, including:

For full details, please review our Commercial Terms of Service (for Team, Enterprise, and API users) or Consumer Terms (for Free, Pro, and Max users) and Privacy Policy.

Additional safeguards

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

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 before adding them to the Anthropic Directory, but does not security-audit or manage any MCP server.

IDE security

See 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, additional security controls are in place:

For more details on cloud execution, see Claude Code on the web. 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

Team security

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
  3. Include detailed reproduction steps
  4. Allow time for us to address the issue before public disclosure