Cloudflare Introduces Identity-Aware AI Gateway to Help Enterprises Detect Rogue AI Activity and Control AI Spending
Cloudflare has expanded its AI Gateway with identity-aware access controls and behavioral analytics, giving enterprises new tools to authenticate AI users, monitor anomalous AI activity, and improve governance across multiple AI models.
Xcademia Team
Xcademia Research Team

Cloudflare Strengthens Enterprise AI Governance with Identity-Aware Analytics
As enterprise adoption of generative AI accelerates, organisations are facing a growing challenge that extends beyond choosing the right AI model. They also need visibility into who is using AI services, how those services are being used, and whether unusual behaviour signals a security incident or an unexpected surge in costs.
Cloudflare is addressing that challenge with two new capabilities for its AI Gateway platform. The company has announced that Identity-aware AI Gateway, integrated with Cloudflare Access, is now available in open beta, while User Insights has reached general availability (GA) for all AI Gateway customers at no additional cost.
Together, these additions aim to provide enterprises with stronger governance over AI usage by combining verified user identities with behavioural analytics. Rather than treating AI requests as anonymous API traffic, Cloudflare enables organisations to associate every authenticated request with an individual user or service account, making it easier to monitor spending, investigate anomalies, and enforce organisational policies.
The announcement reflects a broader shift in enterprise AI security. As businesses increasingly deploy AI assistants, coding tools, and autonomous agents across their operations, visibility into AI activity is becoming as important as protecting traditional applications and networks.
Key Developments
The announcement introduces two closely connected capabilities designed to improve enterprise AI governance.
1. Identity-aware AI Gateway
Cloudflare has integrated AI Gateway with Cloudflare Access, allowing organisations to place their AI Gateway behind identity-aware authentication using their existing identity provider.
According to the company, organisations can:
Authenticate users through SAML-supported identity providers such as Okta or Microsoft Entra.
Apply access policies that determine exactly who can use AI Gateway.
Replace shared Cloudflare API keys with authenticated user identities.
Route requests through a custom hostname instead of exposing gateway identifiers.
Attach a verified user identifier (
cf.user_id) to every authenticated AI request for logging, analytics, and spending visibility.
By attaching a verified identity to every request, organisations gain more accurate visibility into which employee, developer, or automated service is consuming AI resources.
2. User Insights Reaches General Availability
Alongside identity-aware access, Cloudflare has made User Insights generally available.
Rather than focusing only on infrastructure metrics, User Insights analyses AI traffic flowing through AI Gateway to establish behavioural baselines for individual users and AI agents. It then highlights accounts whose activity significantly deviates from their normal usage patterns, helping administrators identify unusual behaviour without requiring additional configuration.
Cloudflare notes that the feature automatically works on traffic already passing through AI Gateway, allowing organisations to begin analysing AI usage without deploying extra monitoring tools.
Technical Breakdown: Moving Beyond Anonymous AI Requests
Many organisations currently access multiple AI providers through shared API keys. While this simplifies deployment, it also makes it difficult to determine which individual generated a request, consumed expensive models, or triggered an unexpected increase in AI spending.
Cloudflare's approach introduces identity directly into the AI request pipeline.
Instead of every application communicating independently with AI providers such as OpenAI, Anthropic, Google, or Workers AI, requests are routed through AI Gateway first. AI Gateway serves as a central control plane that provides a single location for observing, securing, and governing AI traffic across different models and applications. The platform also supports developer tools and AI coding assistants including Claude Code, Codex, and GitHub Copilot, enabling organisations to apply consistent governance across multiple AI workloads.
With Cloudflare Access positioned in front of AI Gateway, authenticated requests carry verified user identity information that can be incorporated into logging, analytics, and spending controls. This enables administrators to associate AI usage with real users instead of anonymous credentials.
The company also highlights that verified identities enable more granular budgeting. Organisations can establish individual spending limits, prevent additional requests after budgets are exhausted, or redirect requests to lower-cost AI models instead of allowing unrestricted spending.
This combination of identity and financial controls is intended to reduce both operational costs and the investigation time required when unexpected AI usage occurs.
Why Identity Has Become Central to AI Security
Enterprise AI usage increasingly involves more than employees interacting with chatbots.
Modern organisations rely on AI coding assistants, autonomous workflows, background automation, customer service agents, and application-integrated large language models. These systems often generate thousands of API requests without direct human interaction.
As AI adoption expands, shared credentials become increasingly difficult to manage because they obscure which individual or automated process generated a request. This limits an organisation's ability to investigate suspicious behaviour, attribute AI costs accurately, or apply differentiated access policies.
Cloudflare's identity-aware model addresses this operational challenge by making authenticated identity part of every AI request rather than treating authentication as a separate security layer. According to the company, this creates a stronger foundation for governance while simplifying policy enforcement across enterprise AI deployments.

User Insights: Building Behavioural Baselines for AI Usage
While identity establishes who is interacting with AI services, Cloudflare's newly available User Insights focuses on understanding how those users and AI agents typically behave over time.
According to the company, User Insights continuously analyses traffic passing through AI Gateway to create behavioural profiles for every authenticated account. Instead of examining individual requests in isolation, the system evaluates complete AI sessions, enabling administrators to distinguish between normal usage patterns and potentially abnormal activity.
Cloudflare explains that traditional monitoring methods often rely on fixed thresholds, such as triggering an alert when spending exceeds a predefined amount. However, this approach can generate excessive false positives because AI usage varies significantly between different users and workloads.
For example, a software engineer regularly working with large codebases may legitimately generate hundreds of AI requests each day. By comparison, an automated workflow that typically performs a small summarisation task every few hours would normally consume only a fraction of those resources. Applying the same spending threshold to both accounts could either overlook genuine anomalies or create unnecessary alerts.
Instead, User Insights establishes an individual behavioural baseline for every account and measures future activity against that historical pattern.
Detecting Rogue AI Behaviour Through Relative Analysis
Cloudflare's anomaly detection model is designed around the principle that behavioural changes are often more meaningful than absolute spending figures.
Rather than evaluating every request independently, User Insights compares each AI session against the account's own historical activity over the previous 30 days. The platform uses each account's 95th percentile (p95) session cost as its behavioural baseline and considers sessions exceeding twice that baseline as candidates for anomalous behaviour.
The company also applies an organisation-wide spending ceiling based on the 99th percentile (p99) of all sessions across the enterprise.
According to Cloudflare, combining these two measurements helps reduce unnecessary alerts. A session must represent both:
a significant increase compared with that specific user's historical behaviour, and
an unusually expensive session relative to the organisation as a whole.
This dual-threshold approach helps distinguish legitimate high-volume users from accounts whose behaviour has suddenly changed.
Cloudflare notes that these behavioural baselines continuously adapt over time. As employees or AI agents naturally change their usage patterns, the rolling baseline is updated to reflect recent behaviour rather than relying on permanently fixed thresholds.
From Cost Monitoring to Security Detection
Although AI cost management is an important objective, Cloudflare positions User Insights primarily as a security capability.
The company argues that some of the most difficult security incidents involve trusted accounts performing actions they are already authorised to perform, but at volumes or frequencies that differ substantially from their historical behaviour.
Examples highlighted in the announcement include:
An AI agent suddenly consuming significantly more expensive models.
A service account generating unusually costly AI sessions.
A developer whose AI usage increases dramatically over several consecutive days.
Accounts displaying sustained behavioural deviations from established patterns.
These situations may not violate predefined access policies or trigger conventional security controls. However, they can represent early indicators of compromised credentials, misconfigured AI agents, unexpected automation loops, or inefficient prompt engineering.
Cloudflare emphasises that User Insights does not automatically block users or determine intent. Instead, it prioritises accounts exhibiting unusual behaviour, allowing administrators to investigate further using contextual information and existing security processes.
This investigative model is intended to reduce alert fatigue while giving security teams greater visibility into emerging AI-related risks.
Enterprise Benefits Beyond Security
The announcement also highlights operational advantages beyond threat detection.
Because every authenticated request now includes a verified user identity, organisations can allocate AI spending more accurately across departments, projects, or individual employees.
Cloudflare says this creates opportunities for:
Per-user AI budgets.
Individual spending limits.
Better cost attribution.
More accurate chargeback reporting.
Improved governance across multiple AI providers.
The company also references early customer Flexport, whose security engineering team cited the difficulty of managing shared API keys when attempting to apply existing identity policies to AI services. According to Flexport, integrating Cloudflare Access with AI Gateway allows authenticated identities to replace anonymous shared credentials while leveraging existing enterprise identity infrastructure.
Looking ahead, Cloudflare plans to extend identity-aware governance by enabling organisations to apply policies based on identity-provider groups. This would allow enterprises to grant different AI model access or spending limits to engineering, support, research, or project teams using existing directory structures.
What This Means for Enterprise AI Governance
Cloudflare's latest announcement reflects a broader shift in enterprise AI management.
Early AI deployments largely focused on providing employees with access to powerful language models. As adoption has matured, organisations are increasingly concerned with governance, accountability, and operational oversight.
Identity-aware AI infrastructure addresses several emerging challenges simultaneously:
Determining which individual or service initiated an AI request.
Understanding whether usage patterns remain consistent over time.
Preventing unexpected AI expenditure.
Supporting compliance and internal governance requirements.
Improving visibility across multiple AI providers through a unified control plane.
For enterprises operating large AI environments, behavioural analytics may become an increasingly important complement to traditional access controls, particularly as autonomous AI agents begin executing more complex workflows with minimal human oversight.

What's Next for AI Gateway
Cloudflare views the latest release as the foundation for broader AI governance capabilities rather than the final destination. While identity-aware access and behavioural analytics improve visibility into AI usage today, the company outlined several enhancements currently under development that aim to help organisations optimise both cost and operational oversight.
Task-Based Smart Routing
One of the most significant planned capabilities is task-based smart routing.
Cloudflare explains that not every AI request requires access to the most advanced or expensive large language model. Routine activities such as document summarisation, basic code completion, or straightforward question answering may achieve comparable results using lower-cost models.
To address this, Cloudflare is developing routing intelligence that analyses incoming requests and automatically selects the AI model that delivers an appropriate balance between response quality and operational cost.
According to the announcement, administrators will also gain organisational visibility into where model routing could generate the greatest cost savings. The company notes that task-based smart routing remains in active development, with additional information to be shared as the feature matures.
Understanding How AI Is Being Used
Cloudflare also plans to extend AI Gateway beyond identifying anomalous behaviour by helping organisations understand the purpose behind AI requests.
The company is building prompt classification, a capability designed to categorise AI interactions into workloads such as:
Coding
Writing
Other request categories
By classifying prompts, organisations can better understand how AI is being used across different business functions rather than relying solely on spending or request volumes.
Cloudflare suggests that contextual information could help administrators distinguish between expected and unexpected behaviour. For example, increased AI usage within coding-related workloads may be normal for software engineering teams, while similar activity within unfamiliar categories could warrant further investigation.
The company also believes this additional context could improve visibility into business versus personal AI usage and provide stronger signals for identifying potential insider risks.
Why This Matters
Cloudflare's announcement reflects a broader evolution in enterprise AI security.
During the early stages of generative AI adoption, organisations focused primarily on enabling employee access to AI models while controlling infrastructure costs. As AI becomes embedded within business processes and autonomous agents perform increasingly complex tasks, governance requirements are becoming more sophisticated.
Traditional security controls remain important, but they often focus on whether an action is authorised rather than whether it is typical.
Behavioural analytics introduces a complementary approach by asking additional questions:
Is this account behaving differently than usual?
Has spending increased significantly without explanation?
Is an autonomous AI agent operating outside its historical pattern?
Does this activity warrant investigation before it becomes a larger operational or security issue?
By combining verified identity with behavioural baselines, Cloudflare is positioning AI Gateway as a central governance platform that helps organisations understand both who is using AI services and how those services are being used.
For enterprises deploying AI across multiple business units and providers, this type of visibility could become increasingly valuable as AI workloads continue to expand.

Conclusion
Cloudflare's latest AI Gateway enhancements demonstrate how enterprise AI governance is evolving beyond simple API management.
The introduction of Identity-aware AI Gateway in open beta enables organisations to associate every authenticated AI request with a verified user identity, replacing anonymous shared credentials with identity-driven access controls. Meanwhile, the general availability of User Insights adds behavioural analytics that establish individual usage baselines and surface accounts exhibiting unusual activity without requiring additional deployment effort.
Together, these capabilities aim to improve visibility, strengthen governance, and support more informed investigations into unexpected AI behaviour while helping organisations better manage AI spending.
Looking ahead, Cloudflare's roadmap for task-based model routing and prompt classification suggests that enterprise AI platforms will increasingly combine security, operational intelligence, and cost optimisation within a unified control plane.
As AI adoption continues to accelerate, understanding not only who is accessing AI services but also how those services are being used may become a defining requirement for responsible enterprise AI governance.
Source: Cloudflare Blog
About the Author