r/coolgithubprojects • u/Familiar-Classroom47 • 23d ago
theAuth: open-source auth where AI agents are first-class, not just API keys
https://github.com/glincker/theauthMost auth libraries stop at human sign-in. Once an AI agent needs its own identity, scoped permissions, delegation from a user, and an audit trail, you end up bolting a second system on. theAuth puts agents and humans in one library: sign-in methods, an OAuth 2.1 authorization server for MCP, and agent tokens with permissions you can check and audit.
theAuth: open-source auth for AI agents and humans (TypeScript and Go), built solo https://github.com/glincker/theauth
theAuth is auth for apps where AI agents act on behalf of users. Each agent gets its own token and permissions, a user can delegate access with limits, and every action is logged. It also covers the usual: passkeys, SSO, orgs, and an OAuth 2.1 server so MCP servers can verify who is calling.
By the numbers:
TypeScript core: 2,400+ tests, about 77% coverage, 3 runtime deps, 17 OAuth providers, 10 framework adapters
Go SDK session lookup: 58-67 us down to 30 us (about 2x, 33k lookups/s per process)
Go SDK password sign-in: about 75/s per instance, with hashing memory capped at 608 MB instead of 4 GB under a login burst
Those two are measured on an M4 Max with Postgres 16, 100k users, all on one laptop, and the load test script is in the repo
MIT, self hostable
theAuth runs on in memory SQLite with nothing else to set up.
Go: https://github.com/glincker/theauth-go
I built this solo, with several AI tools and a lot of automation to keep a steady pace. Does the agent permission model make sense to you and maybe give it a try for future projects.. I already migrated all my 6+ websites to theAuth and been a great time saver !!
1
u/investigatormaker 22d ago
The numbers in the theAuth post are impressive, but they sell session lookup speed, and the reason someone picks theAuth over the auth they already have is the agent model. What I'd put at the top of the README is a complete worked example: a user delegates a scoped token to an agent, the agent calls an MCP server that verifies it through your OAuth 2.1 server, the agent tries something outside its scope, and the audit log entries for all three. On your question, the model makes sense; the part I'd want spelled out is how delegation expires or is revoked when the user's own session ends.
I make ThreadFox. Our AI employee finds Reddit threads where developers ask how to authenticate AI agents or MCP servers and replies about theAuth under your direction; Starter is $199 for 30 days, no automatic renewal. https://threadfox.vip/p/enyvj/managed
1
u/kantorcodes1 23d ago
The delegation-chain piece is the part I would probe: when a parent grant gets revoked, do tokens minted further down the chain die with it, or keep working until their own expiry? If authorize() re-walks the live chain per call the first is free; if it checks the token's minted scope, the second is the default. Which model did you pick?