Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Claude Code の Sandbox 機能を Anthropic Sandbox Run...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
tomoki10
June 16, 2026
Technology
850
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Claude Code の Sandbox 機能を Anthropic Sandbox Runtime(srt) で試そう!/lets-play-anthropic-sandbox-runtime
Claude Code Meetup #6 で登壇した内容です。
https://aid.connpass.com/event/394427/
tomoki10
June 16, 2026
More Decks by tomoki10
See All by tomoki10
チームで安全にClaude Codeを利用するためのプラクティス / team-claude-code-practices
tomoki10
7
5.3k
re:Invent2025 3つの Frontier Agents を紹介 / introducing-3-frontier-agents
tomoki10
0
1.3k
AWS Security Agentの紹介/introducing-aws-security-agent
tomoki10
0
1.6k
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
2k
CDK Vibe Coding Fes
tomoki10
1
1.1k
cdk initで生成されるあのファイル達は何なのか/cdk-init-generated-files
tomoki10
1
1.7k
Devin(Deep) Wiki/Searchの活用で変わる開発の世界観/devin-wiki-search-impact
tomoki10
1
4.1k
AI駆動で進化する開発プロセス ~クラスメソッドでの実践と成功事例~ / aidd-in-classmethod
tomoki10
2
5.2k
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
2
4.9k
Other Decks in Technology
See All in Technology
ここは地獄!つらい朝会を体験することで、チームとしてのより良い振る舞いに気づくワークショップ / The stand-up meeting from hell in the game industry
scrummasudar
0
440
ソフトウェアアーキテクチャ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
1k
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
150
書籍セキュアAPIについて
riiimparm
0
390
最高のシステムプロンプトを作るためにフィードバック機能を導入した話
alchemy1115
1
230
AIがコードを書く時代、人間は何を保証するのか———馬場さんと考える、開発者に求められる新しい責任と価値 - TECH PLAY
netmarkjp
0
330
テックカンファレンス三大ステークホルダーの文化人類学 ─ 違いを認め合う関係性作り
bash0c7
4
1.1k
PLaMoを毎日の開発で使い育てていく
pfn
PRO
0
110
もう一度考える SRE チームの作り方・育て方 / Rethinking SRE #1: Building and Growing SRE Teams
rrreeeyyy
1
130
Power Automateアップデート情報
miyakemito
0
280
『モンスターストライク』 の運営に伴走する! データ民主化への 解析グループの3つのアプローチ
mixi_engineers
PRO
0
180
セキュリティ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
31
26k
Featured
See All Featured
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
230
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Six Lessons from altMBA
skipperchong
29
4.4k
A Soul's Torment
seathinner
6
3.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
480
Tell your own story through comics
letsgokoyo
1
1k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
400
Rails Girls Zürich Keynote
gr2m
96
14k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
520
For a Future-Friendly Web
brad_frost
183
10k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Transcript
Claude Code の Sandbox機能を Anthropic Sandbox Runtime (srt) で 試そう!
Claude Code Meetup Japan #6 佐藤智樹 / 2026年6月16日
アカウント X : tmk2154 GitHub : tomoki10 2020年 入社 バックエンドエンジニア IoT宅配ボックス、工場IoTなどIoTシス
テムのバックエンド、インフラ構築に従 事 2023年 テクニカルマネージャー 部署内全体技術力向上のため施策実施 2025年 テクニカルマネージャー AI駆動開発など生成AIを活用した生産性 向上を目的として活動 自己紹介 2
非決定論的な挙動に疲れていませんか? 3
決定論的な挙動に、癒されよう 4
ファイルシステム:書き込みは既定で全拒否、読み込みは既定で許可 allowWrite / denyWrite / allowRead / denyRead で調整 .bashrc
, .zshrc , .gitconfig , .git/hooks/ , .vscode/ , .claude/ などへの書き 込みは常に保護 ネットワーク:全通信をプロキシ経由にして既定で遮断 allowedDomains でドメインを許可制に指定(ワイルドカード可) HTTP通信とそれ以外のTCP通信を別々に制御 コマンド実行:Sandbox内は自動許可、外は許可フローへフォールバック macOSはSeatbelt、Linuxはbubblewrapで隔離 Sandboxで制御できる3つの範囲 5
Claude Code や Claude Cowork などの Sandbox 機能だけを使える機能 このSandboxの仕組みは srt
としてOSS公開 https://github.com/anthropic-experimental/sandbox-runtime 正式名称は @anthropic-ai/sandbox-runtime コンテナ不要でOSレベルにファイルシステムとネットワークを制限 ルートファイルシステムの読み取りはデフォルトで可能 ツール・ランタイムコマンド実行のため? エージェントによる破壊(書き込み)を防ぐことを重視? Anthropic Sandbox Runtime (srt)とは 6
任意のコマンドを1行でsrtを通して実行可能 % npm install -g @anthropic-ai/sandbox-runtime % srt -c "curl
anthropic.com" 設定は2パターンで可能 ~/.srt-settings.json :全体でデフォルトで適用 コマンド実行時に設定ファイルを指定 % srt --settings ./srt-settings.json -c "ls -l /hoge" プロジェクト単位でファイルを作成して、CLI実行時の保護もまとめて可能 srtを単体で使う方法 7
ホームディレクトリ配下で、プロジェクト外を保護 { "filesystem": { "allowWrite": ["."], "denyRead": ["~/"] } }
カレントディレクトリ配下だけ書き込み可。 .claude や .gitconfig も自動保護 % srt -c "ls -l ~/.aws" total 0 ls: /Users/hoge/.aws: Operation not permitted % srt -c "ls -l" total 8 -rw-r--r-- 1 hoge staff 277 Jun 16 15:50 srt-settings.json % srt -c "touch zzz.txt" % ls -l ... -rw-r--r-- 1 hoge staff 0 Jun 16 18:04 zzz.txt 動作例①ファイルシステム制御 8
通信先のドメインをallowlistで制御 { "network": { "allowedDomains": ["github.com", "*.github.com", "*.npmjs.org"] } }
許可したドメイン以外への通信はブロック ドメインとサブドメインは別途指定が必要 # 上記の設定なし % srt -c "curl https://github.com" curl: (56) CONNECT tunnel failed, response 403 # 上記の設定あり( ステータスコードのみ出力) % srt -c "curl -o /dev/null -s -w "%{http_code}" https://github.com" 200 動作例②ネットワーク制御 9
Claude Code 内部でSandbox機能を使う場合の話 コマンド実行の許可は、2つのモードから選択可能 Auto-allow:Sandbox内は自動許可、外はフォールバック Regular permissions:従来どおり都度確認 デフォルトで設定を固定する方法 設定キーは autoAllowBashIfSandboxed
、既定でtrue。承認疲れを減らしつつ、危険な操 作はAutoモードと合わせて停止可能 動作例③コマンド実行の許可方式 10
MCPサーバからホストのファイルシステムやネットワークへのアクセスを制限して実行可能 { "mcpServers": { "drawio": { "command": "srt", "args": ["npx",
"-y", "@drawio/mcp"] } } } commandを srt にするだけで、ファイルとネットワークへのアクセスを制限可能 以下は例として書いてもらったAWS構成図。不要な権限を絞ってMCPを利用可能 実はMCPサーバやスキル経由のCLI利用もラップ可能 11
Claude Codeの内部機能としてSandboxを使う場合の注意 ReadやEditなどのClaude Code内蔵ツールはSandboxの対象外 これらはサブプロセスではなく、Claude Code内部で動作するため Sandboxで読み込み禁止でも、Readツールは許可ダイアログ経由で読み取り可能 内蔵ツールはPermissions(allow / deny)で別途制御が必要
{ "$schema": "https://json.schemastore.org/claude-code-settings.json", "permissions": { "allow": [ "WebFetch(domain:github.com)" ] }, "sandbox": { "enabled": true, "network": { "allowedDomains": [ "github.com", "*.github.com" ] } } } 注意:Claude Code 内部の Sandbox の範囲 12
以前公開した記事 [Claude CodeのSandbox機能を改めて整理してみた] https://dev.classmethod.jp/articles/claude-code-sandbox-202604/ より詳細に解説された記事 [生成AIを使ったソフトウェア開発におけるセキュリティの問題点について整理してみた] https://dev.classmethod.jp/articlessecurity-on-software-development-with- generative-ai/ 参考情報とその他 13
SandboxはAIエージェントに決定論的な境界を付与可能 Sandboxの仕組みは srt としてOSS化され、単体でも利用可能 ファイルシステム・ネットワーク・コマンド実行を制御可能 ただし内蔵ツールは範囲外、Permissionsとの併用が必要 決定論的挙動に癒されよう!! まとめ 14
実践的なワークショップや伴走支援も実施中!支援実績数10社以上! https://classmethod.jp/services/aidd/ 宣伝1: AI駆動開発の支援やってます! 15
宣伝2: AWS CDK Conference 2026 開催します! 16