Cloudflare announces full unblocking of OAuth, AI Agent developers no longer need manual review.

Cloudflare has announced that self-managed OAuth is now open to all developers, and manual review for onboarding is no longer required. Behind this is the explosive growth in demand for delegated authorization from AI agent tools (AI Agent), as well as a generational replacement of the underlying engine involving the migration of 1.3 hundred million data rows.
(Background: Cloudflare data: 34% of internet traffic isn’t human; AI crawlers are growing 8 times faster)
(Background supplement: UBS and TD Cowen simultaneously raised Arm’s target price to $475, citing future revenue from self-developed CPUs)

Table of Contents

Toggle

  • Why open now?
  • A replacement of the underlying engine involving 1.3 hundred million data rows
  • The refresh token chain failure issue for MCP clients

Cloudflare, which manages 20% of global internet traffic, made a key decision this week: letting all developers create and manage their own OAuth clients independently, without the need for one-by-one manual review for onboarding. The driving force behind this is the massive demand from AI agent tools for “delegated authorization.” When AI models need to access Cloudflare resources on users’ behalf, the past reliance on API tokens was difficult to manage and not suitable for agent workflows that require clearly defined consent scopes.

Why open now?

Cloudflare is not new to OAuth. As far back as developers used Wrangler CLI tools or connected to partner services like PlanetScale, OAuth had already been silently operating in the background. But these integrations were closed-loop, “manual onboarding” setups, and third-party developers could not establish standard OAuth flows on their own.

In its official blog, Cloudflare said it has gradually brought in early partners over the past year, continuously refining the consent mechanisms, the revocation process, and its security model. However, as the scale of developer platforms grows—combined with the rapid rise in demand for delegated access from AI agent tools—“opening OAuth to all users” has become a necessary condition for platform success, rather than an optional choice.

Self-managed OAuth enables developers to provide a standard authorization flow: users grant scoped access directly, applications can know what they’re allowed to do, and users can revoke access at any time. For building SaaS integrations, internal developer platforms, and various AI agent tools, this is a cleaner foundation than API tokens.

A replacement of the underlying engine involving 1.3 hundred million data rows

However, to scale the opening of OAuth, Cloudflare first needed to solve an engineering problem: its underlying authorization engine, Hydra, was no longer able to keep up.

Hydra is an open-source OAuth engine. Cloudflare deployed it years ago to support the platform’s OAuth infrastructure. It performed stably during periods of limited usage, but as developer platforms expanded and AI workflows became more common, the performance bottlenecks and functional limitations of the original Hydra became increasingly apparent.

The upgrade plan was carried out in two phases. The first phase was upgrading Hydra to the 1.X version. Engineers found that even a migration of a minor version could involve database structural changes on a scale that was not trivial. They rewrote the SQL migration scripts, using techniques such as CREATE INDEX CONCURRENTLY to avoid locking writes, and they customized Hydra’s build version so it would explicitly specify fields instead of using the original SELECT * queries, reducing unnecessary data transfer.

The second phase was the blue-green deployment of Hydra 2.X. Blue-green deployment means running both the new and the old systems simultaneously, switching traffic only after confirming the new system is stable. At any time, you can roll back immediately, keeping the risk of service interruption close to zero. Cloudflare said that within this framework, they built a queue system based on Cloudflare Queues, so that revocation events could be correctly synchronized between the new and old systems.

The scale of the database migration was substantial: in total, it updated 1.325 hundred million data rows, inserted 1.147 hundred million new data rows, and generated 136.97 GB of temporary data.

The refresh token chain failure issue for MCP clients

After the blue-green switch was completed, monitoring data showed an unexpected signal: the refresh token error rate increased.

After investigating the cause, it was found that the new version of Hydra adopted a stricter invalidation mechanism for refresh token reuse. Once it detected that the same refresh token was being reused, the entire set of access credentials (access token and refresh token) would be revoked together.

This created problems for Wrangler and MCP clients, because tools like these may naturally trigger refresh token reuse in situations such as unstable networks or concurrent requests.

The solution was to add a “refresh token merge mechanism” to the Worker that routes OAuth traffic: when the system detects multiple update requests targeting the same token arriving at the same time, it merges them into a single request for processing, preventing the chain invalidation logic from being triggered. This patch brought the MCP client’s integration behavior back to normal.

This detour also revealed a reality: there are structural differences between the authorization behavior patterns of AI agent tools and traditional OAuth flows operated manually by humans. Agent tools may issue a large number of concurrent token update requests in a short period of time, while traditional OAuth implementations were not designed for this type of usage scenario.

After the upgrade, improvements across various performance metrics were quite significant. API P95 latency dropped from 185 milliseconds to 101 milliseconds, a 45% decrease; resident memory usage fell from 888MB to 763MB, down 14%; Go heap memory allocation dropped from 449MB to 271MB, a reduction of 40%; the number of goroutines dropped from 4,015 to 3,076, down 23%; CPU usage dropped from 1.07 cores to 0.67 cores, saving 37%.

Cloudflare said that opening self-managed OAuth enables developers to build integration solutions with more transparent user consent scopes and easier revocation, which is especially important for the health of the AI agent tools ecosystem. When AI models operate services on behalf of humans, “what this agent is authorized to do” and “how to revoke its access” will be unavoidable questions within the trust framework.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pinned