> ## Documentation Index
> Fetch the complete documentation index at: https://traceroot.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up traceroot in a repository, follow the setup prompt in https://traceroot.ai/docs/getting-started/coding-agents.md.

# AgentID

> Give an AI agent a traceroot account of its own, signed in through AgentID

Give an AI agent a traceroot account of its own. AgentMail runs [AgentID](https://www.agentid.com) so that AI agents can sign in to apps. The agent's AgentMail inbox acts as its login, and traceroot handles it like any other OpenID Connect provider. traceroot keys the account on the agent's AgentID identifier, so every later sign-in from that inbox lands in the same account.

> [!NOTE]
>
> A new agent account starts without access to your team's projects. See [Limitations](#limitations).

## When it fits

* **The agent needs a login that belongs to it.** Nobody on the team shares a password or a session with it.
* **The agent comes back later.** Each sign-in from the same inbox opens the account it used before.
* **You want agent accounts and people's accounts kept apart.** traceroot never merges an agent's account into an existing one, including one with the same email address.

## Before you start

The agent needs an AgentMail inbox and must be able to approve a sign-in for it. AgentMail's [AgentID Sign-In](https://docs.agentmail.to/agentid-sign-in) guide walks through both.

## Sign in

1. Go to [app.traceroot.ai/auth/sign-in](https://app.traceroot.ai/auth/sign-in). Below the sign-in button, next to "Signing in as an AI agent?", select **Continue with AgentID**.
2. On AgentID's page, use the agent's inbox and approve the request the way AgentMail's guide shows.
3. traceroot opens with the agent signed in. The account email is the inbox address.

## What traceroot receives

The sign-in asks AgentID for three scopes: `openid`, `email` and `profile`. traceroot uses three claims from the result.

| Claim | Used for |
| - | - |
| Identifier (`sub`) | Matching a returning agent to its account |
| Email | The account's email address |
| Name | Shown as the account's name. Without one, traceroot uses the part of the email before `@` |

## Self-hosting

Sign in with AgentID is off until both variables are set in `.env`. With both set, **Continue with AgentID** on the sign-in and sign-up pages becomes active.

```bash theme={null}
AUTH_AGENTID_CLIENT_ID=your-agentid-client-id
AUTH_AGENTID_CLIENT_SECRET=your-agentid-client-secret
```

1. In the [AgentID console](https://console.agentid.com), register traceroot as a new application.
2. Register the callback `<BETTER_AUTH_URL>/api/auth/callback/agentid`.
3. Set **Maximum signups per owner** on the application before you turn sign-in on. AgentID enforces that cap.
4. Add the client ID and secret to `.env` and restart the web service.

## Limitations

* Accepting a workspace invitation takes a verified email address or a password account. An AgentID account has neither, so team access goes through a project API key.
* traceroot treats the email address AgentID reports as unverified, which is why a matching address never links two accounts.

## Next steps

> [card] [Workspaces, projects, and access](https://traceroot.ai/docs/getting-started/concepts.md)
>
> Roles, project API keys and how access is scoped.

> [card] [API authentication](https://traceroot.ai/docs/api-reference/authentication.md)
>
> Credential types and the routes each one can call.

> [card] [traceroot CLI](https://traceroot.ai/docs/cli/get-started.md)
>
> Install the CLI and see its commands.

> [card] [traceroot in the AgentID directory](https://www.agentid.com/apps/traceroot)
>
> AgentID's page about signing in to traceroot.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.