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.4k
Other Decks in Technology
See All in Technology
Databricksメトリクスビューはじめてのもくもく会
taka_aki
0
140
AWS FinOps Agent 結局何が得意なの?
siromi
0
220
OpenClawでAzure DevOpsのWiki更新を自動化する - クラウドAIだけでは届かない場所へ
yutakaosada
0
130
Amazon Bedrock Agents ClassicからAmazon Bedrock AgentCoreへ移行した際、ガードレール設定が2箇所に割れた話
matsunobu
0
160
AWS DevOps Agent スキルをつかいこなそう / Master AWS DevOps Agent Skills
kinunori
2
640
セルフサービスのオブザーバビリティ基盤をOpenTelemetryで作る / Building a Self-Service Observability Platform with OpenTelemetry
ymotongpoo
3
480
1人アドミンな私はAWSアカウント申請をSlackで完結したい!
ysuzuki
0
100
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
5
1.8k
高負荷プロダクション環境におけるAWS Lambdaのリアル 〜スケールとコストを左右する実行ライフサイクルの技術仕様〜
maimyyym
2
830
メルカリにおけるAI時代の高速プロトタイピング基盤「Arca」
ryotarai
18
13k
VS Code × GitHub Copilot での Fabric 開発
ryomaru0825
1
180
AWS App Runnerから Cloudflare Workersへ移行した話
ryota09
0
110
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Odyssey Design
rkendrick25
PRO
2
840
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
550
Site-Speed That Sticks
csswizardry
13
1.5k
Utilizing Notion as your number one productivity tool
mfonobong
4
600
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.2k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
290
Joys of Absence: A Defence of Solitary Play
codingconduct
1
530
Tell your own story through comics
letsgokoyo
1
1.1k
Claude Code のすすめ
schroneko
67
230k
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