Better Auth is a critical piece of the agent infrastructure stack because it addresses the identity problem for non-human actors. Traditional authentication is built for browser-based human sessions, but Better Auth has introduced features for asynchronous auth flows, token exchange, and agent-to-agent delegation. This allows developers to grant an AI agent specific, scoped permissions to act on behalf of a user without handing over long-lived credentials.
Crucially, the company is the first major authentication framework to ship with a native Model Context Protocol (MCP) server. This enables AI coding agents like Cursor or Claude Code to understand and modify the authentication layer of an application directly. By lowering the barrier for agents to interact with security configuration, Better Auth makes it easier to build secure, agent-ready applications from day one.
Authentication is a sector of the software industry that oscillates between two poles: "do it yourself" libraries and "do it for me" managed services. For the last few years, the momentum favored the latter, with companies like Clerk and Auth0 winning on developer experience. Better Auth, founded by Bereket Engida in early 2025, represents a swing back toward the library model, but with a degree of polish usually reserved for SaaS products.
Engida’s path to Y Combinator is notable. He built the foundation of the framework in Ethiopia, amassing significant community traction before the company officially launched. By the time Better Auth secured a $5 million seed round led by Peak XV in mid-2025, the project was already reporting over 150,000 weekly downloads. This adoption is driven by a specific technical philosophy: developers want the ease of a managed service but the control and data sovereignty of an open-source library.
Better Auth is framework-agnostic, providing first-class support for Next.js, Nuxt, SvelteKit, Astro, and Hono. Its primary differentiator is the "Bring Your Own Database" (BYOD) architecture. It uses adapters for Drizzle, Prisma, and Kysely to interface directly with a developer's existing PostgreSQL, MySQL, or MongoDB instance. This removes the "black box" problem associated with hosted auth providers, where user data is siloed on a third-party server.
The library uses a declarative configuration style. Instead of sprawling middleware, developers define their auth logic in a single file—auth.ts—which exports an auth object. This object handles everything from session validation to CSRF protection. Because it is written in TypeScript, the framework provides end-to-end type safety. If a developer enables a plugin like two-factor authentication, the client-side hooks automatically update their types to reflect the new requirements. This level of automation reduces the surface area for common implementation bugs that plague home-grown systems.
The company’s most distinct move is its pivot toward what it calls "AI-native" authentication. Most developer tools are currently trying to figure out their AI story; Better Auth has integrated with the Model Context Protocol (MCP). This allows AI coding assistants—specifically Cursor and Claude Code—to read the application's auth configuration. Instead of a developer manually writing social provider logic, they can prompt their IDE to add Google login, and the MCP server provides the AI with the specific context needed to write the implementation.
Furthermore, the team is championing the Agent Auth Protocol. This is a framework for handling authentication when an AI agent needs to perform actions on behalf of a user, or when multiple agents need to delegate permissions to one another. By positioning themselves at the intersection of traditional identity management and agentic workflows, Better Auth is moving to become the standard identity layer for the next generation of software. They compete directly with Clerk on developer experience and with Auth.js on flexibility, aiming to be the default choice for TypeScript developers who refuse to outsource their user database.
An open-source, framework-agnostic authentication library for TypeScript.