許可プロンプトを超えて:Claude Codeのセキュリティと自律性を向上
Claude Codeの新しいサンドボックス機能により、ファイルシステムとネットワークの分離を実現し、許可プロンプトを減らしながらユーザーの安全性を高めています。
キーポイント
Claude Codeにサンドボックス機能を導入し、ファイルシステム分離とネットワーク分離の2つの境界を設定
サンドボックス化により、許可プロンプトを84%削減し、開発効率と安全性を両立
プロンプトインジェクション攻撃への対策として、機密ファイル改変や情報漏洩を防止
サンドボックス化されたbashツールとWeb版Claude Codeの2つの新機能を提供
開発者の承認疲労を軽減し、より自律的で安全なAI支援開発環境を実現
影響分析・編集コメントを表示
影響分析
この記事は、AI支援開発ツールのセキュリティと自律性を両立させる画期的なアプローチを示しており、プロンプトインジェクション対策として業界標準となる可能性がある。開発効率とセキュリティのトレードオフを解決することで、AIツールの実用性と信頼性を大幅に向上させる重要な進展である。
編集コメント
AI開発ツールのセキュリティ対策が具体的な技術実装として示された点で、業界の成熟度を示す重要なマイルストーンと言える。
Anthropic、Claude Codeのセキュリティと自律性を向上させる新機能「サンドボックス」を導入
Anthropicは、AIコードアシスタント「Claude Code」のセキュリティを強化し、ユーザーの作業効率を高めるため、新たな「サンドボックス」機能を基盤とした2つの機能を発表した。これにより、許可プロンプトの表示を大幅に削減しながら、より安全で自律的な開発環境を実現する。
背景:パーミッションモデルの課題
Claude Codeはデフォルトで読み取り専用モードであり、コードの変更やコマンド実行の前にユーザーの許可を求める。安全なコマンド(例: echo, cat)は自動許可されるが、多くの操作では明示的な承認が必要であった。この頻繁な「承認」クリックは開発サイクルを遅らせ、「承認疲れ」を引き起こし、ユーザーが承認内容を注意深く確認しなくなる可能性があり、かえって安全性を損なうリスクがあった。
解決策:サンドボックスによる境界の定義
新たに導入されたサンドボックス機能は、個々のアクションごとに許可を求める代わりに、事前に定義された境界(バウンダリー)内でClaudeが自由に作業できるようにする。このアプローチにより、内部使用では許可プロンプトが84%安全に削減された。サンドボックスの核心は、オペレーティングシステムレベルの機能を利用した以下の2つの隔離にある。
- ファイルシステム隔離:Claudeがアクセスまたは変更できるディレクトリを特定の範囲に制限する。これにより、プロンプトインジェクション攻撃を受けたClaudeが機密性の高いシステムファイルを改ざんするのを防ぐ。
- ネットワーク隔離:Claudeの接続を承認済みのサーバーのみに制限する。これにより、機密情報の流出やマルウェアのダウンロードを防止する。
両方の隔離を組み合わせることで初めて効果的なサンドボックスが成立する。ネットワーク隔離がなければ、侵害されたエージェントがSSHキーなどの機密ファイルを外部に送信できてしまう。逆にファイルシステム隔離がなければ、エージェントが簡単にサンドボックスを脱出しネットワークにアクセスする可能性がある。この二重の保護により、安全性と高速性を両立した「エージェント体験」を提供する。
具体的な新機能
- サンドボックス化されたbashツール:この新しいサンドボックスランタイム内では、Claudeが許可プロンプトなしでbashコマンドを安全に実行できるようになる。
- Web版Claude Codeのサンドボックス:ウェブブラウザ上で動作するClaude Codeにも同様のサンドボックス環境を導入し、ローカル環境と同等のセキュリティ境界を提供する。
これらの機能は、開発者がプロンプトインジェクションなどのリスクを軽減しつつ、Claudeによるコードの記述、テスト、デバッグ、複数ファイルの編集、コマンド実行といった作業を、中断されることなく円滑に進められるように設計されている。Anthropicは、許可プロンプトの削減と強固なセキュリティ境界の設定を通じて、ユーザーの安全性
原文を表示
Engineering at AnthropicBeyond permission prompts: making Claude Code more secure and autonomous
Claude Code's new sandboxing features, a bash tool and Claude Code on the web, reduce permission prompts and increase user safety by enabling two boundaries: filesystem and network isolation.
In Claude Code, Claude writes, tests, and debugs code alongside you, navigating your codebase, editing multiple files, and running commands to verify its work. Giving Claude this much access to your codebase and files can introduce risks, especially in the case of prompt injection.
To help address this, we’ve introduced two new features in Claude Code built on top of sandboxing, both of which are designed to provide a more secure place for developers to work, while also allowing Claude to run more autonomously and with fewer permission prompts. In our internal usage, we've found that sandboxing safely reduces permission prompts by 84%. By defining set boundaries within which Claude can work freely, they increase security and agency.
Keeping users secure on Claude Code
Claude Code runs on a permission-based model: by default, it's read-only, which means it asks for permission before making modifications or running any commands. There are some exceptions to this: we auto-allow safe commands like echo or cat, but most operations still need explicit approval.
Constantly clicking "approve" slows down development cycles and can lead to ‘approval fatigue’, where users might not pay close attention to what they're approving, and in turn making development less safe.
To address this, we launched sandboxing for Claude Code.
Sandboxing: a safer and more autonomous approach
Sandboxing creates pre-defined boundaries within which Claude can work more freely, instead of asking for permission for each action. With sandboxing enabled, you get drastically fewer permission prompts and increased safety.
Our approach to sandboxing is built on top of operating system-level features to enable two boundaries:
Filesystem isolation, which ensures that Claude can only access or modify specific directories. This is particularly important in preventing a prompt-injected Claude from modifying sensitive system files.
Network isolation, which ensures that Claude can only connect to approved servers. This prevents a prompt-injected Claude from leaking sensitive information or downloading malware.
It is worth noting that effective sandboxing requires both filesystem and network isolation. Without network isolation, a compromised agent could exfiltrate sensitive files like SSH keys; without filesystem isolation, a compromised agent could easily escape the sandbox and gain network access. It’s by using both techniques that we can provide a safer and faster agentic experience for Claude Code users.
Two new sandboxing features in Claude Code
Sandboxed bash tool: safe bash execution without permission prompts
We're introducing a new sandbox runtime, available in beta as a research preview, that lets you define exactly which directories and network hosts your agent can access, without the overhead of spinning up and managing a container. This can be used to sandbox arbitrary processes, agents and MCP servers. It is also available as an open source research preview.
In Claude Code, we use this runtime to sandbox the bash tool, which allows Claude to run commands within the defined limits you set. Inside the safe sandbox, Claude can run more autonomously and safely execute commands without permission prompts. If Claude tries to access something outside of the sandbox, you'll be notified immediately, and can choose whether or not to allow it.
We’ve built this on top of OS level primitives such as Linux bubblewrap and MacOS seatbelt to enforce these restrictions at the OS level. They cover not just Claude Code's direct interactions, but also any scripts, programs, or subprocesses that are spawned by the command.As described above, this sandbox enforces both:
Filesystem isolation, by allowing read and write access to the current working directory, but blocking the modification of any files outside of it.
Network isolation, by only allowing internet access through a unix domain socket connected to a proxy server running outside the sandbox. This proxy server enforces restrictions on the domains that a process can connect to, and handles user confirmation for newly requested domains. And if you’d like further-increased security, we also support customizing this proxy to enforce arbitrary rules on outgoing traffic.
Both components are configurable: you can easily choose to allow or disallow specific file paths or domains.
Sandboxing ensures that even a successful prompt injection is fully isolated, and cannot impact overall user security. This way, a compromised Claude Code can't steal your SSH keys, or phone home to an attacker's server.
To get started with this feature, run /sandbox in Claude Code and
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み