# Sign-in and second factor

> How you sign in to Ventgris with an email code or a passkey, how single sign-on opens your workspaces, and how second factors and step-up protect sensitive actions.

Source: https://docs.ventgris.com/security/sign-in-and-second-factor

You have one Ventgris account, on `app.ventgris.com`, whatever the number of organizations and workspaces you belong to. You sign in there, once, and every workspace you are a member of opens from that sign-in. Your second factors (passkeys, an authenticator app, recovery codes) also live on the account, so you set them up once for all your workspaces. This page covers each method, the limits on failed attempts, how long sessions last, and which actions ask for a second factor again.

## Sign-in methods

There is no password. You sign in with one of these:

| Method | How it works |
|---|---|
| Email code | You type your email, Ventgris sends a code of six digits to it. The code is valid 10 minutes and works once |
| Passkey | A passkey you added to your account. It signs you in without typing your email or a code |

### Sign in with an email code

1. Open `https://app.ventgris.com/login`.
2. Type your email and click **Send the code**.
3. Open the email from Ventgris and copy the six digits.
4. Type them in **Code**. If this is your first sign-in, you can also fill **Your name (optional)**.
5. Click **Sign in**.

The same code creates your account if you do not have one yet. The page answers the same way whether an account exists for that email or not, so it does not tell a stranger who has one.

If the email does not arrive, click **Send a new code**. To change the address, click **Use another email**.

### Sign in with a passkey

1. Open `https://app.ventgris.com/login`.
2. Click **Use a passkey**.
3. Confirm on your device (fingerprint, face, PIN or security key).

You must have added a passkey to your account first (see [Add a passkey](#add-a-passkey)). Passkeys are bound to `app.ventgris.com`: every passkey ceremony happens there, never on a workspace address.

### Limits on sign-in codes

| Limit | Value |
|---|---|
| Code length | 6 digits |
| Validity | 10 minutes |
| Uses | one: a used code is refused |
| Wrong attempts per code | 5. After that the code is dead and you ask for a new one |
| Codes sent to one address | 3 per 15 minutes. A fourth request answers "too many codes sent to this address, wait 15 minutes" |

Only a hash of each code is stored. When you ask for several codes, only the latest one is checked.

## How single sign-on opens a workspace

A workspace never sees your login method or your second factor. It receives a signed statement from the account app that says who you are and how recently you proved it.

1. You open `https://NAME.ventgris.com`. Without a workspace session, the workspace sends you to `app.ventgris.com`.
2. If you are signed in to the account app, it checks that your role in that workspace is not `none`.
3. It sends you back to `https://NAME.ventgris.com/_auth/callback` with a one-time code.
4. The workspace machine exchanges that code for an identity token. The exchange must be signed by the key of that workspace's own machine, so a code copied from a URL is useless anywhere else.
5. The workspace checks the token (signature, issuer, audience, expiry) and that your account is one of its current members, then opens its own session.

| Item | Value |
|---|---|
| Authorization code | valid 60 seconds, once |
| Identity token | valid 5 minutes, for one workspace only (its audience is that workspace's id) |
| Role in the workspace | read from the workspace's member list, never from the token |

If you were just added to the workspace, the machine fetches the member list once more before it refuses you. If your account has no access, you see "this account has no access to this workspace" (in the account app) or "this account is not a member of this workspace" (on the workspace).

The workspace address only signs in at its own address: a request that asks to be sent elsewhere is refused.

## Sessions

There are two kinds of web session: one on the account app, and one per workspace you open.

| Session | Idle expiry | Maximum life | Where you see it |
|---|---|---|---|
| Account (`app.ventgris.com`) | 12 hours | 30 days | **Account**, section **sessions** |
| Workspace (`NAME.ventgris.com`) | 12 hours | 7 days | **System**, section **Web sessions** |

Both cookies are `Secure`, `HttpOnly` and scoped to their own host, with no `Domain` attribute, so one workspace cannot read another's cookie. Every request that changes something in a workspace must also carry a CSRF header and come from the workspace's own origin.

### When a workspace session ends on its own

- When you are removed from the workspace (or from the organization that gave you access), your open sessions on that workspace are ended.
- When your role in the workspace changes, your session ends and the next one starts with the new role.

### Sign out

| Where | Button | Effect |
|---|---|---|
| Account page | **Log out** | ends the account session in this browser |
| Account page | **Log out everywhere** | ends every account session of your account, on every device |
| Workspace | revoke all web sessions | ends every web session of that workspace, yours included. Needs a step-up |

Ending the account session does not close workspace sessions already open in other tabs. They expire on their own, or are ended from the workspace.

## Second factors

A second factor protects your account and confirms sensitive actions. You manage them on the account page, section **security**.

| Factor | Counts as a step-up for workspace actions | Notes |
|---|---|---|
| Passkey | yes | the strongest. Also a way to sign in. Up to 20 per account |
| Authenticator app (TOTP) | yes | any app that reads an `otpauth://` QR code. One per account |
| Recovery code | no | 10 codes, each usable once. Only to get back to your account and change its factors |
| Sign-in email code | no | an email code alone never counts as a step-up |

Your account "has a second factor" once it has a confirmed authenticator app or at least one passkey. Recovery codes alone do not count.

### Who needs a second factor

Organization `owner` and `admin`, and workspace `admin` by direct grant, need a second factor. Until you set one up, the account app shows "Owners and admins need a second factor." on every page, with a **Set it up** link. Without one, every action in a workspace that needs a step-up stays closed to you, because a step-up needs a passkey or an authenticator app.

In the account app, a missing second factor blocks the sensitive organization actions (listed in [Step-up in the account app](#step-up-in-the-account-app)): they answer `second_factor_required`, shown as "Owners and admins need a second factor on their account for this action." with **Set it up**. Signing in and reading pages are never blocked, and the first Checkout of an organization does not need a second factor, so a new organization can start before you set one up.

For every other role, a second factor is optional but recommended.

### Add an authenticator app

1. Open **Account** on `app.ventgris.com`.
2. In **security**, under **authenticator app**, click **Set up an authenticator app**.
3. Scan the QR code with your app. If you cannot scan, type the key shown after **Or type the key:**.
4. Type the six digits your app shows in **Code**.
5. Click **Turn on**.

The app is on once the first code is accepted. The seed is stored encrypted and bound to your account. Codes are checked with one 30-second step of tolerance on each side, and each step's code works once.

To replace the app, remove it first with **Remove**, then set up the new one. An account already has an authenticator app when it answers "an authenticator app is already set up: remove it first".

### Add a passkey

1. Open **Account** on `app.ventgris.com`.
2. In **security**, under **passkeys**, type a **Name** for it (for example "Laptop", "Phone", "Security key").
3. Click **Add a passkey**.
4. Confirm on your device.

The passkey is discoverable, so it also signs you in without an email. Adding it requires your device to verify you (fingerprint, face or PIN), which also counts as a fresh step-up. If the browser cannot use passkeys, the page says "This browser cannot use passkeys."

Each passkey shows when it was added and when it was last used. A passkey whose signature counter goes backwards is refused, because a copy of the key would cause that.

### Make recovery codes

Recovery codes come with a passkey or an authenticator app: you cannot make them before you have one.

1. In **security**, under **recovery codes**, click **Make recovery codes** (or **Make new codes** if you already have some).
2. Copy the 10 codes somewhere safe. They are shown this once.
3. Click **I saved them**.

Making new codes deletes the old ones. The page shows how many are left ("{n} codes left."). Each code is 10 characters from an alphabet without look-alike characters, and only a hash is stored.

### Rules for changing factors

| Change | What it needs |
|---|---|
| The first factor of an account | your sign-in alone |
| Adding, removing or replacing a factor once the account has one | a step-up made less than 5 minutes ago (a passkey, an authenticator code, or a recovery code) |
| A new set of recovery codes, when a set already exists | a step-up made less than 5 minutes ago |

When a change needs a step-up, the page sends you to **Confirm it is you** and back to the security section.

### Lost your device

Use a recovery code at the step-up prompt (**Use a recovery code**), then remove the lost factor and add a new one. A recovery code is accepted to change your account's factors, never as a step-up for a workspace action.

> [!WARNING]
> If you lose every passkey, your authenticator app and all your recovery codes, you cannot change your factors yourself. Keep the recovery codes outside the device that holds your passkey.

## Step-up for sensitive actions

Some workspace actions need a fresh proof of your second factor: a step-up. When you try one without it, the workspace answers `stepup_required`, sends you to `app.ventgris.com`, and you confirm there with **Use my passkey** or an **Authenticator app code**. You come back to the page you were on, and the step-up stays valid on that workspace session for 10 minutes from the moment you confirmed.

If your account has no second factor, the prompt says "This action needs a second factor, and your account has none yet." with a **Set one up** link.

### Actions that need a step-up

| Area | Actions |
|---|---|
| [Secrets](https://docs.ventgris.com/workspace/secrets.md) | create, import, replace a value, edit, change grants, delete |
| [Autonomy](https://docs.ventgris.com/workspace/autonomy.md) | thaw after a freeze, reload the rules, create, change or delete a budget, reset a circuit breaker |
| [Brokered actions](https://docs.ventgris.com/agents/brokered-actions.md) | submit an action from the interface, approve an action declared as needing step-up, send at once an action that was requested after untrusted content |
| Rules | confirm a quarantined rule, change a rule's level ([Skills and rules](https://docs.ventgris.com/workspace/skills-and-rules.md)) |
| [Jobs](https://docs.ventgris.com/workspace/jobs.md) | delete a job |
| [Integrations](https://docs.ventgris.com/workspace/integrations.md) | delete an MCP integration |
| [Channels](https://docs.ventgris.com/workspace/channels.md) | save or delete a channel, add, change or remove a channel user, Telegram pairing, WhatsApp setup |
| [Browser](https://docs.ventgris.com/workspace/browser.md) | unlock or wipe a browser profile, allow agents to use the browsers |
| [Files](https://docs.ventgris.com/workspace/files-and-editor.md) | open or change locked paths: `.claude`, `.codex`, `.ssh`, `.config/gh`, `.env`, `.env.*` |
| [System](https://docs.ventgris.com/workspace/system.md) | **Back up now**, **Free space**, revoke all web sessions |

Starting a freeze never needs a step-up: anyone allowed to stop the agent can do it at once.

### Step-up in the account app

Some actions on `app.ventgris.com` change an organization. They need a second factor on your account and a step-up made less than 5 minutes ago with a passkey or an authenticator app (a recovery code does not count).

| Area | Actions |
|---|---|
| Workspaces | add a workspace to an organization that already pays, change a plan, delete a workspace, cancel a deletion |
| Members | invite people, change a workspace role, buy extra seats |
| Billing | cancel the subscription, keep the subscription |

| Your account | What happens |
|---|---|
| No second factor | The action is refused with `second_factor_required`: "Owners and admins need a second factor on their account for this action." **Set it up** opens the **security** section |
| A second factor, not used in the last 5 minutes | The action answers `stepup_required` and a dialog **Confirm it is you** opens on the page: **Use my passkey**, or **Authenticator app code** then **Confirm**. The action then runs once more on its own. **Cancel** gives "Not confirmed: nothing changed." |
| A step-up in the last 5 minutes | The action runs at once |

Reading, opening the billing portal, cost previews and the first Checkout of an organization need no step-up.

> [!AGENT]
> An agent never performs a step-up. If a call answers `auth.stepup_required`, `stepup_required` or `second_factor_required`, stop and ask a human to do the action in the interface. Do not retry, and do not look for another route to the same effect.

## Lockouts after failures

| What fails | Limit | What happens |
|---|---|---|
| Sign-in code | 5 wrong attempts on one code | that code is refused, even if right. Ask for a new one |
| Sending sign-in codes | 3 per address per 15 minutes | "too many codes sent to this address, wait 15 minutes" |
| Second factor (authenticator code, passkey, recovery code) at a step-up or when confirming an app | 5 failures in 5 minutes | "too many wrong answers, wait 5 minutes" |
| Passkey challenge | valid 5 minutes, one answer each, right or wrong | start again |

Each failed step-up is written to the account audit with the method used, never the code.

## Requests from outside the browser

Inside the workspace machine, the `vg` command talks to the daemon through a local socket and needs no web sign-in. Each terminal of the interface carries its own token in its environment, bound to that terminal's processes. See [vg CLI](https://docs.ventgris.com/agents/vg-cli.md).

## Related

- [Security overview](https://docs.ventgris.com/security/overview.md)
- [Account](https://docs.ventgris.com/account/account.md)
- [Roles](https://docs.ventgris.com/account/roles.md)
- [Members](https://docs.ventgris.com/workspace/members.md)
- [Data and backups](https://docs.ventgris.com/security/data-and-backups.md)
