Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Claude Code の Sandbox 機能を Anthropic Sandbox Run...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
tomoki10
June 16, 2026
Technology
1.3k
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.6k
re:Invent2025 3つの Frontier Agents を紹介 / introducing-3-frontier-agents
tomoki10
0
1.4k
AWS Security Agentの紹介/introducing-aws-security-agent
tomoki10
0
1.9k
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
2.2k
CDK Vibe Coding Fes
tomoki10
1
1.1k
cdk initで生成されるあのファイル達は何なのか/cdk-init-generated-files
tomoki10
1
1.8k
Devin(Deep) Wiki/Searchの活用で変わる開発の世界観/devin-wiki-search-impact
tomoki10
1
4.3k
AI駆動で進化する開発プロセス ~クラスメソッドでの実践と成功事例~ / aidd-in-classmethod
tomoki10
2
5.6k
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
2
5.5k
Other Decks in Technology
See All in Technology
FOSS4Gを活用した自治体業務DXの試み
470715
0
150
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
140
Cognition AI Japan - ウェビナー2_テストQA_運用監視
cogakira
0
140
Datadog の学び方 - あるいは、オブザーバビリティを学ぶとは何か
mananyuki
1
550
継続的なAIコスト最適化
bgpat
1
290
AI時代のPRレビューにどう向き合うか?
kairim0
1
210
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
0
240
無理せず続ける、子育てエンジニアの学び
codmoninc
PRO
0
710
[AWS 秋のクラウドオペレーション祭り 2026]AWS DevOps Agentで変わるリリースと運用対応 ~リリース管理機能と Directed actions のご紹介~
furuton
4
1.2k
今こそ知りたいAmplifyGen2
mkdev10
2
160
不可逆な意思決定を避けながら10億超の顧客データを AI Ready にするデータ基盤設計
baseballyama
1
310
OSC2026on_the-world-is-waiting-for-your-voice.pdf
naruoga
0
370
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
800
GraphQLとの向き合い方2022年版
quramy
50
15k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
620
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.3k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
30 Presentation Tips
portentint
PRO
1
430
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
460
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
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