# tensile-auth > Like Better Auth, but built for AI agents: passkey and email and password sign-in, Google and GitHub sign-in, step-up, agent tokens, and approvals. A Go library, and a server with a TypeScript SDK for apps in other languages. In Go, one call, `authroutes.Mount`, serves every sign-in route, the browser client, and the drop-in elements. The library is `tensile.tools/auth`, at v0.4.1, open source under Apache-2.0. ## To add sign-in to a Go app Follow these steps exactly. They are the library's tested recipe; [the full recipe](https://auth.tensile.tools/llms-full.txt) has every line of code. 1. Add the module: `go get tensile.tools/auth@latest` 2. Find its source: `go list -m -f '{{.Dir}}' tensile.tools/auth`. In that directory, read `skills/tensile-auth/SKILL.md` and follow it exactly. `examples/quickstart` is the same code as a running app. 3. Mount every sign-in route with `authroutes.Mount`. Don't write your own sign-in, sign-up, or session handlers. 4. You're done when `go build ./...` passes and a person can create an account, sign in, and sign out. For a Node, Bun, or Deno app, run `tensile-auth-server` and use `@tensile-tools/auth`: follow [the Next.js quickstart](https://auth.tensile.tools/docs/get-started/quickstart-nextjs). ## Docs - [Documentation](https://auth.tensile.tools/docs): Guides, quickstarts for Go and Next.js, the server, the TypeScript SDK, migration, and the reference for every error and route. - [Passkeys and sign-in for people](https://auth.tensile.tools/humans/): What people get: passkey sign-in, strict passwords with breached ones refused, recovery codes with an undo, every device and agent in view, and four sign-in levels. - [Human in the loop for AI agents](https://auth.tensile.tools/approvals/): When an agent tries something risky, its person approves that exact request with a passkey, and it runs once: what counts as risky, what the agent sees while it waits, and what a decline does. - [MCP authorization and server authentication](https://auth.tensile.tools/mcp/): How MCP clients such as Claude Code connect: the person signs in and allows the client, each token works at one MCP server, each tool has its own scope, and every call is on the record. - [MCP clients: Claude Code, Codex, ChatGPT, Grok Build, and more](https://auth.tensile.tools/mcp/clients/): Which agents connect to an MCP server built on tensile-auth, grouped by what the server needs: nothing, their site on the allowed list, or registration turned on. With the exact client documents and how to add a server in each. - [AI agent authentication](https://auth.tensile.tools/agents/): Every agent hangs from a person: one pass each that can only do less, agents that sign themselves up and wait 7 days to be claimed, one sign-out that stops everything under it, and limits you set. - [Security: tokens, the record, and ASVS](https://auth.tensile.tools/security/): Tokens, sign-in, and the audit log, with the OWASP ASVS 5.0 self-assessment, the OpenID conformance results, what isn't built yet, and how to report a vulnerability. - [Compare Go sign-in libraries and services](https://auth.tensile.tools/compare/): How tensile-auth compares with Go sign-in libraries, identity servers, and hosted services, with a source for every fact and what it doesn't have yet. - [A Better Auth alternative built for AI agents](https://auth.tensile.tools/compare/better-auth/): tensile-auth next to Better Auth: where each runs, what agents get, what tensile-auth lacks, and when to choose Better Auth instead. - [An Auth0 alternative inside your app](https://auth.tensile.tools/compare/auth0/): Coming from Auth0: what comes across, what doesn't, how to keep Auth0 for an MCP server, and what tensile-auth lacks. - [A Clerk alternative you run yourself](https://auth.tensile.tools/compare/clerk/): Coming from Clerk: what comes across, what stays behind, how a Next.js app keeps its framework, and what tensile-auth lacks. - [Open-source sign-in under Apache-2.0](https://auth.tensile.tools/open-source/): The licence, no paid tier, what's free, how you run it yourself, and how to help while pull requests are closed. - [Changelog](https://auth.tensile.tools/changelog): What changed, release by release, from the library's own changelog. - [Blog](https://auth.tensile.tools/blog): Notes on sign-in, sessions, and agents from the people who build tensile-auth. - [Full recipe](https://auth.tensile.tools/llms-full.txt): the library's agent skill, word for word ## Docs pages, as Markdown The docs describe v0.4.1-3-ga4e7747, at commit a4e7747. ### Get started - [Documentation](https://auth.tensile.tools/docs/index.md): Sign-in for people and the agents that act for them: a Go library, or a server with a TypeScript SDK for any other backend. - [Quickstart for Go](https://auth.tensile.tools/docs/get-started/quickstart-go.md): Add passkey and email and password sign-in to a Go web app with one call, then check it in four steps. - [Quickstart for Next.js](https://auth.tensile.tools/docs/get-started/quickstart-nextjs.md): Run the tensile-auth server, proxy its routes through a Next.js app, and protect a page with the TypeScript SDK. - [How it works](https://auth.tensile.tools/docs/get-started/how-it-works.md): People, agents, sessions as a tree, needs, and approvals: the five ideas the rest of the docs build on. ### Guides - [Service and routes](https://auth.tensile.tools/docs/guides/service-and-routes.md): Create the service, declare a rule for every route, and mount every sign-in route in one call. - [Passkeys](https://auth.tensile.tools/docs/guides/passkeys.md): Usernameless passkey sign-up and sign-in, with the session cookie set for you. - [Email, passwords, and presets](https://auth.tensile.tools/docs/guides/email-and-passwords.md): Email and password sign-in held to OWASP ASVS 5.0 Level 2, and the four versioned presets that configure it in one line. - [Second factors and recovery](https://auth.tensile.tools/docs/guides/second-factors.md): TOTP, pending sign-ins, recovery codes, and undoing a recovery sign-in that the person didn't make. - [Needs and step-up](https://auth.tensile.tools/docs/guides/needs.md): Declare what an operation needs; the library decides, enforces, records, and explains each refusal. - [Sessions and devices](https://auth.tensile.tools/docs/guides/sessions.md): A session tree people can read, revocation, and sessions bound to a key in the device's hardware. - [Tokens and agents](https://auth.tensile.tools/docs/guides/tokens-and-agents.md): Personal access tokens, agents, and delegated tokens that only narrow what the person can do. - [Approvals](https://auth.tensile.tools/docs/guides/approvals.md): Let an agent ask its person for one risky action, notify the person, and run the route once after they approve. - [MCP servers](https://auth.tensile.tools/docs/guides/mcp.md): Protect an MCP server with tokens bound to it, connect Claude Code, or verify the JWTs your own sign-in issues. - [OAuth and the device flow](https://auth.tensile.tools/docs/guides/oauth.md): Run the server as an OAuth 2.0 and OpenID Connect provider, for a CLI that signs in with the device flow or for an MCP client. - [Browser client](https://auth.tensile.tools/docs/guides/browser-client.md): One entry point with honest outcomes, step-up that retries once, and no session token in the page. - [Drop-in elements](https://auth.tensile.tools/docs/guides/elements.md): Framework-free Web Components for sign-in, step-up, approvals, sessions, and activity, served with no build step. ### Server - [Install the server](https://auth.tensile.tools/docs/server/install.md): Run tensile-auth-server from the signed image or the binary, with Postgres or SQLite. - [Configure](https://auth.tensile.tools/docs/server/configure.md): Every setting, from flags, environment variables, a TOML file, or defaults, and how secrets stay out of process lists. - [Reverse proxy](https://auth.tensile.tools/docs/server/reverse-proxy.md): The paths, cookies, headers, and timeouts the app's proxy forwards, and how the server finds the client's address. - [Keys and rotation](https://auth.tensile.tools/docs/server/keys.md): The master key that wraps every stored key, and how to rotate each kind of key without downtime. - [Hooks and webhooks](https://auth.tensile.tools/docs/server/webhooks.md): Signed hooks that decide sign-ups and scopes before the server acts, and events delivered at least once after it does. - [Admin](https://auth.tensile.tools/docs/server/admin.md): Invite the first administrator, and keep the admin API to your own networks. - [Operate the server](https://auth.tensile.tools/docs/server/operate.md): Back up and restore, upgrade with zero downtime, and watch the health endpoints and alerts. - [Troubleshooting](https://auth.tensile.tools/docs/server/troubleshooting.md): Every startup refusal and run-time symptom, with its cause and fix. ### TypeScript SDK - [SDK core](https://auth.tensile.tools/docs/sdk/core.md): Check each request with the server in one call, act for a person, and verify webhooks, from Node, Bun, or Deno. - [Next.js adapter](https://auth.tensile.tools/docs/sdk/nextjs.md): The App Router adapter: a proxy route, `require` in pages and actions, approvable handlers, and `gate` in proxy.ts. - [Express adapter](https://auth.tensile.tools/docs/sdk/express.md): Express 5 middleware: the proxy, `authenticate`, `need`, and `approvable`. - [Hono adapter](https://auth.tensile.tools/docs/sdk/hono.md): Hono 4 middleware: the proxy, `authenticate`, `need`, and `approvable`, on Node, Bun, Deno, and Workers. - [Cache checks](https://auth.tensile.tools/docs/sdk/cache.md): Serve allowed checks from memory for up to 30 seconds, cleared within 100 milliseconds of a revocation. ### Migrate - [Export and import](https://auth.tensile.tools/docs/migrate/export.md): Move every person to another install in one encrypted file, or leave for another product. - [Import from another product](https://auth.tensile.tools/docs/migrate/import.md): The rules every importer follows: kept IDs, no matching by address, and a stop at any field it doesn't know. - [Import from Auth0](https://auth.tensile.tools/docs/migrate/auth0.md): Bring Auth0 users across from the password hash export and the bulk user export. - [Import from Clerk](https://auth.tensile.tools/docs/migrate/clerk.md): Bring Clerk users across from the dashboard's CSV export. - [Import from Supabase](https://auth.tensile.tools/docs/migrate/supabase.md): Bring Supabase users across from one COPY statement against your project's database. - [Export file format](https://auth.tensile.tools/docs/migrate/format.md): The documented JSON Lines format inside every export, and the rules for programs that read it. ### Reference - [Error catalog](https://auth.tensile.tools/docs/reference/errors.md): Every problem code a client can see, with its HTTP status, its title, and the fix to show the person. - [HTTP API](https://auth.tensile.tools/docs/reference/api.md): Every route the server serves: the app API, the browser routes, the server's own routes, and the admin API. - [App API](https://auth.tensile.tools/docs/reference/api/app.md): The routes under /v1/ that the app's backend calls with its app key. The SDK wraps them, for example check is POST /v1/check. - [Browser routes](https://auth.tensile.tools/docs/reference/api/browser.md): The routes under /auth/ that the browser client and the elements call on the app's origin, through the app's proxy. - [Server routes](https://auth.tensile.tools/docs/reference/api/server.md): The routes the server adds under /auth/ for agents, tokens, claims, OAuth, and devices. - [Admin API](https://auth.tensile.tools/docs/reference/api/admin.md): The routes under /admin/v1/ that administrators call, with a second factor, to inspect and revoke users, sessions, and agents. - [Elements reference](https://auth.tensile.tools/docs/reference/elements.md): Every option, event, custom property, and part of the drop-in elements. - [OWASP ASVS 5.0](https://auth.tensile.tools/docs/reference/asvs.md): The library's self-assessment against OWASP ASVS 5.0: what it meets, where it deviates and why, and what the application owns. - [Cryptography](https://auth.tensile.tools/docs/reference/cryptography.md): Every cryptographic algorithm the library, the server, and the packages use, what each protects, and the post-quantum migration plan. - [Security invariants](https://auth.tensile.tools/docs/reference/invariants.md): The security rules the library holds, each one with the tests that hold it. ## Blog - [How to authenticate AI agents in Go: delegated, scoped, key-bound tokens](https://auth.tensile.tools/blog/authenticate-ai-agents-go): AI agent authentication best practices for a Go server: give each agent a delegated, scoped, short-lived token bound to its key, ask a person before risky actions, and log who did what. - [Choosing a Go authentication library: what to check, and the real options](https://auth.tensile.tools/blog/choosing-a-go-authentication-library): A buyer's guide to picking a golang authentication library: nine things to check, how to verify a project in ten minutes, and a fair look at the options in November 2026. - [WebAuthn vs passkey: what each name means, and what your server stores](https://auth.tensile.tools/blog/passkeys-vs-webauthn): WebAuthn vs passkey, precisely: WebAuthn is the W3C browser API, FIDO2 adds CTAP, and a passkey is the credential they make. Plus what a Go server stores. - [How to prove a person, not their agent, approved an action](https://auth.tensile.tools/blog/prove-a-human-approved-agent-action): A human-in-the-loop approval that an agent can click proves nothing. What real proof needs: a user-verified passkey signature over the exact action, used once, kept in a hash-chained log. - [What is an AI agent identity? Why an API key isn't one](https://auth.tensile.tools/blog/what-is-ai-agent-identity): What an AI agent identity is, why a shared API key or a borrowed user session isn't one, and how to give each agent access that is delegated, scoped, expiring, and revocable. - [Device Bound Session Credentials in Go: stolen cookies stop working in minutes](https://auth.tensile.tools/blog/device-bound-session-credentials-go): How Device Bound Session Credentials (DBSC) tie a session cookie to a hardware key, which browsers support it in November 2026, and how to turn it on in a Go server. ## Optional - [Sitemap](https://auth.tensile.tools/sitemap.xml) - [Blog feed](https://auth.tensile.tools/blog/rss.xml)