
TL;DR
Cloudflare AI Gateway now attaches a verified user identity to every request and learns a behavioral baseline per account, flagging 2x-p95 session spikes against an org-wide p99 ceiling. Here is how the anomaly math works and why per-account baselines beat global thresholds.
On August 5, Cloudflare shipped the missing attribution layer for AI traffic: identity-aware AI Gateway with Cloudflare Access, now in open beta, plus User Insights, a behavioral anomaly detection view that is generally available to every AI Gateway customer at no extra cost. The two combine to answer a question most AI cost and security tooling still cannot: which account spent this, and is that account behaving normally?
Identity-aware AI Gateway. Put a custom domain in front of your gateway and protect it with Cloudflare Access, and every request carries the authenticated user's identity. Concretely:
cf.user_id, so logs, analytics, and spend can be filtered by the actual person who made the call.User Insights (GA). The new tab reads traffic already flowing through the gateway, learns a behavioral baseline for every account, and surfaces the accounts that broke their own pattern. The methodology matters because it is per-account, not global:
The output is a "rogue behavior feed": the handful of accounts that departed from their own history, with normal activity filtered out. User Insights does not block anyone and does not judge intent. It puts anomalies in front of an admin, who decides whether it is a compromised credential, an agent off the rails, or a developer who pastes the whole codebase into every prompt.
From the archive
Aug 6, 2026 • 8 min read
Aug 5, 2026 • 7 min read
Aug 5, 2026 • 7 min read
Aug 5, 2026 • 8 min read
The core problem this solves is attribution under shared keys. Cloudflare's own early adopter, Flexport, said it directly: shared API keys make it almost impossible to tell who is using an AI service or to apply the employee access rules the company already has. When every call carries a verified identity, the gateway stops being a routing box and becomes a control plane that can apply the same policy your SSO already does.
The second half is the detection insight: rogue behavior is rarely a new tool or a blocked action. It is a trusted account doing more of what it is already allowed to do, which means rule-based policy misses it by construction. A service account that suddenly runs expensive sessions, or an employee whose usage jumps 10x for days, trips no policy. A behavioral baseline is the only signal that catches the departure.
The per-account scoring is the right call and the reason the numbers are published: a $50 session is noise for a heavy user and a 10x spike for an agent that always spends $5. Absolute thresholds fail on both ends, which is why the design combines a personalized 2x-p95 trigger with an org-wide p99 ceiling and a dollar floor. That is a genuinely defensible anomaly design, and it is refreshing that Cloudflare published the math instead of a marketing claim.
Two honest limits: anomaly detection works on spend patterns today, not on what the traffic is doing (prompt classification is on the roadmap, along with task-based smart routing to cheaper models), and the identity layer is open beta. The spend and anomaly views work without Access, but without identity they are anonymous account IDs again.
This is the same move Vercel made with team and project spend budgets: the gateway platform is becoming the enforcement and attribution boundary for AI usage. Vercel's budgets AND-compose so the tightest cap wins; Cloudflare's per-user budgets attach the cap to a real identity. On a self-hosted gateway, you would be building the identity layer, the baselining, and the alerting yourself, which is a real project. For teams already running spend guardrails, identity-aware budgets are the mechanical stop under the organizational policy.
It also reinforces the argument that agent identity is the missing security layer for AI workflows: here it is implemented at the gateway instead of in the agent, which has the advantage of covering every harness that routes through it, Claude Code, Codex, and Copilot included. And the announced task-based smart routing points at the same model routing economics we have covered before: once the gateway knows who is calling and why, routing every request to the cheapest sufficient model becomes an org-level lever rather than a per-app optimization.
Read next
The Linux Foundation's Agent Name Service proposal points at a real gap in AI agent infrastructure: agents need verifiable identity, scoped capabilities, revocation, and audit trails before they can safely act across tools.
7 min readAI Gateway spend budgets now scope to teams and projects, with hard dollar limits that reject requests, email alerts at 50/75/100%, and CLI-managed defaults. Here is how the three scopes compose and where it fits your cost stack.
5 min readA company accidentally spent $500M on Claude in one month. Uber torched its whole 2026 AI budget by April. The fix is not less AI - it is guardrails. Here is the playbook: caps, alerts, gateway spend limits, model routing, prompt caching, and approval workflows.
11 min readTechnical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Most popular LLM framework. 100K+ GitHub stars. Chains, RAG, vector stores, tool use. LangGraph adds stateful multi-agen...
View ToolCDN, DNS, DDoS protection, and edge computing. Free tier handles most needs. This site uses Cloudflare for DNS and analy...
View ToolMac app for running parallel Claude Code, Codex, and Cursor agents in isolated workspaces. Watch every agent work at onc...
View ToolOpen-source AI gateway: call 100+ LLM providers in the OpenAI format via a Python SDK or proxy. Spend tracking, budgets,...
View ToolPaste content once, get optimized versions for every platform.
View AppEvery coding agent in one window. Stop alt-tabbing between Claude, Codex, and Cursor.
View AppScore every coding agent on your own tasks. Catch regressions in CI.
View AppConfigure Claude Code for maximum productivity -- CLAUDE.md, sub-agents, MCP servers, and autonomous workflows.
AI AgentsWhat MCP servers are, how they work, and how to build your own in 5 minutes.
AI AgentsA complete, citation-backed Claude Code course with setup, prompting systems, MCP, CI, security, cost controls, and capstone workflows.
ai-development
The Linux Foundation's Agent Name Service proposal points at a real gap in AI agent infrastructure: agents need verifiab...

AI Gateway spend budgets now scope to teams and projects, with hard dollar limits that reject requests, email alerts at...

A company accidentally spent $500M on Claude in one month. Uber torched its whole 2026 AI budget by April. The fix is no...

A code-heavy field guide to model routing. Real, runnable-style configs for tiering tasks by complexity, routing simple...

On August 5 Cloudflare published the Agent Access Model: a reference architecture where credentials are short-lived and...

On August 5 Cloudflare open sourced Cloudflare OS, the agent workspace it has run internally since May: capability-based...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.