Auth Proxy が LangSmith エージェントサンドボックスをどのように保護するか
LangChain は、エージェントの機密情報漏洩や不正なネットワークアクセスを防ぐため、認証プロキシを導入したラングスミスサンドボックスのセキュリティ強化策を発表しました。
キーポイント
機密情報の隔離と保護
エージェントが実行されるランタイム環境から機密情報(シークレット)を分離し、外部への漏洩リスクを根本的に排除します。
エグレストラフィックの制約
エージェントが外部ネットワークに到達する経路(イグレス)を厳格に制御・制限することで、不正なデータ流出や悪意ある通信を防ぎます。
インフラレベルでの統制
チームはアプリケーションコードを変更せずとも、インフラストラクチャの階層でエージェントが外部サービスにアクセスするルールを一元管理できます。
影響分析・編集コメントを表示
影響分析
この発表は、自律型エージェントの普及に伴う深刻化するセキュリティ課題に対し、実装コストを抑えつつ効果的な対策を提供する重要な指針となります。特に、開発者が個別にセキュリティコードを実装する必要なく、プラットフォーム側で統一的な保護層を適用できる点は、業界全体の信頼性向上に寄与します。
編集コメント
エージェントの自律性が高まるほどセキュリティリスクも増大するため、このインフラレベルでの制御機能は実務において極めて重要な役割を果たすでしょう。
LangSmith エージェントサンドボックスのネットワークアクセスを Auth Proxy がどのように保護するか

主要なポイント
- エージェントはコードの実行、パッケージのインストール、API の呼び出し、信頼できないコンテンツからの指示の追従が可能であるため、エージェントサンドボックスにはより強力なネットワーク制御が必要です。
- LangSmith Auth Proxy は、認証ヘッダーをネットワーク層で注入することで認証情報をサンドボックス外に保持し、プロンプトインジェクション、ログ、ファイル、悪意のある依存関係からの露出を低減します。
- チームはエグレスポリシーと動的な認証フローを定義できるため、エージェントは直接長期有効なシークレットへのアクセスを持たずに、承認されたサービス、パッケージレジストリ、ユーザースコープの API に到達できます。
大企業で働いた経験があれば、標準的な企業のラップトップ設定をご覧になったことがあるでしょう。
エンドポイント保護、ブラウザフィルタリング、デバイス管理、ネットワーク制御、証明書ストア、シークレットスキャナー……信頼された従業員が誤って認証情報を漏洩したり、悪意のあるパッケージをインストールしたり、間違ったページにアクセスしたりするのを防ぐために存在する多数のツールのリストがあります。
これらのツールが存在するのは、開発者に広範なアクセス権限があるからです。彼らはコードを実行し、依存関係をインストールし、システム間でデータをコピーします。内部および外部サービスへの認証も行います。多くの企業セキュリティは、この強力かつ開放的な環境をより安全にするために構築されています。
エージェントはこの問題の規模と形状を変化させます。単に一人の開発者にラップトップを与えるだけでなく、コードを書き、コマンドを実行し、パッケージをインストールし、あなたの代わりにネットワークリクエストを行う数千、あるいは最終的には数百万もの「信頼できない開発者」を生成する可能性があります。
人間の開発者の場合、環境はデフォルトで開放されている必要があります。作業の変化に応じて、開発者は探索やデバッグを行い、ツールをインストールし、新しいサービスにアクセスする必要があります。しかし、エージェントの場合のデフォルトは異なる場合があります。タスクが既知であれば、ネットワークはより狭く設定できます。エージェントが GitHub と LLM プロバイダーのみを必要とするなら、インターネット上のあらゆるランダムなホストと通信できるべきではありません。認証情報が必要な場合でも、その認証情報は実行環境内に存在する必要はありません。
ここで、サンドボックスのネットワーキングがエージェントハッチの主要な構成要素となります。
サンドボックス Auth Proxy の紹介
LangSmith Sandboxes は、メインインフラストラクチャに影響を与えることなく、コードの実行やファイルシステムとの対話を可能にするエージェント用の隔離環境を提供します。しかし、隔離は物語の一部に過ぎません。エージェントは依然として、モデルプロバイダー、GitHub、パッケージレジストリ、内部サービス、データ API など、外部 API を呼び出す必要があります。
sandbox auth proxy は、エージェントによって生成された動作と世界の他の部分との間の境界を制御する方法です。
API キーをサンドボックス内の環境変数やファイルとして配置するのではなく、プロキシはアウトバウンドネットワークパス上に位置し、サンドボックス化されたコードが外部サービスとどのように相互作用するかを制御します。これにより、許可される宛先のポリシー、適用される認証、およびサンドボックスから送信される前にリクエストがどのように整形されるかを強制できます。サンドボックス内のコードは通常の外部 API へのリクエストを行いますが、資格情報やアクセスルールはネットワーク層でサンドボックス外で処理されます。

このモデルにより、以下の 3 つのことがはるかに容易になります:
- クレデンシャルはランタイムから分離されます。エージェントは API を使用できますが、API キー自体を読み取ることはできず、これによりプロンプトインジェクション、悪意のある依存関係、誤ったログ出力、モデルのミスによる被害を軽減します。
- ネットワークアクセスは明示的になります。エージェントが OpenAI、Anthropic、GitHub、または内部 API とのみ通信すべきである場合、それはエージェントの判断に任せるのではなく、インフラストラクチャポリシーとして記述されるべきです。
- チームは関心の分離が明確になります:エージェントはタスクに集中し、サンドボックスは隔離を提供し、プロキシはネットワーク認証とクレデンシャル注入を処理し、アプリケーションまたは認証サービスはユーザースコープのアクセスとトークン更新を担当します。
この分離が重要なのは、エージェントは信頼できない存在であり、彼らが取るすべての分岐を事前にすべてレビューすることが不可能だからです。より安全なパターンは、可能なアクションがインフラストラクチャによって制限された制約付き環境を与えることであり、これにより認証プロキシはクレデンシャルをサンドボックスから完全に排除します。
仕組み
高レベルでは、認証プロキシはサンドボックスの出口(egress)に対する制御された仲介者であり、その様子は以下のようになります:
- エージェントまたはサンドボックス化されたコードが外部へのリクエストを行います。
- そのリクエストは Auth Proxy を経由します。
- Auth Proxy はその宛先に対して設定されたポリシーを確認します。
- プロキシはリクエストをブロックするか、許可するか、あるいはヘッダーを追加することができます。
- リクエストはランタイムに認証情報を露出させることなく宛先に続行されます。
シンプルなルールとしては、「サンドボックスが api.openai.com を呼び出す場合、LangSmith ワークスペースのシークレットから取得した値を持つ Authorization ヘッダーを注入する」といったものが挙げられます。別のルールでは、「サンドボックスが /repos/* または /user に対して api.github.com を呼び出す場合、GitHub トークンを注入する」といったものもあります。
私たちがサンドボックスのネットワークを制御しているため、これは完全に透明です。これは、すべての言語、パッケージマネージャー、SDK、またはサブプロセスが HTTP_PROXY を尊重することを期待して実装されているわけではありません。すべてのランタイムが同じように動作するわけではなく、エージェントはあなたが記述していない任意のコードパスを実行することがよくあります。

エージェントに認証情報を手渡さずに認証する
プロキシは多くの異なるポリシー構成をサポートしています。その中で強力なものの一つが、特定の特徴を持つリクエストに対してヘッダーを注入できる機能です。
ヘッダーは以下のような異なるタイプで設定できます:
- workspace_secret: LangSmith ワークスペース設定に保存されたシークレットを参照します
- plaintext: 機密性の低いヘッダーのために、そのまま保存・返されます
- opaque: 書き込み専用で、保存時に暗号化され、API によって決して返されません
例えば、OpenAI ルールの例では、以下のように注入できます:
{
"name": "Authorization",
"type": "workspace_secret",
"value": "Bearer {OPENAI_API_KEY}"
}
サンドボックスコードは API キーを知る必要はありません。.env ファイルも不要です。ファイルシステムにシークレットをマウントする必要もありません。単に API を呼び出すだけで、プロキシが宛先が設定されたルールと一致した場合に適切なヘッダーを追加します。
これはエージェントシステムにとってより良いデフォルトです。人間の開発者は、新しい統合のデバッグのために資格情報への直接アクセスを必要とする場合がありますが、通常はエージェントにはそのような必要性はありません。エージェントが必要なのは資格情報そのものの所有ではなく、資格情報の効果、つまり特定の API を呼び出す能力です。
この区別は、エージェントの実行回数が増えるほど重要になります。単一のサンドボックスであれば、キーの漏洩は問題ですが、多数のサンドボックスからなるファームウェアにおいて、ランタイムに資格情報を直接配置することは重大なリスクとなります。ツール呼び出し、パッケージインストール、ログ出力、ファイル書き込みのすべてが、潜在的な資格情報の露出経路となり得ます。ヘッダー注入により、資格情報はその爆発半径外へ移動します。
ネットワークの厳格化
認証情報はネットワーク問題の半分しか解決しません。エージェントは依存関係のインストール、スクリプトの取得、API の呼び出し、信頼できないコンテンツからの指示の追従が可能であるため、出口ポリシーも必要です。もしすべてのサンドボックスがインターネットへの開放アクセスを持っていれば、侵害されたか混乱したエージェントが、本来到達すべきでない場所に到達できてしまいます。
ヘッダーを注入する同じプロキシ境界は、チームが期待される宛先を定義する場所にもなり得ます。例えば:
- モデルプロバイダー API を許可し、それ以外をすべてブロックする
- エージェントが必要とする GitHub API パスを許可するが、任意の GitHub 関連ドメインは許可しない
- パッケージレジストリを許可するが、内部ミラーのみ許可する
- 既知の悪意のあるまたは信頼できないパッケージレジストリをブロックする
- 誤って不正な第三者サービスへの呼び出しを防ぐ
これは特にパッケージ管理において重要です。コーディングエージェントが pip install、npm install、あるいは curl | bash を実行できる場合、コードを取得して実行できてしまいます。セキュリティ上の問いは、単にサンドボックス内で実行を封じ込められるかどうかではなく、そのコードの発生源とデータ送信先を制御できるかどうかです。
本番環境認証のための動的認証情報
LangSmith Fleet とサンドボックスを統合する過程で、高度なユースケースにおいては静的設定では不十分であることがわかりました。Fleet エージェントは委任されたアクセスや OAuth トークンの更新が必要になる可能性がありますが、実際の認証情報の扱いはエージェントランタイムの外に維持する必要があります。
他の高度なユースケースの例としては:
- 短期有効な OAuth アクセストークン
- ユーザーごとにスコープを限定したトークン
- 内部認証サービスによって発行された資格情報
- 宛先や現在のユーザーコンテキストに基づいて更新が必要なトークン
これらのケースでは、Auth Proxy は コールバック付きの動的資格情報 をサポートしています。
すべての資格情報を静的ルールに記述するのではなく、proxy_config 内にコールバックを設定します。サンドボックスが一致するホストへのリクエストを実行し、プロキシにキャッシュされた資格情報がない場合、プロキシはターゲットのホストとポートを指定してあなたのコールバックエンドポイントを呼び出します。あなたのエンドポイントは注入すべきヘッダーを返し、プロキシはその結果を設定された TTL(Time To Live)期間でキャッシュします。
契約内容はシンプルです:コールバックは以下のような JSON オブジェクトを返します。
{
"headers": {
"Authorization": "Bearer <token>",
"X-Org-Id": "..."
}
}
プロキシはこのヘッダーをアウトバウンドリクエストに注入します。もしコールバックが失敗した場合、不正な JSON を返した場合、または 2xx 以外のステータスコードで応答した場合は、プロキシは安全側に閉じて(fail closed)、資格情報なしで送信するのではなくサンドボックスのリクエストを拒絶します。このパターンにより、リフレッシュトークンや長期有効な資格情報をサンドボックスに露出させることなく、サンドボックスのネットワーク層が認証フローに参加できるようになります。
次に何が可能になるか
サンドボックスのネットワークパスを制御できるようになれば、プロキシは単なる資格情報注入器を超えた役割を果たすことができ、いくつかの自然な拡張が可能です。
- DNS リマップ:チームは、パブリックパッケージレジストリへの要求を内部の Artifactory やパッケージミラーに解決させたいと考えるかもしれません。また、LLM API 要求を内部ゲートウェイに向けることも望まれるでしょう。エージェントは通常のインストールコマンドを実行し続けますが、ネットワーク層がこれらの要求を承認されたインフラストラクチャへ向けるようになります。
- ネットワークログ:エージェントが長期間にわたって意味のある作業を行う場合、チームはどのサービスを呼び出し、どのパッケージを取得し、どのドメインへの到達を試みたかを把握したいと考えるはずです。ネットワークログは、エージェントの行動に関する監査証跡の一部となります。
- リクエスト変換:プロキシはアウトバウンド要求を可視化できるため、最終的には PII の削除、組織メタデータの追加、リクエスト形状の強制、またはポリシーに違反するペイロードのブロックといった決定論的変換を適用する場所となり得ます。
より広い視点として、エージェントインフラストラクチャには、ランタイムの外側に存在し、エージェントの指示や意思決定に晒されないコントロールプレーンが必要であるという点です。
エージェントエグレスにおける新しいデフォルト
エージェントは有用な作業を行うために認証情報とネットワークアクセスを必要としますが、その機能を実現するために、ランタイム内に長期有効なシークレットや制限のないインターネットアクセスを含めるべきではありません。Auth Proxy は、認証情報を環境外に保持し、アウトバウンドトラフィックを制御された層経由でルーティングし、言語、SDK、パッケージマネージャー、CLI を通じて一貫してポリシーを適用することで、サンドボックス化されたエージェントにより安全なデフォルトを提供します。
その結果、エージェントが必要なシステムへのアクセスを可能にしつつ、認証情報やネットワークポリシーはプラットフォーム側で管理するサンドボックスモデルが実現されます。
LangSmith Sandboxes をお試しください:https://www.langchain.com/langsmith/sandboxes
ドキュメントを読む:https://docs.langchain.com/langsmith/sandboxes
関連コンテンツ

企業アナウンスメント
LangSmith
Interrupt で発表したすべての新機能

Jacob Talbot
2026 年 5 月 14 日
11 分

LangSmith
LangSmith Engine のご紹介

Ben Tannyhill
2026 年 5 月 13 日
5 分

LangSmith
エージェントの観測性を支えるデータレイヤー「SmithDB」を構築しました

アンクシュ・ゴラ(Ankush Gola)
2026 年 5 月 13 日
11
分
エージェントが実際に何をしているかを確認する
エージェントエンジニアリングプラットフォームである LangSmith は、開発者がすべてのエージェントの意思決定をデバッグし、評価の変更を検証し、ワンクリックでデプロイできるように支援します。
原文を表示
How Auth Proxy secures network access for LangSmith agent sandboxes

Key Takeaways
- Agent sandboxes need stronger network controls because agents can run code, install packages, call APIs, and follow instructions from untrusted content.
- LangSmith Auth Proxy keeps credentials outside the sandbox by injecting auth headers at the network layer, reducing exposure from prompt injection, logs, files, and malicious dependencies.
- Teams can define egress policies and dynamic credential flows so agents reach approved services, package registries, and user-scoped APIs without direct access to long-lived secrets.
If you’ve ever worked at a large enterprise, you have probably seen the standard corporate laptop setup.
There’s endpoint protection, browser filtering, device management, network controls, certificate stores, secret scanners… a long list of tools whose job is to stop an otherwise trusted employee from accidentally leaking credentials, installing a malicious package, or visiting the wrong page.
That tooling exists because developers have broad access. They run code, install dependencies, and copy data between systems. They authenticate to internal and external services. A lot of enterprise security is built around making that powerful, open-ended environment safer.
Agents change the scale and shape of this problem. You’re not just giving one developer a laptop. You may be spawning thousands, or eventually millions, of “untrusted developers” that can write code, run commands, install packages, and make network requests on your behalf.
For human developers, the environment often needs to stay open by default. Developers need to explore, debug, install tools, and reach new services as their work changes. For agents, the default can be different. If the task is known, the network can be narrower. If the agent only needs GitHub and an LLM provider, it should not be able to talk to every random host on the internet. If it needs a credential, that credential should not have to exist inside the runtime at all.
This is where sandbox networking becomes a first-class part of the agent harness.
Introducing the sandbox Auth Proxy
LangSmith Sandboxes give agents isolated environments for running code and interacting with filesystems without affecting your main infrastructure. But isolation is only one part of the story. Agents still need to call external APIs like model providers, GitHub, package registries, internal services, data APIs, and more.
The sandbox auth proxy is a way to control the boundary between agent-generated behavior and the rest of the world.
Instead of putting API keys into the sandbox as environment variables or files, the proxy sits on the outbound network path and controls how sandboxed code interacts with external services. It can enforce policy for which destinations are allowed, what authentication is applied, and how requests are shaped before they leave the sandbox. Sandbox code makes a normal request to an external API, while credentials and access rules are handled outside the sandbox at the network layer.

Three things become much easier with this model:
- Credentials stay out of the runtime. The agent can use an API without being able to read the API key, which reduces the damage from prompt injection, malicious dependencies, accidental logging, and model mistakes.
- Network access becomes explicit. If an agent should only talk to OpenAI, Anthropic, GitHub, or an internal API, that should be encoded as infrastructure policy rather than left to the agent’s judgment.
- Teams get a cleaner separation of concerns: the agent focuses on the task, the sandbox provides isolation, the proxy handles network authorization and credential injection, and the application or auth service handles user-scoped access and token refresh.
This separation is important because agents are untrusted and you can’t review every branch they will take ahead of time. The safer pattern is to give them constrained environments where the possible actions are bounded by infrastructure, so the auth proxy keeps credentials out of the sandbox entirely.
How it works
At a high level, the auth proxy is a controlled intermediary for sandbox egress, which looks like this:
- The agent or sandboxed code makes an outbound request.
- The request passes through Auth Proxy.
- Auth Proxy checks the configured policy for that destination.
- The proxy can block the request, allow it, or attach headers.
- The request continues to the destination without exposing credentials to the runtime.
A simple rule might say: when the sandbox calls api.openai.com, inject an Authorization header whose value comes from a LangSmith workspace secret. Another rule might say: when the sandbox calls api.github.com on /repos/* or /user, inject a GitHub token.
Because we control the network for the sandbox, this is completely transparent. This is not implemented by hoping every language, package manager, SDK, or subprocess respects HTTP_PROXY. Not all runtimes behave the same way, and agents often execute arbitrary code paths you didn’t write.

Authenticate without handing credentials to your agent
The proxy supports many different policy configurations. One powerful one is the ability to inject headers into requests that match certain characteristics.
Headers can be configured with different types:
- workspace_secret: references a secret stored in LangSmith workspace settings
- plaintext: stored and returned as-is, for non-sensitive headers
- opaque: write-only, encrypted at rest, and never returned by the API
For example, in the example of the OpenAI rule, we can inject:
{
"name": "Authorization",
"type": "workspace_secret",
"value": "Bearer {OPENAI_API_KEY}"
}
`
The sandbox code does not need to know the API key. It does not need an .env` file. It does not need a secret mounted into its filesystem. It just calls the API, and the proxy adds the right header when the destination matches the configured rule.
This is a better default for agent systems. A human developer may need direct access to a credential to debug a new integration. An agent usually does not. The agent needs the effect of the credential — the ability to call a specific API — not possession of the credential itself.
That distinction becomes more important as the number of agent runs grows. With a single sandbox, a leaked key is bad, but for a fleet of sandboxes, putting credentials directly into runtimes is a significant risk. Every tool call, package install, log line, and file write is a possible credential exposure path. Header injection moves the credential out of that blast radius.
Locking down the network
Credentials are only half the network problem; agents also need egress policy because they can install dependencies, fetch scripts, call APIs, and follow instructions from untrusted content. If every sandbox has open internet access, a compromised or confused agent can reach places it shouldn’t.
The same proxy boundary that injects headers can also become the place where teams define which destinations are expected, like:
- allowing the model provider API and blocking everything else
- allowing GitHub API paths the agent needs, but not arbitrary GitHub-adjacent domains
- allowing a package registry, but only the internal mirror
- blocking known malicious or untrusted package registries
- preventing accidental calls to unauthorized third-party services
This is especially important for package management. If a coding agent can run pip install, npm install, or curl | bash, it can fetch and execute code. The security question is not just whether the sandbox can contain execution, but whether you can control where that code comes from and where it can send data.
Dynamic credentials for real production auth
While integrating sandboxes with LangSmith Fleet, we realized that for advanced use cases, static configuration may not be sufficient. Fleet agents may need delegated access and OAuth token refreshes while still keeping the actual credential handling outside the agent runtime.
Other examples of advanced use cases include:
- short-lived OAuth access tokens
- per-user-scoped tokens
- credentials minted by an internal auth service
- tokens that need to be refreshed based on the destination or current user context
For these cases, the auth proxy supports dynamic credentials with callbacks.
Instead of putting all credential material into static rules, you configure a callback under proxy_config. When the sandbox makes a request to a matching host and the proxy does not have a cached credential, the proxy calls your callback endpoint with the target host and port. Your endpoint returns the headers to inject, and the proxy caches the result for a configured TTL.
The contract is simple: the callback returns a JSON object like:
{
"headers": {
"Authorization": "Bearer ",
"X-Org-Id": "..."
}
}
The proxy injects those headers into the outbound request. If the callback fails, returns malformed JSON, or responds with a non-2xx status, the proxy fails closed and rejects the sandbox request rather than sending it without credentials. This is the pattern lets the sandbox network layer participate in auth flows without exposing refresh tokens or long-lived credentials to the sandbox.
What this unlocks next
Once you control the sandbox network path, the proxy can become more than a credential injector, and there are a few natural extensions.
- DNS remapping: a team may want requests to public package registries to resolve to an internal Artifactory or package mirror instead. You may want to point LLM API requests towards an internal gateway. The agent still runs normal install commands, but the network layer points those requests at approved infrastructure.
- Network logging: if agents are doing meaningful work over long horizons, teams will want to know which services they called, which packages they fetched, and which domains they attempted to reach. Network logs become part of the audit trail for agent behavior.
- Request transformation: since the proxy sees outbound requests, it can eventually become a place to apply deterministic transformations, such as redacting PII, adding organization metadata, enforcing request shape, or blocking payloads that violate policy.
The broader point is that agent infrastructure needs control planes that live outside the runtime and aren’t exposed to agent instructions and decisions.
The new default for agent egress
Agents need credentials and network access to do useful work, but those capabilities should not require putting long-lived secrets or unrestricted internet access inside the runtime. Auth Proxy gives sandboxed agents a safer default by keeping credentials outside the environment, routing outbound traffic through a controlled layer, and applying policy consistently across languages, SDKs, package managers, and CLIs.
The result is a sandbox model that gives agents access to the systems they need, while keeping credentials and network policy under platform control.
Try LangSmith Sandboxes: https://www.langchain.com/langsmith/sandboxes
Read the docs: https://docs.langchain.com/langsmith/sandboxes
Related content

Company Announcements
LangSmith
Everything we shipped at Interrupt

Jacob Talbot
May 14, 2026
11
min

LangSmith
Introducing LangSmith Engine

Ben Tannyhill
May 13, 2026
5
min

LangSmith
We built SmithDB, the data layer for agent observability

Ankush Gola
May 13, 2026
11
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.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み