Cloudflare、AI 利用の不正挙動検出にアイデンティティ認識型分析を導入
本文の状態
日本語全文を表示中
詳細モードで約15分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Cloudflare AI
Cloudflare は AI Gateway に Identity-aware の機能を追加し、各リクエストにユーザーIDを付与することで、AI 利用の可視化と予算管理を実現した。
AI深層分析を開く2026年8月5日 22:26
AI深層分析
キーポイント
Identity-aware AI Gateway の公開
Cloudflare Access と統合された Identity-aware AI Gateway がオープンベータとなり、各リクエストに検証済みユーザーIDを付与する機能を強化した。
AI 利用の可視化と異常検知
各個人やエージェントごとの行動ベースラインを作成し、使用量の急増や不正な挙動を検出することで、セキュリティと財務リスクを同時に管理可能にする。
SAML 認証と予算管理の実装
Okta や Entra などの SAML プロバイダーとの連携により、API キーの共有を防ぎつつ、ユーザーごとの支出制限を設定して予期せぬ請求を防止する。
ID 認識型分析による不正検知
Cloudflare Access を AI Gateway に導入することで、各リクエストに認証されたアイデンティティを付与し、既存のアクセスポリシーを適用可能にする。
セッションベースの異常検出アルゴリズム
単一リクエストではなくセッション単位でスコアリングを行い、過去 30 日間の p95 コストと比較して 2 倍以上の増減を異常として検知する。
重要な引用
Knowing who is doing what with AI is one of the key challenges organizations are confronting right now.
This is a security problem as much as a financial one.
No more surprise invoices, and no shared API key hiding who spent what.
"Shared API keys make it almost impossible to tell who is using an AI service or apply the access rules we already have for employees."
編集コメントを表示
編集コメント
AI の普及に伴い、利用状況の把握とコスト管理は組織にとって喫緊の課題となっている。Cloudflare は既存のインフラに認証機能を統合することで、開発者が追加の複雑さなくガバナンスを実現できる道筋を示している。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
AI の利用料金を確認した際、何らかの異常があるかどうかを判断するのは容易ではありません。まずは正常な状態の基準(ベースライン)を設定し、そこからの変化を検出する必要があります。例えば、エージェントが暴走したり、従業員の利用率が 10 倍に急増したりするケースです。こうした変化を早期に検知できれば調査を開始できますが、現状ではその検知が難しいのが実情でした。
AI を誰がどのように利用しているかを把握することは、組織が現在直面している最大の課題の一つです。スタンフォード大学のレポートによると、組織の 59% が「知識不足」を責任ある AI ガバナンスにおける最大の障壁だと回答しています。
これは金銭的な問題であると同時に、セキュリティ上の重大なリスクでもあります。これらの課題を解決するには二つの要素が必要です。一つは、すべてのリクエストに検証済みの身元情報を紐付けること(利用率の急増があれば、その背後にある人物名が明確になるようにします)。もう一つは、各ユーザーやエージェントにとっての「通常の利用パターン」を把握することです。本日、私たちはこの両方を提供することを発表いたします。
Cloudflare Access を活用したアイデンティティ対応型 AI Gateway がオープンベータ版として利用可能になりました。また、User Insights はすべての AI Gateway 顧客に対して追加料金なしで一般提供を開始します。これら二つを組み合わせることで、AI Gateway を通じて流れる既存のトラフィックを、各ユーザーやエージェントごとの行動ベースラインに変換し、そこから逸脱した異常な利用を検出できるようになります。
AI Gateway とは何か?
AI Gateway は、組織内のすべての AI 利用を管理する中央制御プレーンです。これまで各アプリやチームが OpenAI、Anthropic、Google、Workers AI のモデルに直接アクセスしていたのをやめ、すべてのリクエストをまず AI Gateway に経由させることで、AI 利用の監視、セキュリティ強化、ガバナンスを一元的に行えるようになります。
このソリューションは、あなたが構築するアプリケーションや、開発者が日常的に使用するコーディングツールとシームレスに連携します。AI Gateway を介して Claude Code、Codex、GitHub Copilot といったエージェント型ツールの利用を一元管理し、他のすべてのリソースと同様の可視性と制御性を確保できます。
ID 認識型の AI Gateway
AI Gateway と Cloudflare Access の統合により、ゲートウェイの前面に独自ドメインを設定し、Access を用いて保護することが可能です。これは一般的なアプリケーションと同じアプローチです。具体的には以下のことが実現できます。
Okta や Entra など SAML に準拠した ID プロバイダとの認証が可能になり、Cloudflare API キーの生成や管理が不要になります。
ゲートウェイへのアクセス権限を持つユーザーを厳密に指定するポリシーを設定できます。
ai.example.com のように、URL にアカウント ID やゲートウェイ ID を含まないクリーンなホスト名へリクエストを送信可能です。
認証されたすべてのリクエストには、Access から取得したユーザーの ID が付与されます。AI Gateway は、検証済みの Access ユーザー ID を cf.user_id としてリクエストメタデータに追加するため、誰が実際にリクエストを行ったかによってログや分析、コストをフィルタリングできます。
支出制限と組み合わせることで、この ID 情報は予算管理ツールとしても機能します。各リクエストに実在するユーザー情報が紐づくため、ユーザーごとの支出上限を設定可能です。各ユーザーに独自の予算枠を与え、上限に達した場合は追加のリクエストをブロックするか、より安価なモデルへフォールバックさせることができます。予期せぬ請求書の発生を防ぎ、誰がいくら使ったか不明瞭になる共有 API キーの問題も解消されます。
この種の課題に直面した初期採用者の一つが Flexport です。
Flexport のスタッフセキュリティエンジニア、Max Baumgarten 氏はこう指摘します。「共有 API キーでは、誰が AI サービスを利用しているのかを特定することも、従業員向けにすでに適用しているアクセスルールを適用することもほぼ不可能です。Cloudflare Access を AI Gateway の前に配置することで、各リクエストに認証されたアイデンティティが付与され、既存のアイデンティティポリシーをゲートウェイでそのまま利用できるようになります。これにより、各クライアントごとに独自の認証システムを構築することなく、チームは AI ツールを迅速に導入できます。」
近い将来、ユーザーの ID プロバイダーグループを活用して、支出制限の設定や、特定のグループがアクセス可能なモデルの制御が可能になります。例えば、機械学習チームには最先端モデルへのアクセス権を与えたり、サポートチームの支出上限を設定したり、特定プロジェクトに関わる全員の予算範囲を定義したりできます。これらはすべて、ID プロバイダーで既に管理しているグループにマッピングされます。
新しい「User Insights」タブ
AI Gateway 内には新たに「User Insights」というタブが追加されました。この機能はゲートウェイを通過するトラフィックを読み込み、各アカウントの行動パターンを可視化します。各アカウントの通常の動作を学習し、そのパターンから外れた異常を検出。これにより、悪意のあるエージェントと単に忙しく作業しているエンジニアを見分けるための文脈情報を提供します。既存のゲートウェイ通過トラフィックのみを利用するため、追加の設定は一切不要です。
User Insights はコストの追跡に加え、キャッシュヒット率の低さやコンテキストウィンドウの過剰など、どこで無駄が生じているかを可視化します。こうしたコスト管理機能を提供するツールは既に多数存在しますが、アカウントが正常に動作しているかどうかを判断できるものはまだ少ないのが実情です。私たちはこの「異常検知」機能を、コスト制御と並行して重点的に開発しました。
すべてのアカウントのベースライン作成:人間とエージェント
時間経過とともに、人間であれエージェントであれ、各アカウントは独自の行動指紋を残します。例えば、3 時間に一度チケットを要約するエージェントは動作がきっちりとしており、一貫性があります。一方、人間のユーザーはプロンプトが多様で、利用タイミングも不規則、難問に取り組む際のセッション時間も長くなるなど、動きは雑多です。どちらも正当な利用者ですが、同じような行動のズレでも、あるアカウントにとっては単なるノイズに過ぎないのに、別のアカウントでは重要なシグナルとなる可能性があります。
User Insights では、個々のリクエストではなく「セッション」単位でスコアリングを開始します。絶対的な閾値を設けるだけでは不十分です。例えば、利用量の多いユーザーが 500 ドル支出したとしてもそれは正常な範囲内ですが、常に 5 ドルしか使わないエージェントがいきなり 50 ドルを使えば、10 倍の増加となり、見過ごされるリスクがあります。そこで私たちは、各セッションをそのアカウント自身の履歴と比較します。具体的には過去 30 日間の p95(第 95 パーセンタイル)セッションコストを基準とし、これに対して 2 倍以上のコストが発生したセッションは、異常行動の有力な候補として検出します。
以下に、これらの数値設定に至った分析プロセスを解説します。
図 1: セッションコスト異常検出
上記チャートの読み方
このグラフは、当社内部のトラフィックから抽出された実際のセッションデータをプロットしたものです。各点は個別のセッションを表しており(対数目盛でプロットされています):
X 軸(セッションコスト):ドル建ての総コスト。
Y 軸(ユーザー p95 の倍数):そのセッションが個人のベースラインを何回上回ったかを示します。
2 本の破線で成る閾値線により、セッションは以下の 4 つのカテゴリに分類されます。
右上(★ スター):ユーザーの p95 ベースラインの 2 倍以上であり、かつアカウントレベルの p99 上限も超えるケースです。これは相対的な急上昇を示す有意義な異常支出であり、アラートを発令します。
左上:ユーザーの p95 ベースラインを 2 倍上回る高い相対値ですが、アカウントの p99 下限には達していません。小規模な金額変動による誤報を防ぐため、このカテゴリは対象外とします。
右下:絶対的な支出額は多いものの、そのユーザーが通常行う高頻度利用の一貫したパターンです。これも通常の行動として無視されます。
左下:両方のベースラインを十分に満たす正常な活動です。
図 2:アカウントレベルのセッションコスト分布
このヒストグラム(図 2)は、組織内のすべてのセッションコストをマッピングして、アカウント全体の上限値を設定します。
典型的な利用状況:绝大多数のセッションコストは 10 ドル未満であり、95 パーセンタイル(p95)は 20 ドルに位置しています。
アカウント p99(200 ドル):全社的なすべてのセッションのうち、1% だけが 200 ドルに達するかそれを超えます。
ではなぜ p99 を選んだのか。絶対的なドル単位の上限をアカウントの p99 に設定することで、意味のある基準線が引かれます。これにより、異常検知は特定のユーザーにおける突然の変動だけでなく、組織全体で最も高額な 1% のセッションにランクインするものに限られることが保証されます。
図 3:単一ユーザーのセッション履歴
ベンチマークは静的なものではありません。アカウントの行動パターンが変化するにつれて、そのローリング p95(緑色のライン)や 2 倍閾値(オレンジ色のライン)も連動して変化します。これにより、アラートは一度設定された数値ではなく、直近の行動を常に反映するものになります。また、ドルベースの下限値を設定しているため、スパイクが発生するには統計的に異常であるだけでなく、管理者が調査する価値がある規模でなければなりません。この金額下限こそが、マイクロユーザーのわずかなセント単位での 500 倍の急増が誤ってアラートを発令しないように守る役割を果たしています。
不正行動を検出するための適切な視点
上記の分析をすべて踏まえた上で、管理者が目にするのは「自身の行動パターンから逸脱したアカウント」のみを表示するビューです。通常の行動はすべてフィルタリングされ、残されたのが不正行動フィードなのです。
この種の行動は検出が困難です。なぜなら、その兆候は新しいツールの登場やブロックされたアクションといった目に見えるものではないからです。信頼されているアカウントが、すでに許可されている行為をより頻繁に行っているだけだからです。例えば、突然高コストなセッションを実行し始めるサービスアカウントや、自身の使用量基準を大幅に超えて数日間もその状態が続く個人ユーザーなどが該当します。
これらはいずれもポリシー違反にはなりません。しかし、すべてが行動ベースラインの崩壊を示しています。アカウントの使用パターンからの急激な逸脱は、認証情報の乗っ取りやエージェントの暴走といった問題が発生した際に見られる最初の兆候であることが多いのです。
User Insights は利用者の意図を決定するものでも、特定のユーザーをブロックする機能でもありません。代わりに、不審な行動を示し始めた少数のアカウントを管理者に提示し、次のアクションを検討できるようにします。これにより、実際の調査が必要になるケースもあれば、単に開発者への指導が必要なケース(例えば、コードスニペットで済むところを、プロンプトごとに全コードベースを貼り付けてしまうような場合)もあります。
次に何ができるか
コスト管理からコスト最適化へ移行するお手伝いをします
予算を設定した後、自然な次の疑問は「どうすれば同等の出力品質をより低いコストで実現できるか」です。すべてのリクエストが最先端モデルを必要とするわけではありません。要約タスクや単純なコード補完などは、質的な低下を伴わずに、より安価なモデルで実行できます。
現在、AI Gateway が着信リクエストを分析し、最低コストで最高の結果をもたらすモデルへルーティングする「タスクベースのスマートルーティング」を開発中です。組織レベルでは、どの部分をより効率的なモデルへのルーティングによって最適化できるかを確認できます。この機能は現在も活発に開発中で、成熟次第さらに詳細を共有していきます。
AI の利用状況を理解するお手伝いをします
異常検知機能は「アカウントの行動パターンが崩れたこと」を知らせてくれますが、「なぜそうなったのか」までは説明しません。管理者は依然としてログを確認し、出来事を組み立てる必要があります。このギャップを埋めることが次の焦点であり、その第一歩としてトラフィックの実態を分類することから始めます。
私たちは、コーディング、ライティング、その他といったカテゴリにリクエストを分類するプロンプト分類機能を構築しています。これらのカテゴリは、ほぼすべての他のシグナルで見落とされている文脈です。エンジニアからの「コーディング」分野での支出の急増は許容される可能性がありますが、そのアカウントがこれまで一度も触れたことのないカテゴリで同様の急増が見られる場合は、そうはいきません。この分類機能により、組織は AI をどれだけ使用しているかだけでなく、何のために使用しているかも把握できます。
また、これらの議論の根底にある問いにも答えます。「AI は本来の目的である業務に正しく使われているのか?」という問いです。ビジネストラフィックを他のすべてから分離することで、個人的な利用が可視化されます。外部からは、会社時間で副業を行っている人と、モデルを通じて静かにデータを流出させている人が同じように見えてしまいます。これらを見分けることは、内部リスクを検知する上で中心的な役割を果たします。
AI トラフィックを AI Gateway を経由させることで、新しいカテゴリのリスクや効率性のシグナルは、追加の設定なしに管理者が利用できるようになります。
Get started
User Insights は本日、すべての AI Gateway カスタマーに追加料金なしで一般提供を開始しました。ゲートウェイを通じてトラフィックを送信している方であれば、すでにダッシュボードにこの機能があります。もし既に AI Gateway を経由してルーティングされているのであれば、このビューもすぐに利用可能です。
まだ設定されていない場合は、ゲートウェイを作成し、カタログ内の任意のモデルに対してリクエストを送信することから始めてください。
AI Gateway には、現在オープンベータ版となっている Cloudflare Access の背後に配置することをお勧めします。支出状況や異常検知のビューは、これを設置しなくても利用できますが、ID を紐付けることで、単なる匿名のアカウント ID を、実際にアクションを起こせる名前に変換できるのです。
まずは監視モードで運用を開始し、何らかの制限を課す前に自社のベースラインを把握することから始めましょう。
現在の AI 管理方法について、ぜひお聞かせください。Discord で議論に参加するか、アカウントチームまでご連絡ください。
原文を表示
When you look at your AI bill, it can be hard to tell if anything is amiss. You first need a baseline so you can see what has changed, whether it’s an agent that’s gone wild or an employee whose usage has spiked 10x. Being able to spot those shifts lets you start investigating, and so far, it’s been hard to see them.
Knowing who is doing what with AI is one of the key challenges organizations are confronting right now. One report from Stanford University found that 59% of organizations said knowledge gaps were their biggest obstacle to responsible AI governance.
This is a security problem as much as a financial one. Solving these issues takes two things: a verified identity on every request (so a spike has a name behind it), and a picture of what normal looks like for that identity. Today we're announcing both.
Identity-aware AI Gateway with Cloudflare Access is now in open beta, and User Insights is generally available to every AI Gateway customer at no additional cost. Together they turn the traffic already flowing through AI Gateway into a behavioral baseline for every person and agent using it, and identify the ones that break from it.
What is AI Gateway?
AI Gateway is the central control plane for all of your AI usage. Instead of every app and team calling models on OpenAI, Anthropic, Google, or Workers AI directly, requests route through AI Gateway first, giving you one place to observe, secure, and govern all your AI usage.
It works with the applications you build, and with the coding tools your developers already live in. Route agent harnesses like Claude Code, Codex, and GitHub Copilot through AI Gateway, and they fall under the same visibility and controls as everything else.
Identity-aware AI Gateway
With the AI Gateway and Cloudflare Access integration, you can put a custom domain in front of your gateway and protect it with Access, just like any other application. That means you can:
Authenticate with any SAML-supported identity provider, like Okta or Entra, removing the need to generate and pass around Cloudflare API keys.
Set policies on exactly who can access your gateway.
Send requests to a clean hostname like ai.example.com, with no account ID or gateway ID in the URL.
Every authenticated request now carries the user's identity from Access. AI Gateway adds the verified Access user ID to request metadata as cf.user_id, so you can filter logs, analytics, and spend by the person who actually made the request.
Coupled with spend limits, that identity becomes a budgeting tool. Because each request now carries a real user, you can set per-user spend limits: give every user their own budget bucket, then block further requests or fall back to a cheaper model when they hit it. No more surprise invoices, and no shared API key hiding who spent what.
One of our early adopters, Flexport, ran into exactly this problem.
"Shared API keys make it almost impossible to tell who is using an AI service or apply the access rules we already have for employees,” says Max Baumgarten, Staff Security Engineer at Flexport. “Putting Cloudflare Access in front of AI Gateway gives each request an authenticated identity and lets us use our existing identity policies at the gateway. Our teams can adopt AI tools without creating a separate authentication system for every client."
In the near future, you'll be able to use your users' identity provider groups to set spend limits or control which models a group can access. For example, give your machine learning team access to frontier models, cap the spend of your support team, or scope a budget to everyone working on a specific project, all mapped to the groups you already manage in your identity provider.
The new User Insights tab
Within AI Gateway, you will now see a tab called User Insights. User Insights reads the traffic passing through your gateway and turns it into a behavioral picture of every account. It learns how each account normally acts, identifies the ones that break from that pattern, and gives you the context to tell a rogue agent from a busy engineer. It works on the traffic already going through your gateway, so there's nothing to set up.
User Insights tracks cost, including where it's being wasted, such as low cache-hit rates and oversized context windows. Plenty of tools already do that. What they don't do is tell you whether an account is behaving normally. That's what we chose to focus on, alongside cost controls.
Baselining every account: people and agents
Every account leaves a behavioral fingerprint over time, whether it's a person or agent. An agent summarizing tickets every three hours is tight and consistent. A person is messier, with varied prompts, irregular timing, and long sessions on hard problems. Both are legitimate, so the same deviation can be noise for one and a real signal for the other.
In User Insights, we start by scoring sessions, not single requests. Absolute thresholds fail here: a $500 jump from a heavy user might be normal, while a $50 session from an agent that always spends $5 is a 10x change that could otherwise slip by. So we compare each session against the account's own history, using its 95th percentile (p95) session cost over the last 30 days. That gives us a read on how the account normally operates, and anything above 2x of its p95 is a strong candidate for anomalous behavior.
The following analysis outlines how we arrived at these numbers.
Figure 1: Session Cost Anomaly Detection
How to read the chart above
The chart plots real sessions from our own internal traffic. Each point represents an individual session (plotted on log scales):
X-axis (Session Cost): Total cost in dollars.
Y-axis (x User p95): How many times the session exceeded the user's personal baseline.
The two dashed threshold lines divide the sessions into four categories:
Top-Right (★ Stars): Exceeds both the 2x user p95 baseline and the account-level p99 ceiling. These are high relative spikes that represent meaningful abnormal spend and will trigger an alert.
Top-Left: High relative spike (2x user p95), but below the account p99 floor. We ignore this to avoid alerting on small-dollar shifts.
Bottom-Right: High absolute spend, but consistent with this user's typical high usage. This is also ignored as routine behavior.
Bottom-Left: Normal activity well within both baselines.
Figure 2: Account-level Session Cost Distribution
This histogram (Figure 2) maps every session cost across the organization to establish an account-wide ceiling:
Typical Usage: The vast majority of sessions cost well under $10, with the 95th percentile sitting at $20.
Account p99 ($200): Only 1% of all sessions across the entire company reach or exceed $200.
So why did we pick p99? Setting our absolute dollar ceiling at the account p99 creates a meaningful bar. It guarantees that an anomaly isn't just a sudden shift for one specific user, but also ranks among the most expensive 1% of sessions across the entire organization.
Figure 3: Single User Session History
Baselines aren't static. As an account's habits change, its rolling p95 (green line) and 2x threshold (orange line) move with it, so an alert always reflects recent behavior rather than a number set once. We also apply a dollar floor so that a spike has to be both statistically unusual and worth an admin’s time to investigate. That dollar floor is what keeps a micro-user's 500x blip over a few cents from ever firing an alert.
The right lens for detecting rogue behavior
After all the analysis above, what admins see is a view of the accounts that broke their own pattern with everything normal filtered out. That filtered view is a rogue behavior feed.
This behavior is hard to catch because the signal is never a new tool or a blocked action. It's a trusted account doing more of what it's already allowed to do. It might be a service account that suddenly starts running more expensive sessions, or a person whose usage jumps well past their own norm and stays there for days.
None of these trip a policy, but all of them break a behavioral baseline. A sudden departure from an account's own usage is often the first observable sign of a compromised credential or an agent going off the rails.
User Insights does not decide intent and it does not block anyone; instead, it puts the handful of accounts that started behaving strangely in front of an admin so someone can ask the next question. Sometimes that leads to a real investigation. Sometimes it just means that someone needs coaching (like the developer who dumps a whole codebase into every prompt when a snippet would do).
What's next
We’ll help you move from cost control to cost optimization
Once you’ve set a budget, the natural next question is: how can you get the equivalent output quality at lower cost? Not every request needs a frontier model. A summarization task or a simple code completion can run on a cheaper model without meaningful quality loss.
We're building task-based smart routing, where AI Gateway analyzes the incoming request and routes it to the model that gives you the best result at the lowest cost. At the organizational level, you’ll be able to see where you can capture the most savings by routing to more efficient models.Task-based smart routing is in active development. We'll share more as it matures.
We’ll help you understand how AI is being used
Anomaly detection tells you an account broke its pattern, but not why. An admin still has to dig into the logs and piece together what happened. Closing that gap is what we're focused on next, and it starts with classifying what the traffic actually is.
We're building prompt classification that sorts requests into categories like coding, writing, and others. These categories are the context missing from almost every other signal. A spend spike in “coding” from an engineer might be acceptable, but the same spike in a category that account has never touched is not. Classification can show an organization not just how much AI it uses, but what it uses AI for.
It also answers the question underneath most of these conversations: is AI being used for the work it was intended? Once business traffic is separated from everything else, personal use becomes visible. From the outside, someone running a side hustle on company time and someone quietly moving data out through a model look the same. Telling them apart is central to catching insider risk.
Once your AI traffic is running through AI Gateway, each new category of risk or efficiency signal is one more thing an admin gets with no extra setup.
Get started
User Insights is generally available today to every AI Gateway customer at no additional cost. It's already in the dashboard for anyone sending traffic through the gateway, so if you're already routing through AI Gateway, this view is available to you.
If you haven't already, create a gateway and start making requests to any model in our catalog.
We recommend that you put AI Gateway behind Cloudflare Access which is now in open beta. The spend and anomaly views work without it, but attaching an identity is what turns an anonymous account ID into a name you can actually act on. Start in monitoring mode to learn your baselines before you enforce anything.
We want to hear how you're managing AI today. Join the conversation on Discord or reach out to your account team.
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み