LangChain、ガバナンス型エージェント枠組みを発表
LangChain は、大規模エージェントの導入に伴うコスト管理、制御、コンプライアンスを体系的に解決するための「ガバナンス型エージェント」枠組みを発表した。
キーポイント
ガバナンス型エージェントの定義と必要性
自律性の高いエージェントが企業環境で実用化される際、コストの爆発や制御不能な行動、規制違反という3つの主要リスクを克服するための枠組みとして提案された。
コスト削減と制御の実装手法
トークン使用量の監視、実行ステップ数の制限、およびリソース割り当ての最適化機能を通じて、エージェント運用における経済的持続可能性を確保する仕組みを提供する。
コンプライアンスとセキュリティの強化
データプライバシーの保護や社内ポリシーへの準拠を自動化し、人間による監査と自動的な介入メカニズムを組み合わせてリスクを最小化するアプローチを示している。
重要な引用
Building Governed Agents: A Framework for Cost, Control, and Compliance
cost reduction, control, and compliance
影響分析・編集コメントを表示
影響分析
本記事は、AI エージェントが実験段階から本番環境へ移行する際の最大の課題である「ガバナンス」に対する LangChain の体系的な回答を示しており、企業における AI 導入のスピードと安全性を両立させる重要な指針となる。特にコスト管理とコンプライアンスを技術的枠組みとして統合した点は、実務レベルでのエージェント普及に不可欠なインフラ整備の一歩である。
編集コメント
エージェント技術が実用化される中で、その「制御」と「コスト」をどう設計するかが最大の課題となっており、LangChain のこの枠組みは業界標準の確立に向けた重要な一歩です。技術的な革新性だけでなく、企業の現場で即座に適用可能な実践的なガイドラインとして注目されます。

ゲートウェイは、エンタープライズ AI におけるランタイム制御プレーンです。すべてのモデル呼び出し、ツール呼び出し、エージェント間の遷移において、ポリシーを実行可能な意思決定に変換します。
ガバナンスが重要な理由
エージェントはすでに生産環境のインフラの一部となっています。顧客への回答、コードの作成とデプロイ、社内ナレッジの取得、ビジネスシステム全体でのアクション実行など、多岐にわたる役割を担っています。自律性が高まるにつれて、中核的なガバナンスの課題は、採用を阻害することなく、モデル間・データ間・ツール間・プロバイダー間のあらゆる相互作用に対してポリシーをどのように適用するかという点にあります。
この問題がますます重要視される背景には、3 つの主要な要因があります。第一に、エージェントのワークロードによりトークン消費量が増加し、AI 関連のコスト予測が困難になっています。第二に、ビジネスに不可欠なエージェントでは、プロトタイプ段階には存在しなかった稼働時間(アップタイム)と継続性の要件が生じています。第三に、プライバシーやセキュリティ、そして AI に特化した規制に対応するため、組織は単にポリシーが存在することを示すだけでなく、一貫して適用されていることを実証する必要があります。
規制当局も、エージェント型 AI の急速な成長に対応し始めています。政府は AI の利用方法に関するルールを策定しており、例えば EU AI 法では、AI システムの開発・導入方法を規制するとともに、アプリケーションやユースケースをリスクカテゴリーに分類しています。企業にとってこれらの規制はコンプライアンス上の義務であると同時に、重大な事業リスクとなり、違反すれば多額の罰則が科される可能性があります。
一方、モデル市場も多様化が進んでいます。最先端のモデルプロバイダーはより高性能なモデルを高価格で提供し続ける一方で、オープンソースモデルは品質格差を縮めつつあり、特に チューニングされたエージェント用ハネス と組み合わせれば、コストを大幅に抑えながら運用可能です。そのため企業は、複数のモデルからなるポートフォリオを統括し、どのモデルを許可するか、どのタスクを担当させるか、また品質・コスト・レイテンシ・リスクのバランスをどう取るかを決定する必要があります。
LLM ゲートウェイとは、こうした判断を実行するランタイム制御プレーンです。 企業はこれを通じて一元管理が可能になります:
- 利用認証の実施
- 承認済みモデルの選択
- 露出されるコンテキストの最小化
- データおよび支出ポリシーの強制適用
- 障害への対応
- 意思決定の根拠となる証拠の保存
トレーシング、評価、監視システムと連携させることで、ゲートウェイは時間の経過とともに判断精度を向上させることも可能です。

最大の戦略的メリットの一つは、選択肢の幅が広がることです。セキュリティ、ポリシー、テレメトリクスを各アプリケーションで再実装する必要なく、チームはより優れたモデルを採用し、能力の高いエージェントを構築できます。
ガバナンスの着手点
まず、ガバナンスとは何か。ガバナンスはルールを設定するものであり、ゲートウェイはそのルールを実行する場所です。強力なガバナンスプログラムには、説明責任とリスク管理が不可欠ですが、LLM へのすべてのリクエストに対してこれらのポリシーを適用するのはゲートウェイの役割です。
効果的な運用モデルには、以下の 5 つの要素が必要です:
- ガバナンス:アイデンティティ、所有権、リスクの階層、ポリシーを確立する
- 意思決定:モデルを選択し、必要に応じてリクエストをエスカレートさせ、フェイルオーバーを行う
- 保護:各呼び出し境界で制御を実行する
- 監視:行動の結果を測定する
- 保証:意思決定の系譜を維持し、時間経過に伴う変更を管理する

組織はそれぞれ異なる出発点からスタートします。直ちに優先すべき課題は、どの圧力に最も直面しているかによって異なります。これらは、導入のための 3 つの一般的な入り口です。
- ビジビリティ重視:AI ネイティブ組織では、エージェント利用が急増しているため、トークンの支出を抑制し、その資金がどこで使われ、どのような成果を生み出し、どこに異常な挙動があるのかを理解する必要があります。
- コントロール重視:機密データを扱う組織はまず、プロバイダーへのアクセス、データ所在地、保持期間、赤化(削除)、ユーザーおよびワークロードの権限に関する実行可能なルールが必要です。
- アシュアランス重視:規制が厳しい組織では、まずは制御機能が実際に機能しているという証拠が必要です。ポリシーのバージョン管理、評価結果、監査ログはすべて、この信頼性を支える要素です。
ただし、採用が進むにつれ、企業は最終的にこれら3 つすべてを必要とします。つまり、挙動への可視化、ランタイムでの意思決定に対する制御、そしてシステムが意図通りに動作しているという保証です。
ガバナンスの基盤
ゲートウェイがポリシーを実行できるのは、それが堅牢な基盤の上に成り立っている場合に限られます。基盤となるプラットフォーム自体が安全でなければ、その上に構築されるルーティングやポリシーロジックをいくら強化しても補うことはできません。エージェントのトラフィックを管理する前に、まずそのエージェントが動作する環境を統制する必要があります。

セキュリティ
エージェントガバナンスは、エンタープライズインフラに求められるすべての要件を引き継ぎます。保存時および転送中の暗号化、顧客とプラットフォームプロバイダー間の明確な責任分担モデル、そして独立したセキュリティ検証です。これは最低限の条件であり、当然のものとして扱われます。
認証とアイデンティティ管理
エージェントおよびその運用担当者は、他のエンタープライズシステムと同様の方法で認証を行う必要があります。
これには、SAML や OIDC を通じたシングルサインオン(SSO)に加え、新しい従業員が手動のチケット発行や事後対応を待たずに自動的にアクセス権を取得できる「即時プロビジョニング」機能も含まれます。
ユーザーのアイデンティティを組織の ID プロバイダーに統合し、個別のログインシステムから分離することで、ユーザーの権限剥奪(デプロビジョニング)は単一の操作で完了します。複数のツールにまたがるチェックリスト作業が不要になるのです。
監査ログ
重要な AI の相互作用すべては証明可能であるべきです。監査ログには、誰がワークロードを実行したかやポリシーを変更したかだけでなく、「どのバージョンのポリシーが適用されたか」「どのような結果が生じたか」「どのツールやプロバイダーが利用されたか」といった詳細も記録する必要があります。
これらの証拠を安全に保存するためには、保持期間とアクセス権限に関するポリシーを整備しておくことが不可欠です。
ユーザー管理
アクセス制御は、複数の粒度レベルで機能する必要があるものです。ロールベースのアクセス制御(RBAC)を利用すれば、組織全体の方針を設定できる権限や、財務・規制関連データへの閲覧権限など、継承された権限を持つロールを割り当てることが可能です。
SCIM や同様の標準規格を用いれば、ユーザーのプロビジョニングとデプロビジョニングを自動化できます。これにより、従業員の入社、異動、退社に合わせてロールの付与、更新、取り消しを自動的に実行することが可能になります。
プロバイダーシークレット
API キーを管理する最もリスクの高い方法は、必要なすべてのエージェントにキーを埋め込むことです。
プロバイダーのシークレットは、1 つの集中管理場所に保存し、一度だけ登録するのが基本です。必要に応じてアクセス権限を特定のチームに限定することも理想的な運用です。
キーのローテーションが必要な場合も、各エージェントやアプリケーションで個別に追跡・変更するのではなく、中央の 1 か所を変更するだけで済むように設計すべきです。
データ分離
大規模組織では、すべてのチームがあらゆるトレース、データセット、エージェントの実行履歴を閲覧できるべきではありません。
チームやワークスペースは隔離し、各ユーザーがアクセスできるのは自身の責任範囲に関連する情報に限定します。組織全体で過去に蓄積されたすべてのログを参照できるようにする必要はありません。
データ所在地
規制の厳しい業界や地域においては、データ所在地(データレジデンシー)はコンプライアンス上の重要な要件です。
組織によっては、トレースやその他の運用データを特定の地理的範囲またはインフラ構成内でのみ保存・処理する必要がある場合があります。これは、ベンダープラットフォームのデフォルト設定とは異なるケースも珍しくありません。
これらの機能を組み合わせることで、ゲートウェイは信頼性の高いものとなり、セキュアなエンタープライズプラットフォーム上で運用するための基盤が整います。
何をガバナンスすべきか
組織はまず、実際に何を管理・統制しようとしているのかを明確に定義する必要があります。
LLM の呼び出し、ツールの呼び出し、MCP(Model Context Protocol)の呼び出し、そしてエージェント間(A2A)のやり取りは、それぞれ異なるリスクとガバナンス要件を伴います。
LLM の呼び出しによって機密情報がプロバイダーのログに漏洩する可能性があります。ツールの呼び出しが、機密性の高いシステムレコードに対して意図しない操作を実行することもあります。MCP(Model Context Protocol)の呼び出しでは、データが組織のインフラ境界外へ送信されるリスクがあります。さらに、エージェント間での相互作用により、不正なコンテキストがエージェントチェーンを越えて伝播する恐れもあります。
LLM ゲートウェイを導入する前に、組織はこれらの相互作用のうち、どのものを制御・監視する必要があるかを明確に定めるべきです。
| 相互作用 | リスク内容 | 一般的なガバナンス要件 |
|---|---|---|
| LLM の呼び出し | コスト、モデルの可用性、プライバシーデータ | 支出制限、情報隠蔽(レッドクション)、プロバイダーの振り分け |
| ツールの呼び出し | 本番システムにおける意図しない操作 | 権限管理、監査証跡の確保 |
| MCP の呼び出し | インフラ境界外へのデータ流出 | アクセス制御、ログ記録 |
| エージェント間相互作用(A2A) | エージェントチェーン全体でのエラーの連鎖や不正アクセス | トレーシング、各ホップにおけるポリシー強制 |
エージェントにとって最大のリスクは、モデルが何を言うかではなく、エージェントが何を実行できるかにあります。
したがって、ガバナンスはコンテンツフィルタリングに留まらず、アクション制御まで拡張されなければなりません。具体的には、エージェントが呼び出せるツールの範囲、付与される認証情報の種類、そして人間の承認が必要な判断のタイミングを明確に定義する必要があります。
ガバナンスの実施方法
ゲートウェイ構築の真のコストを評価する
基本的な転送層を構築するのは比較的容易です。しかし、その周囲に制御機能を実装し、調整し、維持し続ける作業は非常に時間がかかります。
ガードレール(安全装置)は慎重に調整する必要があります。重要な情報に対して誤検知(偽陽性)が発生しないようにするためです。ゲートウェイを重要インフラとして運用するには、プロバイダーとの継続的な連携、キャッシュ・バッチ処理・推論トークンの正確な課金管理、モデルの廃止対応、そして信頼性の高い監査証跡の確保が不可欠です。
組織が真に検討すべきは、本番環境で制御プレーン(管理層)を運用し続けるための長期的なコストとリスクを負うかどうかという点です。
エージェントスタックにガバナンスを組み込む
スタンドアロンのゲートウェイであればポリシーの強制は可能ですが、なぜその呼び出しが発生したのか、エージェントが次に何を行ったのか、あるいは途中経過で明示的なポリシーを通過・違反したのかなどを説明することはできません。
しかし、トレーシング(追跡)、評価、モニタリングと連携させたゲートウェイであれば可能です。
支出ポリシーによってリクエストがブロックされた場合、その違反情報はトレーシング内に記録され、詳細を検査できます。チームはツール間を行き来することなく、なぜポリシーが発動したのかを理解し、アプリケーション側かポリシー側のどちらを変更すべきかを判断できます。
エージェントスタックとの統合により、ゲートウェイはエージェントのパフォーマンスを継続的に改善する役割も果たします。評価を通じて、より小型のモデルや短いプロンプト、あるいは異なるポリシーを採用しても品質が維持できるかを判断できます。エージェント開発ライフサイクルに組み込まれたゲートウェイであれば、すべての呼び出しを即座に活用可能な情報に変換できます。
導入をシンプルかつ中央管理で実現する
標準的なモデルトラフィックにおいては、導入はベース URL の切り替えから始めます。既存のクライアントをプロバイダではなくゲートウェイへ指し示すだけで、追加のコード変更なしに動作します。
この切り替え作業を中央一括管理することで、個々の従業員が手動で設定を変更する必要がなくなります。中央集権的な設定により導入を加速でき、各チームが個別にガバナンスを実装する手間も省けます。
本番負荷下でのゲートウェイの信頼性維持
レジリエンスと障害時の挙動
ゲートウェイは重要なパス上に位置するため、単一障害点(SPOF)になってはいけません。信頼性を確保するにはプロバイダのフォールバック機能だけでは不十分です。タイムアウト処理、負荷分散、そしてワークロードのリスクに応じた明示的なフェイルオープン/フェイルクローズの挙動が不可欠です。ゲートウェイによるガバナンスの有効性は、トラフィックをいかに確実に通過させられるかにかかっています。
フォールバック
プロバイダーの障害、モデルの廃止、そして最もタイミングが悪い瞬間にレート制限が適用されることは避けられません。ゲートウェイには、リクエストが完全に失敗した場合や、自動的にセカンドモデルへフェイルオーバーする場合など、次のアクションを定義した回答を用意しておく必要があります。バックアップモデルとして有効とみなされるのは、ポリシー上同等である場合に限られます。つまり、データ処理、居住地域、安全性に関する要件を同じく満たしていることが条件です。この違いが、問題なく継続的なサービスを提供できる企業を分けます。
レート制限とアラート
プロバイダーのレート制限は、下流での障害やユーザー体験の低下を引き起こす可能性があります。ゲートウェイ内でレート制限を適用することで、必要に応じて代替モデルへルーティングし、制限に達するのを防ぐことができます。また、これらの制限はエージェントの健全性を示す有用な指標にもなります。もしエージェントが定期的にレート制限に抵触し始めたら、それは何らかの問題を抱えている兆候かもしれません。
ゲートウェイは、利用状況やポリシーの閾値に近づいた場合、あるいは到達した場合にチームへ通知する必要があります。これにより、チームは支出を先回りして管理し、予算内で運用し続けることが可能になります。
価格の正確性
プロバイダーは頻繁に料率を変更します。キャッシュ読み取りや推論トークン、バッチ料金など、新たな課金 tiers を追加することもあります。単にその時点での価格を正確に保つだけでなく、ワークロードの実効価格がいつ変更されたかを確認できる仕組みも必要です。この変化を早期に検知できれば、システム全体をコスト効果高く運用できます。
モデルへのアクセス
Anthropic、OpenAI、Google、AWS Bedrock などの主要プロバイダーやホスト、さらに OpenAI 互換エンドポイント経由でのオープンウェイトモデルなど、一般的なモデルエンドポイントを内蔵でサポートしています。これにより、組織はエージェントワークロードに対して柔軟な対応が可能になります。例えば、アプリケーションの再構成を必要とせずに、ワークロードをより安価なオープンウェイトモデルへルーティングすることも可能です。
AI コストとモデル選択のガバナンス
企業では、年間の AI バudget が数ヶ月で使い切られてしまうリスクがあります。これは開発者個人レベルでも同様です。無人で動作するコーディングエージェント、リトライループに陥ったエージェント、あるいは範囲設定が不適切なバッチジョブを実行しているエンジニアが一人いれば、誰も気づかないうちに単一のセッションで数千ドルの請求が発生してしまう可能性があります。
支出管理
支出ポリシーは、組織の構造を反映したものであるべきです。制限は、組織全体、事業部、チーム、API キー、あるいは個別ユーザーレベルまで細かく適用できます。
また、API キーを活用すれば、目に見えにくい利用状況の側面を追跡する実用的な手段となります。キーは特定のサービスやエージェントに紐づくことが多いため、クライアントやワークロードごとに 1 つずつキーを割り当てることで、追加の追跡システムを構築することなく、利用状況を監視し上限を設定することが可能になります。
ポリシーは、日次・週次・月次の制限として階層的に設定できます。デフォルトのポリシーを用意しておくことで、各チームやワークロードごとに個別に設定する手間を大幅に削減できます。
モデルルーティング
モデルルーティングは、ポートフォリオ管理の一形態です。多くの人はこれを「簡単なプロンプトを低コストなモデルに送る手段」と捉えがちですが、実際には各タスクに対して、その用途に承認されたモデルを選定し、品質・レイテンシ・コスト・リスクの基準を満たすようにマッチングさせる仕組みでもあります。
小規模または特化型のモデルは、ルーティングや分類といった限定的なタスクを担い、より高度な能力を持つモデルは、深い推論が必要な業務に割り当てるのが効果的です。
コンテキスト効率
トークン使用量は、エージェントが各ターンで送信するコンテキストの量によって大きく決定されます。コンテキスト効率とは、不必要な情報を最小化することでコストとレイテンシを削減し、同時に機密データの露出を抑えることを指します。この文脈では統合システムが極めて価値があります。トレーシング(追跡)によりチームはコンテキストの増大を特定でき、評価(evals)によって安全に削除できるコンテキスト量を把握でき、モニタリングによって変更後の品質低下を検知できるからです。
支出ポリシーは単なる財務管理ツールではありません。ポリシー違反が突発的に急増することは、エージェントに何らかの問題が生じている最初の兆候であることが多く、エンジニアがそれに応じて調査を開始するきっかけとなります。適切なアラート設定を施していれば、この手法は特に有効です。
ランタイムにおける機密データの保護
この節は、コンプライアンスフレームワークの対象となる方々や、機密データを扱う方々を対象としています。こうしたケースでは、データ保護はオプションのインフラではなく、規制当局による監査やデータ侵害の開示時に企業を守るための必須基盤です。
企業が AI システムを統制する上で、以下の規制が重要な役割を果たしています。
| 規制 | 管轄区域 | 主な要件 |
|---|---|---|
| CCPA(カリフォルニア州消費者プライバシー法) | アメリカ・カリフォルニア州 | 消費者に対し、収集された個人データの把握、削除請求、販売拒否の権利を付与します。特定の収益規模やデータ量以上の企業に適用されます 詳細はコチラ。 |
| GDPR(一般データ保護規則) | ヨーロッパ連合 | EU 居住者の個人データの収集・保存・処理を規律し、処理の正当な根拠を求めます。同時に、本人が自身のデータへのアクセス、訂正、削除を請求する権利を保障しています。 |
| EU AI Act(EU AI 法) | ヨーロッパ連合 | AI システムをリスクレベル別に分類し、そのリスクに応じて透明性確保、人間の監督、文書化などの義務を負わせます。これらの義務は数年かけて段階的に施行されます。 |
| HIPAA(医療保険の携行性と責任に関する法律) | アメリカ | 保護対象となる健康情報の取り扱いを規律します。保存・アクセス・送信における安全対策の実施に加え、そのデータに関与するすべてのベンダーとの「ビジネスアソシエイト契約」締結が義務付けられています。
すべての規制が全企業に適用されるわけではありません。コンプライアンス要件が増えるごとに、コストやレイテンシ、運用の複雑さが増大するため、統制措置は慎重かつ意図的に導入する必要があります。
ガイドレール(ガードレール)の仕組み
ガイドレールとは、LLM プロバイダへ送信されるリクエスト内に特定のパターンが含まれているかを判定するロジック層です。 評価対象に応じて、検出方式は「パターンベース」または「モデルベース」のいずれかになります。
パターンベースの検出は、社会保障番号、クレジットカード番号、メールアドレス、API キーなど、規則的で予測可能なフォーマットに対して効果を発揮します。これらの形式は、大幅なコスト増やレイテンシを招くことなく、正規表現(regex)やルールベースで確実に検出可能です。
一方、モデルベースの検出は、固定されたパターンに従わない情報を扱うのに適しています。名前、場所、政治的・宗教的な所属などは、「アイビーアップル」という単語が人名なのか果物の名称なのかを判断するために文脈が必要です。これは個人情報(PII)に限らず、プロンプトインジェクションや Jailbreak 試行、根拠のない出力など、毎回異なる形で現れる他のガードレールにも当てはまります。
ガイドレールはリスクを低減しますが、ゼロにはできません。パターンベースの統制では未知のフォーマットを見逃す可能性がありますし、モデルベースの検出は確率的な性質を持つため、誤検知(偽陽性)や見落とし(偽陰性)が発生する余地が残ります。
そのため、ガードレールは明確なデータとツールの境界線によって強化されるべきです。重大なアクションは、コンテンツ検出のみに頼るのではなく、決定論的な制限や人間の承認に基づいて行う必要があります。
| Guardrail | 説明 |
|---|---|
| 構造化されたPII検出 | SSN、電話番号、同様のフォーマットの識別子に対する正規表現およびパターンベースのマッチング |
| 非構造化されたPII検出 | 固定されたパターンに従わない名前、場所、所属関係に対する名前付きエンティティ認識 |
| シークレット検出 | 一般的なプロバイダーにわたるAPIキー、トークン、認証情報に対するパターンベースのマッチング |
| ジャイルブレイク | モデルの安全機能の回避を試みる行為の検出 |
| 根拠のあるチェック | 提供されたソースデータや文脈に基づかない出力のフラグ付け |
結論
エージェントはすでに生産インフラへと進化しています。これらは多大な予算を消費し、機密性の高いデータやツールにアクセスし、ダウンタイムや誤ったアクションが直接的なビジネス被害をもたらすワークフローをますます支えています。
したがって、ガバナンスはもはや各チームが個別に行う承認やポリシーの寄せ集めでは済まされません。
LLMゲートウェイは、ランタイム制御プレーンとして機能します。これは、エージェント全体におけるモデルアクセス、コンテキスト、支出、障害、およびポリシー適用を統括するための共有レイヤーです。
その戦略的価値は単なる集中化を超えています。アプリケーションとモデルの不安定性を分離しつつ、プロバイダーや価格、機能が変化する中でも企業のコントロールを維持できるのです。
ガバナンスは、企業が現在のモデルに縛り付けられるためのものではなく、変化をより安全なものにするためのものです。
ゲートウェイでの意思決定がトレーシング(追跡)、評価、モニタリングと連携すれば、企業はルーティングやコンテキスト、ポリシーの選択が、意図した品質、経済性、リスク管理体制を実現できているかを継続的にテストできます。
これが LangSmith LLM Gateway の基本理念です。チームがエージェントをトレースし、評価し、監視するプラットフォームで、同時にガバナンスも行うことができます。これにより、すべてのモデル呼び出しが、管理され、可視化され、継続的に改善可能な意思決定へと変わります。
AI ガバナンスの専門家と話し合い、LangSmith LLM Gateway について詳しく知りたい方は、チームにご連絡ください。
関連コンテンツ

コンセプトガイド
LangSmith
エージェントには専用のコンピューターが必要です。安全に与える方法はこちら。

Amy Ru
2026 年 7 月 15 日
12 分

LangChain
LangSmith
観測可能性と評価
コーディングエージェントの請求額が倍増した。その対策とは。

Amy Ru
2026 年 7 月 2 日
6 分

LangSmith
コーディングエージェントの費用を予測可能にする方法

Martha Janicki
2026 年 6 月 15 日
5 分
エージェントの実際の動作を確認する
エージェントエンジニアリングプラットフォームである LangSmith を使えば、開発者はあらゆるエージェントの意思決定をデバッグし、変更の評価を行い、ワンクリックでデプロイできます。
原文を表示

*The gateway is the runtime control plane for enterprise AI, turning policy into enforceable decisions across every model call, tool call, and agent hop.*
Why governance matters
Agents are becoming part of production infrastructure. They answer customer questions, write and deploy code, retrieve company knowledge, and take action across business systems. As their autonomy grows, the central governance question is how policy can be enforced on every interaction across models, data, tools, and providers without slowing adoption.
Three key drivers are making this issue increasingly important. First, agent workloads are consuming more tokens and making AI spend harder to predict. Second, business-critical agents introduce uptime and continuity requirements that prototypes did not have. Third, privacy, security and AI-specific regulations require organizations to demonstrate not only that policies exist, but that they are applied consistently.
Regulators are also responding to the rapid growth of agentic AI. Governments are writing rules for how AI can be used. For example, the EU AI Act regulates how AI systems are developed and deployed, categorizing applications and use cases into risk categories. For enterprises, these regulations create both a compliance obligation and a material business risk, with significant penalties for noncompliance.
At the same time, the model market is becoming more diverse. Frontier model providers continue to ship more capable models at higher prices, while open-source models are narrowing the quality gap, particularly when paired with a tuned agent harness, and can operate at a fraction of the cost. Enterprises therefore need to govern a portfolio of models and determine which models are permitted, which tasks they can handle, and how quality, cost, latency, and risk should be balanced.
An LLM gateway is the runtime control plane for those decisions. It gives enterprises a single place to:
- Authenticate usage
- Select approved models
- Minimize exposed context
- Enforce data and spending policies
- Manage failures
- And retain evidence as to what decisions were made.
When connected to tracing, evaluation, and monitoring systems, the gateway can also improve those decisions over time.

One of the biggest strategic benefits is optionality. Teams can adopt better models and build more capable agents without reimplementing security, policy, and telemetry in every application.
Starting points for governance
First, what is governance? Governance sets the rules, while a gateway enforces them. A strong governance program still requires accountability and risk management, but the gateway is where those policies are applied to every LLM request.
A useful operating model has five parts:
- Govern: Establish identity, ownership, risk tiers, and policy
- Decide: Select models, escalate requests, and fail over when needed
- Protect: Enforce controls at each call boundary
- Observe: Measure behavior outcomes
- Assure: Preserve decision lineage and manage change over time

Organizations begin from different starting places. Their immediate priorities depend on which of the following pressures they face most. These are three common entry points:
- Visibility-led: AI-native organizations with rapidly growing agent usage need to rein in token spend and understand where those tokens are being consumed, what outcomes are produced by this spend, and where the behavior is anomalous.
- Control-led: Organizations handling sensitive data first need enforceable rules for provider access, residency, retention, redaction, and user and workload permissions.
- Assurance-led: Highly regulated organizations first need evidence that their controls work. Policy versioning, evaluation results, and audit logs all contribute to that assurance.
As adoption grows, however, enterprises will ultimately need all three: visibility into behavior, control over runtime decisions, and assurance that the system is operating as intended.
The foundations of governance
A gateway can only enforce policy when it is used on a strong foundation. If the underlying platform is not secure, no amount of routing or policy logic above it can compensate. Before governing agent traffic, organizations must first govern the environment in which those agents operate.

Security
Agent governance inherits everything expected of enterprise infrastructure: encryption at rest and in transit, a clear shared-responsibility model between the customer and platform provider, and independent security verification. This part is table stakes.
Authentication and identity
Agents and the people who operate them need to authenticate the same way as other enterprise systems.
This can include SSO through SAML or OIDC, along with just-in-time provisioning that allows new employees to receive access automatically rather than through manual tickets and follow-up.
When identity is connected to the organization’s identity provider rather than a separate login system, deprovisioning a user is one action instead of a checklist across five tools.
Audit logs
Every consequential AI interaction should be provable. Audit logs should capture not only who ran a workload or changed a policy, but also which policy version was applied, what outcome was produced, and which tools or providers were used.
Retention and access policies must preserve that evidence securely.
User management
Access controls need to work at multiple levels of granularity. Role-based access control allows organizations to assign roles with inherited permissions, such as the ability to set organization-wide policies or view financial and regulatory data.
SCIM and similar standards can automate user provisioning and deprovisioning, so roles are assigned, updated, and revoked as employees join, move within, or leave the company.
Provider secrets
The riskiest way to manage API keys is to encode them into every agent that needs one.
Provider secrets should be stored in one centralized location, stored once, and ideally limited to specific teams that need them. When a key needs to be rotated, it should need to be changed only once, rather than tracked down across every agent or application in which it appears.
Data separation
In large organizations, not every team should be able to view every trace, dataset, or agent run.
Teams and workspaces should be isolated so that each user can access only the information relevant to their responsibilities, rather than everything the organization has ever logged.
Data residency
For regulated industries and geographies, data residency is a critical compliance requirement. Organizations may need to store and process traces and other operational data within a specific geographic or infrastructure footprint, which may differ from the default footprint of a vendor’s platform.
Together, these capabilities make a gateway trustworthy and form the foundation for operating one within a secure enterprise platform.
What needs to be governed
Organizations should first define what they are actually trying to govern.
LLM calls, tool calls, MCP calls, and agent-to-agent (A2A) interactions each carry different risk and governance requirements.
An LLM call might leak PII into provider logs. A tool call might take an action on a sensitive system of record. An MCP call might send data outside the organization’s infrastructure boundary. An agent-to-agent interaction might pass unauthorized context across a chain of agents.
Before selecting an LLM gateway, organizations should determine which of these interactions they need to control and observe:
Interaction
What’s at risk
Typical governance requirement
LLM calls
Cost, model availability, private data
Spend limits, redaction, provider routing
Tool calls
Unintended actions in production systems
Permissioning, audit trail
MCP calls
Data leaving your infrastructure boundary
Access control, logging
A2A interactions
Compounding errors or unauthorized access across agent chains
Tracing, policy enforcement at each hop
For agents, the greatest risk is often not what the model says, but what the agent can do.
Governance must therefore extend beyond content filtering and into action: which tools an agent can call, which credentials it receives, and when a human must approve a decision.
How to enforce governance
Evaluate the true cost of building a gateway
Building a basic forwarding layer is relatively straightforward. Building, tuning, and maintaining the controls around it all is the time-consuming work.
Guardrails must be tuned carefully so that they do not produce false positives on critical information. Operating a gateway as critical infrastructure requires continuous provider integration work, accurate accounting for cached, batch and reasoning tokens, model deprecation management, and reliable audit evidence.
The real consideration for organizations is if they want to take on the long-term cost and risk of running a production control plane.
Build governance into the agent stack
A standalone gateway can enforce policy, but it cannot always explain why a call happened, what the agent did next, or whether it passed or failed explicit policies along the way.
A gateway connected with tracing, evaluations, and monitoring can.
When a spend policy blocks a request, that violation appears within a trace that can be inspected. Teams can understand why the policy triggered and determine whether the application or policy needs to change without switching between tools.
Integration with the agent stack also enables the gateway to support continuous improvement of your agent’s performance. Evaluations can determine whether a smaller model, shorter prompt, or different policy preserves quality. A gateway wired into the rest of the agent development lifecycle turns every call into information it can act on.
Make adoption simple and centrally managed
For standard model traffic, adoption should begin with a base_url swap: point your existing client at the gateway instead of the provider directly, and it should work with no other code changes.
This swap can be managed centrally so that individual employees do not have to make the change manually. Central configuration can accelerate adoption and prevents every team from having to implement governance independently.
Keep the gateway reliable under production load
Resilience and failure behavior
Because the gateway sits in a critical path, it cannot become a single point of failure. Reliability requires more than just provider fallbacks. It requires timeouts, load balancing, and explicit fail-open/fail-closed behavior based on workload risk. The effectiveness of a gateway’s governance depends on its ability to pass through traffic reliably.
Fallbacks
Providers experience outages, models get deprecated, and rate limits can hit at the worst possible moments. A gateway needs a defined answer for what happens next – whether the request fails outright or it fails over to a second model automatically. A backup model is considered valid only when it is policy-equivalent, meaning it satisfies the same requirements for data handling, residency, and safety. This differentiates companies that can provide continual service without issue.
Rate limits and alerts
Provider rate limits can create downstream failures and degraded user experiences. By enforcing rate limits within the gateway, organizations can avoid hitting limits by routing to an alternative model as needed. These limits are also useful indicators of agent health. If an agent starts regularly hitting rate limits, that might be an indication that it has a problem.
The gateway should notify teams when usage or policy thresholds are approaching or have been reached. This enables teams to manage spending proactively and stay within budget.
Price accuracy
Providers change their rates often, adding new tiers such as cache reads, reasoning tokens, or batch pricing. Beyond keeping prices accurate at a point in time, teams should be able to see when the effective price of a workload changes. Catching this early allows the whole system to run cost effectively.
Model access
Built-in support for common model endpoints, both frontier providers and hosts (Anthropic, OpenAI, Google, AWS Bedrock, and others), and open weight models (via OpenAI-compatible endpoints) gives organizations flexibility across agent workloads. This makes it possible to route a workload to a cheaper open-weight model without requiring applications to be reconfigured.
Governing AI cost and model choice
Companies can burn through annual AI budgets in a matter of months, and the same risk exists at the individual developer level. A single engineer running an unattended coding agent, an agent caught in a retry loop, or a poorly scoped batch job can run up thousands of dollars in a single session before anyone notices.
Spend controls
Spend policies should reflect the structure of the organization. Limits can be applied at the organization, business unit, team, API key, or individual user level.
API keys can also provide a practical way to track less obvious dimensions of usage. Because a key often maps to a specific service or agent, assigning one key per client or workload makes it possible to monitor and cap usage without building a separate tracking system.
Policies can be layered across daily, weekly, and monthly limits, while default policies reduce the work required to configure every team or workload individually.
Model routing
Model routing is a form of portfolio management. Most people think of model routing as a way to send easy prompts to cheaper models, but it also matches each task with a model that is approved for that use case and meets the required standards for quality, latency, cost, and risk.
Smaller or more specialized models can handle routing, classification, or other narrow tasks, while more capable models can be reserved for work that requires deeper reasoning.
Context efficiency
Token usage is largely determined by how much context agents send on every turn. Context efficiency means minimizing unnecessary information to reduce cost and latency while limiting the exposure of sensitive data. Having an integrated system is valuable in this context, as tracing can help teams identify context growth, evals establish how much context can safely be removed, and monitoring can detect quality regressions after changes are made.
Spend policies are not just a finance tool. A sudden spike in policy violations is often the first sign that something is wrong with an agent so that an engineer can investigate accordingly. This is especially effective with proper alerting set up.
Protecting sensitive data at runtime
This section applies to those who are subject to a compliance framework and/or are handling sensitive data. In these cases, data protection is not optional infrastructure, protecting a company during a regulatory inspection or breach disclosure.
The following regulations shape how companies govern AI systems:
Regulation
Jurisdiction
Broad requirements
CCPA (California Consumer Privacy Act)
California, USA
Gives consumers the right to know what personal data is collected, request deletion, and opt out of its sale. It applies to companies meeting certain revenue or data-volume thresholds.
GDPR (General Data Protection Regulation)
European Union
Governs the collection, storage, and processing of personal data for EU residents; requires a lawful basis for processing and grants individuals rights to access, correct, and delete their data
EU AI Act
European Union
Classifies AI systems by risk level and imposes obligations (transparency, human oversight, documentation) that scale with that risk; obligations are phasing in over several years
HIPAA (Health Insurance Portability and Accountability Act)
United States
Governs protected health information; requires safeguards around storage, access, and transmission, as well as a Business Associate Agreement with any vendor that touches that data
Not all of these regulations apply to all companies. Each additional compliance requirement can introduce cost, latency, and operational complexity, so controls should be applied deliberately.
How guardrails work
Guardrails are logic layers that identify whether a particular pattern is present in the request being sent to the LLM provider. Depending on what is being assessed, detection may be pattern-based or model-based:
Pattern-based detection works well for regular, predictable formats such as Social Security numbers, credit card numbers, email address, and API keys. These formats can often be detected reliably with regex or rules without adding significant cost or latency.
Model-based detection is better suited for information that does not follow a fixed pattern. Names, locations, political affiliations, and religious affiliations require context to determine whether a term like “Ivy Apple” is a name or, say, a fruit. This applies beyond PII and towards other guardrails as well, such as prompt injection, jailbreak attempts, or ungrounded output, all of which appear differently every time and require context.
Guardrails reduce risk, but they do not eliminate it. Pattern-based controls may miss unfamiliar formats, while model-based detection is probabilistic and can produce both false positives and false negatives.
For that reason, guardrails should be reinforced with clear data and tool boundaries. Consequential actions should rely on deterministic limits or human approval rather than relying on content detection alone.
Guardrail
Description
Structured PII detection
Regex and pattern-based matching for SSNs, phone numbers, and similarly formatted identifiers
Unstructured PII detection
Named-entity recognition for names, locations, and affiliations that don't follow a fixed pattern
Secrets detection
Pattern-based matching for API keys, tokens, and credentials across common providers
Jailbreak
Detecting attempts to bypass a model's safety behavior
Groundedness checks
Flagging outputs that aren't grounded in the source data or context provided
Conclusion
Agents are becoming production infrastructure. They consume substantial budgets, operate across sensitive data and tools, and increasingly support workflows in which downtime or incorrect action has direct business consequences.
Governance can therefore no longer remain a collection of approvals and policies applied separately by every team.
An LLM gateway provides the runtime control plane: a shared layer for governing model access, context, spend, failures, and policy enforcement across agents.
Its strategic value extends beyond centralization. It separates applications from model volatility while preserving enterprise control as providers, prices, and capabilities change.
Governance should not lock an enterprise into today’s models; it should make change safer.
When gateway decisions are connected to tracing, evaluation, and monitoring, enterprises can continuously test whether their routing, context, and policy choices are producing the intended quality, economics, and risk posture.
This is the premise of the LangSmith LLM Gateway: the same platform where teams trace, evaluate, and monitor agents is where they govern them. This turns each model call into a governed, observable, and continuously improvable decision.
*Interested in chatting with an AI Governance expert and learning about LangSmith LLM Gateway? *Meet with our team*.*
Related content

Conceptual Guide
LangSmith
Agents need their own computer. Here's how to give them one safely.

Amy Ru
July 15, 2026
12
min

LangChain
LangSmith
Observability & Evals
Your coding agent bill doubled. Here’s how to fix it.

Amy Ru
July 2, 2026
6
min

LangSmith
How We Made Coding Agent Spend Predictable

Martha Janicki
June 15, 2026
5
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日報で今日の重要ニュースをまとめ読み