Skip to content
TesseraDocs
MenuTell your agent

Tell your agent

You can ask your coding agent to add Tessera sign-in to your app with one sentence.

View as Markdown

On this page

You can ask your coding agent to add Tessera sign-in to your app with one sentence.

Paste this into your coding agent in the project folder:

Use Tessera for sign-in in this app. Read https://tessera.kurthlabs.ai/llms.txt and follow it.

That page lists the steps in plain text. The agent follows them and you give it one thing: a pairing code. If you have no code, you approve a device login instead.

Make a pairing code

A pairing code lets the agent register one app without ever holding your credentials. A realm administrator makes one in a terminal where tessera is signed in:

tessera pairing create

It prints a line like Add sign-in with Tessera. Pairing code: ABCD-1234. Give that line to the agent. The code works once and stops working after 10 minutes. The command line turns it into a 15-minute token that can register or update that one app and nothing else, so it cannot list your apps or users, delete anything or touch another app. --client-id pins a code to one app.

What the agent does

  1. Checks that the tessera command is installed with tessera version. If it is not, it stops and asks you to install it. The install command is curl -fsSL https://tessera.kurthlabs.ai/install.sh | bash. It checks the download's signature and installs to ~/.local/bin, with no sudo. During early access, the CLI download is by invitation. Ask us for it. Put that folder on your PATH.
  2. Previews the change with tessera init --dry-run -o json. It shows the detected stack, the realm and the redirect URLs, and changes nothing. A preview reads the realm, so it needs a sign-in; with only a pairing code the agent goes straight to the next step.
  3. Asks you for a pairing code and runs tessera init --pair <code> -o json. The code names the realm, so no --realm is needed. If a code is refused (unknown, expired or already used) the agent asks you for a new one and does not guess. If you have no code, tessera init -o json starts a device login instead: the agent tells you to open the printed link and enter the code, and you approve it in your browser. No token or password goes through the chat either way.
  4. Adds the code from the quickstart field of the result. It names the library to install and has your real issuer, client id and redirect URL in it.
  5. Runs tessera doctor -o json, which checks discovery, the signing keys, the app's redirect and logout URIs and, where the realm has a test persona, a token. Each failing check has a code and a fix. --fix adds redirect URIs the app uses and the client lacks.
  6. Starts the dev server and checks that the login route sends the browser to the Tessera sign-in page.

Then it reports the files it changed, the names of the environment variables it wrote, and the redirect URLs.

What tessera init writes

  • It registers the app in your realm, or adds the redirect URLs to the one that is already there. A new app is a confidential client (--public makes a public one with PKCE and no secret), with redirect URLs for the detected dev port.
  • It writes TESSERA_ISSUER, TESSERA_CLIENT_ID and TESSERA_CLIENT_SECRET to .env.local (to .env for Python), plus a random AUTH_SECRET (Next.js, SvelteKit) or SESSION_SECRET (Express, Python) for the app's own session, and keeps that file out of git. The secret is shown nowhere else.
  • It detects Next.js, SvelteKit, Express, Go, Python and MCP servers. Use --stack if it guesses wrong and --port for a different dev port.

Running it again is safe. It changes nothing that is already right. To add a deployed address, run tessera init --url https://app.example.com. If the app exists but its secret is not in the env file, init stops with exit code 1 (kind conflict) rather than replacing the secret; --rotate-secret issues a new one and the old one stops working.

A plain sign-in app needs no resource setting: its access token is for the app itself. resource only matters for an MCP server or another API (see below).

Other jobs

  • Protect an MCP server: tessera init --stack mcp-server --resource https://mcp.example.com (it needs a realm administrator, not a pairing code). See protect an MCP server.
  • Switch to Tessera from your current sign-in (Google, Auth0, Clerk, Firebase, Cognito or your own passwords): see the switch quickstart.

Optional: install a skill

tessera skill install writes a Claude Code skill to .claude/skills/tessera/SKILL.md that holds the same steps. tessera skill print shows it first.

Rules the agent follows

The agent never prints, logs or commits a secret, and never asks you to paste one into the chat. The full list is in setup steps for agents.

If you prefer to do it by hand

Run tessera init yourself. It prints the same code to your terminal. Details: first sign-in and the CLI reference.