LangSmithサンドボックスの紹介:エージェント向けの安全なコード実行環境
LangChain社はLangSmith Sandboxesを発表し、エージェントが安全にコードを実行できる隔離環境を提供することで、AIエージェントの実用性と安全性を向上させる
キーポイント
安全なコード実行環境の提供
LangSmith Sandboxesは、AIエージェントが信頼できないコードを安全に実行できる隔離環境を提供し、ローカル環境への悪影響を防ぐ
既存プラットフォームとの統合
LangSmith SDKとインフラを活用しており、既存のLangSmithユーザーは追加の設定なしでサンドボックスを利用できる
実用的なユースケースの提示
コードアシスタント、CIスタイルのエージェント、データ分析エージェントなど、具体的な活用例を示している
リソース管理とカスタマイズ性
CPU、メモリ、ディスク使用量の制限が可能で、独自のDockerイメージを使用した環境カスタマイズもサポートしている
影響分析・編集コメントを表示
影響分析
この発表は、AIエージェントが実際のコード実行能力を持つことで、より実用的なアプリケーション開発が可能になることを示している。特に、エージェントの安全性と信頼性を確保するためのインフラストラクチャー提供は、業界全体の実用化を加速させる可能性がある。
編集コメント
AIエージェントの実用化における重要なインフラ課題を解決する製品発表。特に、コード実行時の安全性確保は業界全体の関心事であり、今後の展開が注目される。
image本日、LangSmith Sandboxesをプライベートプレビューとして公開します。これは、信頼できないコードを実行するための、安全でスケーラブルな環境です。
エージェントは、コードを実行できるようになると、はるかに有用性が高まります。データを分析し、APIを呼び出し、ゼロからアプリケーションを構築できるようになります。しかし、LLMにインフラから隔離されずに任意のコードを実行させることは危険です。サンドボックスは、エージェントが安全にコードを実行できる、一時的で厳格に制限された環境を提供します。アクセス可能なものと消費できるリソースを制御できます。
LangSmith Sandboxesでは、LangSmith SDKを使って1行のコードでサンドボックスを起動できます。APIキーを追加し、SDKをインポートするだけで準備完了です。
私たちはOpen SWEのようなプロジェクトを推進するため、内部でSandboxesを利用してきました。今回、同じ基盤技術を使って構築できるよう、皆様に提供することにしました。
ウェイトリストに登録する
なぜサンドボックスが必要なのか?
Cursor、Claude Code、OpenClawなどのコーディングエージェントは、エージェントにコードを書いて実行する能力を与えることの有用性を実証しています。しかし、隔離環境がなければ、エージェントはローカル環境で破壊的または悪意のあるアクションを実行する可能性があります。
従来のコンテナは、既知の、審査済みのアプリケーションコードを実行するために設計されていました。エージェントが生成するコードは異なります。信頼できず、予測不可能です。Webサーバーは既知の操作のセットを処理しますが、エージェントは悪意のあるコマンドを含め、あらゆることを試みる可能性があります。
安全なコード実行環境を独自に構築する場合、通常はコンテナを起動し、ネットワークアクセスを制限し、出力をエージェントに戻し、完了後にはすべてを解体することを意味します。さらに、リソース制限の対応も必要です。コードを実行するエージェントは、制約がなければCPU、メモリ、ディスクを急速に消費する可能性があるからです。より多くのエージェントがコーディングを行うようになるにつれ、この問題はより深刻になります。
このような環境が必要とされるワークロードの例をいくつか挙げます:
- 応答する前に自身の出力を実行して検証するコーディングアシスタント
- PRを開く前にリポジトリをクローンし、依存関係をインストールし、テストスイートを実行するCIスタイルのエージェント(Open SWEのような)
- データセットに対してPythonスクリプトを実行し結果を返すデータ分析エージェント
LangSmithプラットフォームの一部として
LangSmith Sandboxesは、LangSmithの他のコンポーネントと同じSDKとインフラを使用します。トレーシングやデプロイのためにPythonまたはJavaScriptクライアントを既に使用している場合、新たに何かを追加することなくサンドボックスを起動できます。
SandboxesはLangSmith Deploymentと直接統合されているため、エージェントスレッドにサンドボックスをアタッチできます。また、LangChainのDeep AgentsオープンソースフレームワークやOpen SWEとのネイティブ統合も備えています。
提供する機能
ランタイム設定
- 独自のDockerイメージの使用: デフォルトのイメージを使用するか、独自のプライベートレジストリを指定できます。必要なファイルシステムとツールを備えた状態で各サンドボックスを開始します。
- サンドボックステンプレート: イメージ、CPU、メモリ設定を一度定義すれば、サンドボックスを起動するたびに再利用できます。BYODイメージと組み合わせることで、完全にカスタマイズされた環境を実現します。
- 共有アクセス: 複数のエージェントが同じサンドボックスにアクセスできるため、隔離された環境間で成果物を転送する必要がありません。
- プーリングとオートスケーリング: ウォームなサンドボックスのプールを事前に準備し、エージェントがコールドスタートを待たずに済むようにします。需要の増加に応じて、追加のサンドボックスが自動的に起動します。
実行
- 長時間実行セッション: 数分または数時間かかるエージェントタスクもタイムアウトしません。SandboxesはWebSocketを介した永続的なコマンド実行をサポートし、実行中の状況を確認できるリアルタイムの出力ストリーミングを提供します。
- インタラクションを超えた永続的な状態: エージェントは、コンテキストを失うことなく、複数のスレッドで同じサンドボックスを使用できます。ファイル、インストールされたパッケージ、環境状態は実行間で保持されます。
- トンネル: サンドボックスのポートをローカルマシンに公開し、デプロイ前にエージェントの出力をプレビューできます。
SDKと統合
- フレームワーク非依存: LangChain OSS、他のフレームワーク、あるいはフレームワークを全く使わずにLangSmith Sandboxesを利用できます。
- PythonおよびJavaScript SDK: LangSmith SDKによる、両言語でのファーストクラスクライアントを提供します。
- Deep Agents統合: 最小限の設定で、サンドボックスをエージェントのワークフローに直接組み込めます。
セキュリティ
- 認証プロキシ: Sandboxesは認証プロキシを経由して外部サービスにアクセスするため、シークレットがランタイムに触れることはありません。認証情報はサンドボックス内に一切残りません。
- マイクロVMによる隔離: 各サンドボックスは、Linux名前空間だけでなく、ハードウェア仮想化されたマイクロVMで実行されます。サンドボックス間はカーネルレベルで隔離されています。
今後の展開
現在提供している機能を超えて、Sandboxesを積極的に開発中です。現在、重点的に検討している分野には以下が含まれます:
- 共有ボリューム: エージェントがサンドボックス間で状態を共有できる機能を提供します。エージェント1がボリュームに書き込み、エージェント2がその続きから作業を再開できます。
- バイナリ認可: サンドボックス内で実行可能なバイナリを制御します。エージェントは、パッケージのインストール、認証情報のエクスポート、意図しないタスクでの計算リソース消費など、予期しない動作を起こしがちです。バイナリ認可では、管理された企業のラップトップと同様の方法で実行を制限し、実行可能なプログラム、アクセス可能なドメイン、許可されるネットワーク呼び出しを制限できます。
- 完全な実行トレーシング: 現在、サンドボックスの呼び出しはエージェントの実行とともにトレースされます。私たちは、仮想マシン内で発生するすべてのプロセスやネットワーク呼び出しを含む、完全なトレーシングの実現に取り組んでいます。これは監査ログとしても機能し、サンドボックスが何を、いつ行ったかの完全な記録を提供します。
あなたのワークフローにおいて何が最も重要か、ご意見をお聞かせください。アイデアを共有するには、Slackコミュニティにご参加ください。
始めましょう
LangSmith Sandboxesは現在、プライベートプレビューで利用可能です。安全なコード実行が必要なエージェントを構築している方は、登録してぜひお試しください。
ウェイトリストに登録する
原文を表示
imageToday, we're launching LangSmith Sandboxes in Private Preview: secure, scalable environments for running untrusted code.
Agents get a lot more useful when they can execute code. They can analyze data, call APIs, and build applications from scratch. But letting an LLM run arbitrary code without isolation from your infrastructure is risky. Sandboxes give you ephemeral, locked-down environments where agents can run code safely, with control over what they can access and the resources they can consume.
With LangSmith Sandboxes, you can spin up a sandbox in a single line of code with the LangSmith SDK. Add your API key, pull in the SDK, and you're off.
We've been using Sandboxes internally to power projects like Open SWE, and now we're making them available so you can build with the same primitives.
Sign up for the waitlist
Why Sandboxes?
Coding agents like Cursor, Claude Code, and OpenClaw demonstrate how useful it is to give agents the ability to write and run code. But without isolation, agents can execute destructive or malicious actions on your local environment.
Traditional containers were designed to run known, vetted application code. Agent-generated code is different: it's untrusted and unpredictable. A web server handles a known set of operations. An agent might attempt anything, including malicious commands.
Building secure code execution yourself usually means spinning up containers, locking down network access, piping output back to your agent, and tearing everything down when it's done. Then you need to handle resource limits, because agents running code can rapidly consume CPU, memory, and disk if left unconstrained. As more agents become coding agents, this problem compounds.
A few examples of workloads that need this:
A coding assistant that runs and validates its own output before responding
A CI-style agent that clones a repo, installs dependencies, and runs a test suite before opening a PR (like Open SWE)
A data analysis agent that executes Python scripts against a dataset and returns results
Part of the LangSmith Platform
LangSmith Sandboxes use the same SDK and infrastructure as the rest of LangSmith. If you're already using the Python or JavaScript client for tracing or deployment, you can spin up sandboxes without adding anything new.
Sandboxes also integrate directly with LangSmith Deployment, so you can attach a sandbox to an agent thread. They have native integrations with LangChain's Deep Agents open source framework, as well as Open SWE.
What's Shipping
Runtime Configuration
Bring your own Docker image. Use our defaults or point to your own private registry. Start every sandbox with exactly the filesystem and tooling you need.
Sandbox Templates. Define an image, CPU, and memory configuration once, then reuse it every time you spin up a sandbox. Combine with BYOD images for fully custom environments.
Shared access: Give multiple agents access to the same sandbox, so you don't need to transfer artifacts across isolated environments.
Pooling and autoscaling. Pre-provision a pool of warm sandboxes so agents don't wait for cold starts. Additional sandboxes spin up automatically as demand increases.
Execution
Long-running sessions: Agent tasks that take minutes or hours won't time out. Sandboxes support persistent commands over WebSockets, with real-time output streaming so you can see what's happening as it runs.
Persistent state across interactions. Your agent can use the same sandbox across multiple threads without losing context. Files, installed packages, and environment state carry over between runs.
Tunnels. Expose sandbox ports to your local machine so you can preview your agent's output before deploying it.
SDK and Integrations
Framework agnostic: Use LangSmith Sandboxes with LangChain OSS, another framework, or no framework at all
Python and JavaScript SDKs: First-class clients in both languages with the LangSmith SDK
Deep Agents integration: Plug sandboxes directly into agentic workflows with minimal config.
Security
Auth Proxy: Sandboxes access external services through an Authentication Proxy, so secrets never touch the runtime. Credentials stay off the sandbox entirely.
MicroVM Isolation: each sandbox runs in a hardware-virtualized microVM, not just Linux namespaces. Kernel-level isolation between sandboxes.
What's Coming Next
We're actively developing Sandboxes beyond what's shipping today. Some areas we’re actively exploring include:
Shared volumes: Give agents the ability to share state across sandboxes. Agent 1 writes to a volume, Agent 2 picks up where it left off.
Binary authorization: Control which binaries can run inside a sandbox. Agents are prone to unexpected behavior like installing packages, exporting credentials, or consuming compute on unintended tasks. Binary authorization lets you restrict execution the same way you would on a managed corporate laptop, limiting which programs can run, which domains are reachable, and what network calls are allowed.
Full execution tracing: Today, sandbox calls are traced alongside your agent's runs. We're working toward tracing everything that happens inside the virtual machine, including every process and network call. This doubles as an audit log, giving you a complete record of what a sandbox did and when.
We'd love your input on what matters most for your workflows. Join our Slack community to share ideas.
Get Started
LangSmith Sandboxes are available now in Private Preview. If you're building agents that need secure code execution, sign up and try it out.
Sign up for the waitlist
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み