Self-hosted auth for AI agents
Sign-in for people and for the agents that act for them. OAuth 2.1 and passkeys, delegation and audit, with your users, sessions and tokens kept in your own database.
OAuth 2.1 and passkeys, in your own stack.
A library, not a hosted service: it runs inside your app.
- OAuth 2.1 for MCPAI agents and MCP clients sign in with standard OAuth 2.1 flows instead of shared keys pasted into config files.
- Agent identity and delegationEach agent gets its own identity, acting on a person's behalf with only the permissions that person delegated.
- Audit trailEvery grant and every action an agent takes is recorded, so you can see who did what and on whose behalf.
- Passkeys and magic linksPeople sign in without passwords, using passkeys or a link sent by email.
- SAML single sign-onTeams that sign in through their company identity provider can use SAML.
- TypeScript and GoUse theAuth from a TypeScript or a Go backend. It is open source under the MIT licence.
Add theAuth to your backend.
Pick your language; the command copies in one tap.
npm install @glinr/theauthAbout theAuth.
What makes theAuth auth for AI agents?
Agents get their own identity and sign in with OAuth 2.1, including the flows MCP clients use. A person delegates specific permissions to an agent, and every action is recorded in an audit trail.
Is theAuth self-hosted?
Yes. theAuth is a library that runs inside your own backend, and your users, sessions and tokens stay in your own database.
Does it support passkeys?
Yes. People can sign in with passkeys or magic links, and teams can use SAML single sign-on.
Which languages does it support?
TypeScript and Go. Install it with npm install @glinr/theauth or go get github.com/glincker/theauth-go/v2.
Is theAuth open source?
Yes. theAuth is open source under the MIT licence, and the code is on GitHub.
Give your agents a proper sign-in.
Start with the guides on theauth.dev, or read the code on GitHub.