AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
LangChain Blog·2026年6月13日 00:00·約10分で読める

AI エージェントに適切なサンドボックスを選ぶ方法

#AI エージェント#セキュリティ#ランタイム環境#LangChain
TL;DR

LangChain Blog は、AI エージェントの安全性と効率を最大化するために、利用目的やリスクレベルに応じて最適なサンドボックス環境を選択するための具体的な基準と戦略を解説している。

AI深層分析2026年6月13日 01:07
3
注目/ 5段階
深度40%
4
関連度30%
5
実用性20%
4
革新性10%
2

キーポイント

1

リスクベースの選択基準

エージェントの実行内容が持つ潜在的なリスク(データ漏洩、システム侵害など)に基づいて、隔離レベルやリソース制限を決定する必要性を強調している。

2

利用目的に応じた最適化

単なるテスト環境から本番環境への移行まで、開発段階や運用目的に合わせてサンドボックスの厳格さや機能を調整するアプローチを示唆している。

3

安全性と効率性のバランス

過度な隔離がパフォーマンスを損なうリスクを避けつつ、セキュリティ要件を満たすためのトレードオフ管理の重要性を説いている。

影響分析・編集コメントを表示

影響分析

本記事は、AI エージェントの実用化における最大の課題である「安全性」と「実行効率」の両立に向けた具体的な指針を提供しており、開発現場での実装リスクを低減する上で即座に活用可能な価値がある。特に大規模なエージェントシステムを構築する企業にとって、適切なサンドボックス戦略の欠如が致命的なセキュリティインシデントやコスト増につながることを警鐘し、業界全体の標準化を促す役割を果たす。

編集コメント

AI エージェントが実社会で本格的に運用される現在、単なるコード実行環境ではなく、リスク管理の要となるサンドボックス設計の重要性を再認識させる内容です。

image
image

AI エージェントが最も有用なのは、行動を起こせる時であり、コードの記述と実行を可能にすることは、エージェントに与えることができる最も価値の高い機能の一つです。しかし、その自律性にはセキュリティリスクも伴います。エージェントが作成したコードは、データやシステムに対する予期せぬ脅威を生み出す可能性があるため、コードがどこで実行され、何にアクセスできるかを制御する必要があります。

サンドボックス(隔離環境)は、チームにそのような制御権を与えます。AI によって生成されたコードを分離し、その権限を制限することで、エージェントが実際に作業を行えるより安全な境界線を作成します。これは、エージェントが安全に使用できるコンピュータのようなものです。このガイドでは、AI 生成コードの実行に伴うセキュリティリスクと、エージェントの有用性を損なうことなくデータやシステムを保護するためのサンドボックス化アプローチの選び方について解説します。

エージェントによる致命的なトリプレット

LLM(大規模言語モデル)はソフトウェアエンジニアリングに優れており、コード生成と実行は、エージェントが価値を生み出すための最良の方法の一つです。コード自体が出力となる場合もあれば、非ソフトウェアエンジニアリングのタスクを達成するためにプログラムを作成する場合もあります。後者の一般的な例としては、カスタムデータ分析を支援するためのワンオフスクリプト(単発スクリプト)を作成することが挙げられます。しかし、リスクとして、攻撃者がプロンプトインジェクション(注入攻撃)を利用して、エージェントにデータやシステムを侵害するコードを書かせようとする可能性があります。

現在、プロンプトインジェクションを確実に防止する方法はありません。プロンプトインジェクション攻撃を含む信頼できないコンテンツは、多くの経路を通じてエージェントのコンテキストに到達する可能性があります。エンドユーザーからの入力、外部 MCP サーバーからのレスポンス、第三者が作成したスキルなどは、その代表的な例の一部に過ぎません。

人気のある Django Web Framework の共著者であり、「プロンプトインジェクション」という用語を発明したサイモン・ウィリソンは、以下のように 説明しています。これら3つの条件がすべて満たされた場合、攻撃者にデータを盗まれるリスクが生じるという「致命的なトリプレット」です:

  • 機密データへのアクセス権限
  • 信頼できないコンテンツへの曝露
  • 外部との通信能力

ウィリソンの研究に触発され、Meta は 提案 しました。この「2 の法則」を適用することで、トリプレットの3つの条件がすべて当てはまる場合、エージェントが完全に自律的に実行されるべきではないと述べています。

「2 の法則」は理解するのは簡単ですが、それを遵守することは困難です。エージェントに必要なツールを提供するには、通常、機密データへのアクセス権限と外部との通信能力の両方を付与する必要があります。基盤モデルやハーンエンジニアリングの進歩により、AI エージェントはより多くのコンテキストを活用できるようになりましたが、それは同時に攻撃者がプロンプトインジェクション攻撃を送る確率を高めることになります。

おそらく、致命的なトリオはあなたのエージェントにも適用されており、つまりそのエージェントがどのようなデータに対してどのような行動を取れるかを制限するセーフガードが必要です。これらの制御を成功裏に実装するには、まず3つのリスク要因すべてを絞り込むことが非常に重要です。そこがサンドボックスの役割です。

エージェントが行えることに明確な境界線を引くためのサンドボックスの利用

安全なサンドボックスソリューションは、エージェントの致命的なトリオへの曝露を狭め、成功したプロンプトインジェクション攻撃が発生した場合にそのエージェントが引き起こす害を制限するために、以下の機能を提供します:

  • 隔離されたファイルシステム
  • 制限されたネットワークアクセス
  • リソース制限
  • 制御された再利用性
  • ホストマシンからのカーネルレベルの分離(kernel-level isolation)

市場には「サンドボックス」と自称する製品が存在しますが、これらは標準機能としてこの機能を備えていない場合があります。そのため、エージェントに採用する前に潜在的なソリューションを批判的に評価する必要があります。例えば、オープンソースの Kubernetes Agent Sandbox は、コンテナ間にカーネルレベルの分離が保証されたクラスターへデプロイした場合のみ安全であり、大多数の Kubernetes クラスターではそのような分離が強制されていないため注意が必要です。

Isolated Filesystem

サンドボックスには、エージェントが作業を行うために必要なデータのみを含め、他のデータへのアクセスを試みないようにブロックする必要があります。これにより、機密データへの曝露を最小限に抑えつつ、監査と制御を容易にします。

ネットワークアクセスの制限

サンドボックスは、エージェントがインターネットを介してデータを送信できる外部エンドポイントを指定できるようにする必要があります。つまり、攻撃者があなたのエージェントに機密データを漏洩させるように仕向した場合でも、そのデータを送信できるのはあなたが信頼するエンティティのみとなります。

リソース制限

サンドボックスは、エージェントが使用できる計算リソースとメモリの量、および使用時間を制御できるようにする必要があります。侵害されたエージェントがシステムの過剰なリソース消費を行えないようにします。

制御された再利用性

サンドボックスの再利用は、実行間をまたいでエージェントの状態を永続化させる便利な方法ですが、一度でも攻撃者にサンドボックスが侵害された場合、その被害が持続する可能性があることを意味します。サンドボックスソリューションでは、このリスクを負う価値があるかどうかを決定できるようにする必要があります。

ホストマシンからのカーネルレベルの分離

上記の制御は、エージェントがそれらを強制するシステムを上書きできない場合にのみ機能します。残念ながら、オペレーティングシステムを支えるカーネルには、侵害されたエージェントが利用してマシンの制御権を奪い、データを守るあらゆる制御を迂回させることができるバグが含まれていることがよくあります。ここでの解決策は仮想化であり、つまりサンドボックスは、それを動作させているマシンとは別の独自のカーネルを使用して実行されます。マイクロVM(microVM)を活用したソリューションを使用すれば、各サンドボックスごとにフルサイズの仮想マシンを起動するコストを負担することなく、効率的にカーネル分離型のサンドボックスを作成できます。

上記のすべてを備えたサンドボックスソリューションがあったとしても、侵害されたエージェントがデータやシステムに及ぼすリスクについて真剣に考える必要がないという意味ではありません。サンドボックスだけでは致命的なトリオのどの側面も完全に排除することはできません。むしろ、機密データへのアクセスを縮小し、外部通信を制限することで、プロンプトインジェクションのリスク管理をチームが自信を持って解決できる十分な小さな問題へと変えるのです。

LangSmith Sandboxes: エンドツーエンドのエージェントエンジニアリングプラットフォームに統合された安全なコード実行環境

私たちは、LangChain、LangGraph、および/または Deep Agents で構築したエージェントを堅牢にテスト、デプロイ、監視できるようにするために、オープンソース製品を補完する LangSmith エージェントエンジニアリングプラットフォームを開発しました。サンドボックスはしばしば安全なエージェント構築に不可欠であるため、LangSmith には管理されたソリューションを組み込みました。本製品は上記のベストプラクティスに従って設計され、厳格なペネトレーションテスト(penetration testing)に供されました。LangSmith Sandboxes は、Monday.com などの大企業を含むあらゆる規模の企業で利用されています。

LangSmith のサンドボックスは、それぞれ独自のファイルシステムを持つ専用マイクロ VM によって支えられており、互いにもしくは基盤インフラからカーネルレベルで隔離されています。開始からシャットダウン、最終的な破棄に至るまでのライフサイクルを完全に制御でき、必要に応じて必要な分だけ再利用できます。また、サンドボックス内で実行されるプロセスにどの程度のネットワークアクセス権を与えるかも決定可能です。さらに、認証プロキシも用意されており、アウトバウンドトラフィックがサンドボックスを出た後に安全な資格情報を注入するため、信頼できないプロセスが存在する可能性のあるサンドボックス内部に機密情報を配置する必要はありません。

LangSmith のサンドボックスは、既存の観測機能、評価機能、デプロイメント機能で利用しているのと同じ API および認証メソッドを使用して管理できます。LangChain、LangGraph、または Deep Agents で構築されたエージェントにサンドボックスの利用を追加するには、数行のコードを書くだけで済みます。

Why LangSmith Sandboxes:

Secured following modern best practices

Auth proxy isolating secrets from untrusted code

Seamless integration with the LangChain and LangSmith ecosystem

エージェントを有用かつ安全に保つためにサンドボックスの使用を検討されている場合は、こちらのドキュメントに従って、今日からすぐに LangSmith のサンドボックスの利用を開始できます。

関連コンテンツ

image
image

LangSmith

エージェントに専用のコンピューターを

image
image

Amy Ru

2026 年 6 月 5 日

image
image

7 分

image
image

事例紹介

LangGraph

LangSmith

チュートリアルとハウツーガイド

LangGraph と LangSmith を活用した Lyft のカスタマーサポート向けセルフサービス AI エージェントプラットフォーム構築

image
image

Akshay Sharma

2026 年 5 月 27 日

image
image

10 分

image
image

LangSmith

ミッションコントロール:Kubernetes 上で LangSmith をセルフホストして運用する

image
image

Gethin Dibben

2026 年 5 月 26 日

image
image

6 分

image
image

エージェントが実際に何をしているかを確認する

LangSmith は、エージェントエンジニアリングプラットフォームであり、開発者がすべてのエージェントの意思決定をデバッグし、変更の評価を行い、ワンクリックでデプロイできるように支援します。

原文を表示

AI agents are most useful when they can take action, and letting them write and run code is one of the highest-value capabilities you can give them. But that autonomy comes with security risks. Agent-written code can create unexpected threats to your data and systems, so you need to control where that code runs and what it can access.

Sandboxes give teams that control. They isolate AI-generated code, limit its permissions, and create a safer boundary for letting agents do real work. They’re computers your agent can safely use. This guide covers the security risks of running AI-generated code and how to choose a sandboxing approach that protects your data and systems without limiting agent usefulness.

The Agent Lethal Trifecta

LLMs excel at software engineering, making code generation and execution one of the best ways for agents to create value. The code itself can be the output, or the agent can create programs to help it accomplish non-software engineering tasks. A common example of the latter is writing one-off scripts to help with custom data analysis. The risk, however, is that an attacker can use prompt injection to induce your agent to write code that compromises your data and systems.

Currently, there is no surefire way to prevent prompt injection, and untrusted content containing a prompt injection attack can reach your agent’s context in many ways. End-user inputs, external MCP server responses, and third party-written skills are just a few common examples. Simon Willison, co-author of the popular Django Web Framework and inventor of the term “prompt injection”, summarizes the ensuing risk by outlining the “lethal trifecta” of conditions that, when all true, means your agent can allow an attacker to steal your data:

  • Access to sensitive data
  • Exposure to untrusted content
  • The ability to communicate externally

Inspired by Willison’s work, Meta proposed applying the “Rule of Two”, meaning an agent should never run fully autonomously if all three conditions of the trifecta apply.

The rule of two is simple to understand, but following it is difficult. Providing an agent with the tools it needs usually means giving it both access to sensitive data and the ability to communicate externally. Advances in foundation models and harness engineering allow AI agents to leverage more and more context, but that increases the odds an attacker can send a prompt injection attack.

Odds are, the lethal trifecta applies to your agent, which means it needs safeguards limiting what actions it can take with what data. Successfully implementing those controls is a lot easier if you first narrow all three risk factors. That’s where sandboxes help.

Using sandboxes to put clear boundaries around what your agent can do

A secure sandbox solution provides the following features to narrow an agent’s exposure to the lethal trifecta, and limit the harm it can do in the event of a successful prompt injection attack:

  • Isolated filesystem
  • Limited network access
  • Resource limits
  • Controlled reusability
  • Kernel-level isolation from the host machine

There are products on the market calling themselves "sandboxes" that don't provide this functionality out of the box, so evaluate potential solutions critically before choosing one for your agent. For example, the open-source Kubernetes Agent Sandbox is only secure if deployed to a cluster that has kernel-level isolation between containers, which most Kubernetes clusters do not enforce.

Isolated Filesystem

The sandbox should contain only the data the agent needs to do its work, and block the agent from trying to access any other data. This minimizes exposure to sensitive data while making it easier to audit and control.

Limited network access

The sandbox should let you specify which external endpoints the agent can send data to via the internet. This means that, even if an attacker induces your agent to leak sensitive data, it can only send it to entities you trust.

Resource limits

The sandbox should let you control how much compute and memory the agent can use and for how long. A compromised agent should not be able to overconsume your system’s resources.

Controlled reusability

Reusing sandboxes can be a convenient way to persist agent state across executions, but it does mean that if an attacker compromises the sandbox once, the damage can persist. The sandbox solution should let you decide if that risk is worth taking.

Kernel-level isolation from the host machine

The controls above only work if the agent can’t override the systems enforcing them. Unfortunately, the kernels that power operating systems often contain bugs a compromised agent can exploit to take control of your machine and bypass any controls protecting the data on it. The solution here is virtualization, meaning your sandbox runs using its own kernel separate from the one powering the machine running it. You can use a microVM-powered solution to efficiently create kernel-isolated sandboxes without incurring the costs of spinning up a full virtual machine per sandbox.

A sandbox solution that has all of the above doesn’t mean you don’t need to think seriously about the risks a compromised agent poses to your data and systems. Sandboxes alone do not fully eliminate any aspect of the lethal trifecta. Instead, they shrink access to sensitive data and limit external communication to the point where managing prompt injection risk becomes a small enough problem for your team to solve confidently.

LangSmith Sandboxes: secure code execution, integrated with our end-to-end agent engineering platform

We developed the LangSmith agent engineering platform to complement our open source products, letting you take the agents you built with LangChain, LangGraph, and/or Deep Agents and robustly test, deploy, and monitor them. Since sandboxes are often integral to building secure agents, we built a managed solution into LangSmith. We designed the product following the best practices listed above and subjected it to rigorous penetration testing. LangSmith Sandboxes are in use by companies of all sizes, including enterprises like Monday.com

LangSmith Sandboxes are each backed by a dedicated microVM with its own filesystem, giving them kernel-level isolation from each other as well as the underlying infrastructure. You control their lifecycle from start to shutdown to eventual destruction, reusing them as much or as little as you need along the way. You decide what network access, if any, a process running inside the sandbox gets. We also include an authorization proxy that injects secure credentials into outbound traffic after it leaves the sandbox, so you don’t need to put secrets inside the sandbox, where an untrusted process could access and try to misuse them.

You can manage LangSmith Sandboxes using the same API and authentication you already use with our observability, evaluations, and deployment functionality. Adding sandbox use to an agent built with LangChain, LangGraph, or Deep Agents takes just a few lines of code.

Why LangSmith Sandboxes:

Secured following modern best practices

Auth proxy isolating secrets from untrusted code

Seamless integration with the LangChain and LangSmith ecosystem

If you are ready to use sandboxes to keep your agents both useful and secure, you can get started with LangSmith Sandboxes today following the documentation here.

Related content

LangSmith

Give your agent its own computer

Amy Ru

June 5, 2026

7

min

Case Studies

LangGraph

LangSmith

Tutorials & How-Tos

How Lyft Built a Self-Serve AI Agent Platform for Customer Support with LangGraph and LangSmith

Akshay Sharma

May 27, 2026

10

min

LangSmith

Mission Control: Operating Self-Hosted LangSmith on Kubernetes

Gethin Dibben

May 26, 2026

6

min

See what your agent is really doing

LangSmith, our agent engineering platform, helps developers debug every agent decision, eval changes, and deploy in one click.

この記事をシェア

関連記事

Ars Technica AI★42026年6月13日 12:00

トランプ政権の指示によりアンソロピックが「Fable」「Mythos」モデルを停止

米国商務省からの輸出規制命令を受け、AI企業アンソロピックは金曜日夜に新開発した「Fable 5」と「Mythos 5」モデルへのアクセスを完全に停止した。

Ars Technica AI★42026年6月13日 01:34

Google、Gemini を悪用した中国のサイバー犯罪ネットワーク「Outsider Enterprise」を提訴

Google は、生成AI製品「Gemini」を利用して大規模な詐欺キャンペーンを自動化したとされる中国の犯罪組織「Outsider Enterprise」に対して訴訟を起こし、法執行機関や携帯キャリアと連携して対抗すると発表した。

LangChain Blog★42026年6月12日 05:49

最も賢い AI でも不十分な場合、ベンチリングがエージェントを構築する方法

R&D データプラットフォーム「ベンチリング」の AI 責任者ニコラス・ララスストーン氏が、生命科学分野向けに多モデルアーキテクチャや検証可能なタスク戦略を用いて AI エージェントを構築する複雑さを解説した。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む