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

# Authentication

> Sign in with your name and token, and how sessions are stored and validated.

Cadenza uses a **name + token** sign-in. An administrator creates your account and
issues you a token <Tooltip tip="Don't have a token? Reach out to acparekh@stanford.edu to request one and unlock this feature."><Icon icon="circle-question" iconType="regular" /></Tooltip>, then hands it to you out-of-band.

<Note>
  Authentication is only required for **account-scoped** commands: `env action
    create` and `env action list` (your actions live under your account). Scaffolding,
  running missions, stats, and fine-tuning all work signed-out.
</Note>

## Commands

| Command                        | Description                                 |
| ------------------------------ | ------------------------------------------- |
| `cadenza login <name> <token>` | Verify your credentials and save a session. |
| `cadenza whoami`               | Show the currently signed-in account.       |
| `cadenza logout`               | Forget the saved session.                   |

```bash theme={null}
cadenza login ada my-sign-in-token
# signed in as ada (8f2c…)

cadenza whoami
# signed in as ada (8f2c…)

cadenza logout
# signed out.
```

## How sessions work

* On `login`, your `(name, token)` is verified **live** against the backend. On
  success the session is written to `~/.cadenza/config.json` (created
  owner-readable, `0600`).
* Every protected command re-validates the session **live on each call**, with no
  caching. If your token is revoked, or an admin sets your account inactive, the
  next command fails immediately with a clear message.
* A deactivated account (`is_active = false`) is refused even with a valid token.

<Warning>
  If you see **"session expired or revoked"** or **"this account has been
  deactivated"**, your credentials are no longer valid. Run `cadenza login` again
  with a fresh token from your admin.
</Warning>

## Requesting a token

Don't have a token yet? Email **[acparekh@stanford.edu](mailto:acparekh@stanford.edu)**
to request one. You'll be given a `name` and a `token`, then sign in with
`cadenza login <name> <token>`.
