# Dashboard: sign-in, keys and security (Coming soon)

> **Coming soon.** Details may change before release.
>
> **What the pages show.** `/dashboard` shows your organization's name and status, a frozen banner, the balance (available and held), your machines with a **Stop** button, a **Connected apps** section on `/dashboard` and `/dashboard/keys`: one row per approved OAuth client with the app name (marked "Unverified app"), redirect host, spend cap, spent, created and last used (in micro-USD and `yyyy-MM-dd HH:mm:ss`), an **Update cap** field ($1 to $1000; raising needs a fresh sign-in) and a **Revoke** button, and **Sign out** and **Sign out everywhere** buttons. `/dashboard/keys` lists keys (label, prefix, created, created IP, last used, cap, revoked) and lets you create, edit and revoke them. The JSON routes below do the same.

This page is for the people in your organization, not for agents. Agents keep using `ak_` keys (see [API reference](api-reference.md)) or [OAuth](mcp.md#connect-with-oauth-coming-soon).

## Signing in

There are no passwords. Go to `https://api.capvm.com/signin`, enter your email address and click **Email me a link**. CapVM emails you (subject `Sign in to CapVM`):

```
Sign in to CapVM.

Open this single-use link. It expires at 2026-10-26T14:15:00Z.

https://…/signin/confirm/…

Or enter this code on the sign-in page: 7K2QW9MD
```

Either open the link and click **Sign in**, or type the code into the **Code** field on the sign-in page and click **Sign in with code**. You then land on the page you came from, or `/dashboard`.

- **Link and code are one sign-in.** Both expire **15 minutes** after the email is sent, and using one uses up the other.
- **The code works only in the browser that asked for it** (it's bound to a sign-in cookie). Asking for a new email in that browser replaces it.
- **The code** is 8 characters from `0-9` and `A-Z` without `I`, `L`, `O` and `U`. Case, spaces and dashes don't matter, and `I`/`L` are read as `1`, `O` as `0`.
- **5 wrong codes** use up the sign-in; ask for a new email.
- **The page always says "Check your email for a sign-in link."**, even for an address CapVM doesn't know, and even if the email couldn't be sent. If nothing arrives, ask for a new email (the rate limit below applies).
- **Rate limit:** 5 emails per hour per IP and 5 per hour per email address, `429 rate_limited` `Sign-in rate limit exceeded.` with `Retry-After`.
- **Every sign-in sends a security alert** (see [Alert emails](#alert-emails)).

### Sign-in errors

The link page (`/signin/confirm/{token}`) shows the error on the page with the status:

| Status | Code | Message |
|---|---|---|
| 400 | `validation_error` | `This sign-in link is not valid.` |
| 400 | `link_used` | `This sign-in link was already used.` |
| 410 | `link_expired` | `This sign-in link has expired.` |

The code form (`POST /signin/code`) answers with a redirect on success, or JSON:

| Status | Code | Message |
|---|---|---|
| 400 | `code_invalid` | `That code is not valid.` The error also has `tries_left`: `{"error":{"code":"code_invalid","message":"That code is not valid.","tries_left":4}}` |
| 410 | `code_burned` | `This code can no longer be used.` (expired, already used, 5 wrong tries, or asked for in another browser) |
| 400 | `validation_error` | `code is required.` / `Antiforgery token is required.` / `returnUrl must be a local path.` |

`returnUrl` must be a path on this site (starting with a single `/`, no `\`, no `://`, no spaces, at most 2048 characters). A sign-in page with any other `returnUrl` ignores it.

## Sessions

- The session is a cookie, `__Host-capvm_session` (HttpOnly, Secure, SameSite=Lax).
- It ends after **12 hours without use** or **7 days** at the latest.
- The session cookie isn't accepted on `/mcp` or on agent routes such as `/v1/machines`.

### Confirming it's you (reauth)

Some actions need a sign-in or confirmation within the **last 5 minutes**:

- creating an API key
- raising a key's spend cap
- approving an OAuth client and raising its cap (Coming soon)

Otherwise the route returns `403 reauth_required` `Sign in again to continue.` (`Sign in again to raise this spend cap.` for an OAuth client's cap). Go to `/signin/reauth`, click **Email me a code** (subject `CapVM sign-in code`, same link and code), and enter it under **Confirm it's you**. Lowering a cap, renaming or revoking a key never needs it.

A sign-in that came from a page that sent you to sign in (it carries a `returnUrl`, as `/dashboard` and the OAuth approval do) counts as fresh. A sign-in started at plain `/signin` doesn't: creating a key right after it asks you to confirm.

### Signing out

- **Sign out** (`/signout`) ends this browser's session.
- **Sign out everywhere** (`/signout/all`) ends **all your** sessions in every browser. It doesn't sign out other people in your organization and doesn't touch API keys. It also revokes every [OAuth grant](#connected-oauth-clients) you approved.

Both are buttons on the dashboard and work while the organization is frozen.

## API keys

Signed in, you can manage your organization's `ak_` keys with these routes (the dashboard's Keys page uses the same routes). Every key in the organization is listed, including revoked ones, newest first, with:

| Field | |
|---|---|
| `id` | key id |
| `label` | your name for it, or `null` |
| `prefix` | the start of the key, to recognise it |
| `created_at` | when it was created |
| `created_ip` | the IP it was created from (`null` for keys CapVM issued) |
| `last_used_at` | the last machine it created or usage it recorded, or `null` |
| `revoked_at` | `null` while active |
| `spend_cap_micro` | its spend cap |

**Creating a key** needs a fresh sign-in and a spend cap between $1 and $1000 (in micro-USD; outside that range you get `400 cap_out_of_range`), plus an optional label (1 to 80 characters). The new key is an `ak_live_` key that may use every SKU and run up to **10 machines at once**. **The full key is shown only in the create response.** CapVM emails you an alert (subject `CapVM API key created`). Creating a key also needs a current Terms acceptance (`403 terms_not_accepted`).

**Renaming** and **changing the cap** use the same route. Raising the cap needs a fresh sign-in; lowering it doesn't. A revoked key can't be changed.

**Revoking** a key takes effect on its next call (`401 key_revoked`). Revoking twice is fine.

Full request and error tables: [API reference → Organization](api-reference.md#organization-coming-soon).

## Machines and usage

Signed in, you can list every machine in the organization, stop any of them, and read the organization's usage. Stopping works while the organization is frozen. See [API reference → Organization](api-reference.md#organization-coming-soon).

## Connected OAuth clients

> **Coming soon.**

Clients you approved through [OAuth](mcp.md#connect-with-oauth-coming-soon), such as Codex, are listed at `GET /v1/org/oauth/grants` with their name, `verified` (always `false`), redirect host, cap, amount spent, created and last-used time. You can change a client's cap ($1 to $1000; raising needs a fresh sign-in) or revoke it, which ends its tokens at once. A client can also revoke itself through `POST /oauth/revoke`. There's no Connected apps screen yet. See [API reference → OAuth grants](api-reference.md#oauth-grants-coming-soon).

## Alert emails

CapVM emails the person concerned when:

| Event | Subject | "This wasn't me" link |
|---|---|---|
| A sign-in or confirmation completes (`sign_in`) | `CapVM sign-in` | yes |
| You create an API key (`key_created`) | `CapVM API key created` | yes |
| You approve an OAuth client (`oauth_grant`) | `CapVM security alert` | yes |
| An OAuth refresh token is reused (`refresh_reuse_detected`) | `CapVM security alert` | yes |

The sign-in and key alerts look like this:

```
CapVM security alert.

Event: sign_in
Time (Europe/Zurich): 2026-10-26 15:00:00
Time (UTC): 2026-10-26 14:00:00
IP: 203.0.113.7
User-Agent: Mozilla/5.0 …

This wasn't me: https://…/signin/lockdown/…
That link is single-use and expires in 7 days. It signs out every session, revokes API keys created in the last 24 hours, and freezes the organization.
```

The OAuth alerts have the same layout with a `Client:` line (the client's name) after `User-Agent:`, the same "This wasn't me" link and sentence, and a last line `Questions: hello@capvm.com.`

## "This wasn't me"

The link opens a page with a **Lock this organization** button. Clicking it:

1. signs out **every session of everyone in the organization**,
2. revokes **every API key in the organization created in the last 24 hours** (older keys keep working, within the freeze rules below),
3. **freezes the organization**.

The page then says "Organization locked". It also revokes the OAuth grants of everyone in the organization (see [Connected OAuth clients](#connected-oauth-clients)). Only CapVM can unfreeze: contact hello@capvm.com.

The page shows `400 validation_error` `This link is not valid.`, `400 link_used` `This link was already used.` or `410 link_expired` `This link has expired.` when it can't lock.

## Frozen organizations

A "This wasn't me" lockdown or CapVM can freeze an organization. You can still sign in. The dashboard shows "This organization is frozen. The dashboard is read-only. You can still review usage, revoke keys, and sign out everywhere."

| Still works | Returns `403 org_frozen` `This organization is frozen.` |
|---|---|
| Signing in, signing out, signing out everywhere | Creating a key |
| Listing keys, revoking a key, lowering a key's cap | Raising a key's cap, renaming a key |
| Listing and stopping the organization's machines, reading usage | Creating machines, exec, topping up |
| `ak_` keys: `GET /v1/balance`, `GET /v1/usage`, `DELETE /v1/machines/{id}` (with or without a trailing slash); over MCP (also with an OAuth token) `initialize`, `ping`, `tools/list`, `get_balance`, `get_usage`, `stop_machine` | `ak_` keys: every other REST call; over MCP (also with an OAuth token) the tools `create_machine`, `get_machine`, `list_machines`, `exec`, `create_checkout_session` fail with `org_frozen` |
| OAuth clients: revoking, lowering the cap, the MCP calls above | OAuth clients: approving, raising the cap, the MCP tools above (see [MCP](mcp.md#frozen-organizations)) |

`GET /v1/account` shows `"frozen": true`.
