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
tomoki10
June 16, 2026
Technology
1.2k
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.5k
re:Invent2025 3つの Frontier Agents を紹介 / introducing-3-frontier-agents
tomoki10
0
1.4k
AWS Security Agentの紹介/introducing-aws-security-agent
tomoki10
0
1.8k
Kiro Autonomous AgentとKiro Powers の紹介 / kiro-autonomous-agent-and-powers
tomoki10
0
2.1k
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.5k
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
2
5.3k
Other Decks in Technology
See All in Technology
Harness Engineering on Rails
joelq
0
220
JSONataとAWS Step Functionsで目指すRuntimelessな世界
mu7889yoon
0
460
人間はどの意思決定を手放せるのか
kawasima
15
8.1k
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
170
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.9k
ほんとうの信頼性はヒーローが死んでからはじまる / True reliability begins after the hero dies
vtryo
0
120
時うどん〜Socket.getifaddrsで学ぶネットワーク編 / Tokiudon: The Socket.getifaddrs Edition
coe401_
4
250
今話題のAI「Jev」って何? 宇宙最速で学ぶ会
minorun365
PRO
32
21k
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
11
6.6k
え、こんなに早く改修できるの?──新人エンジニアとスクラムマスターの2人が語る、AI×アジャイル開発の現場
ysasago
2
700
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
1
110
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
20k
Featured
See All Featured
How GitHub (no longer) Works
holman
316
150k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
700
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
260
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
WENDY [Excerpt]
tessaabrams
14
39k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
710
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
30 Presentation Tips
portentint
PRO
1
400
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
250
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
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