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

# Two-factor authentication

> Protect your DeepMask account with an authenticator app, save recovery codes, and let admins allow or require two-factor authentication for the organization.

Two-factor authentication (2FA) adds a second check when you sign in. On top of your normal sign-in, DeepMask asks for a six-digit code from an authenticator app on your phone. Someone who learns your password still can't get into your account without that code.

DeepMask works with any TOTP-compatible authenticator app, such as Google Authenticator, Microsoft Authenticator, Authy, or 1Password.

## Turn on 2FA for your organization

Admins decide whether members can use 2FA, and whether they must.

**1. Open the security settings**

Open **Settings** and select **Security**. As an admin, you see your organization's security options on this page.

**2. Allow two-factor authentication**

Turn on **Allow Two-Factor Authentication**. Members can now set up an authenticator app from their own settings. Nobody is forced to.

**3. Require it (optional)**

Turn on **Require Two-Factor Authentication** to make it mandatory. Members without 2FA see **Two-Factor Authentication required** and can't use DeepMask until they set it up. Admins are exempt from this block.

**4. Save**

Save your changes.

> [!NOTE]
>
> Turning off **Allow Two-Factor Authentication** only hides the setup option for people who haven't enrolled. Members who already set up 2FA keep it, so your organization's security never weakens without anyone noticing.

> [!WARNING]
>
> If your organization stores secrets in the [Vault](https://documentation.deepmask.io/vault/overview.md), turning 2FA off for the organization needs a fresh authenticator code from an admin, and it makes the Vault read-only.

## Set up 2FA for your account

If your organization allows 2FA, you can set it up in a few minutes.

**1. Start setup**

Open **Settings** → **Security** and select **Enable 2FA**.

**2. Scan the QR code**

Open your authenticator app and scan the QR code. If you can't scan it, enter the code shown under **Can't scan? Enter this code manually**. Then select **I scanned the code, continue**.

**3. Save your recovery codes**

DeepMask shows 10 recovery codes. Copy them with **Copy all codes** and store them somewhere safe, such as a password manager. They are shown only once. Confirm with **I have saved these codes in a safe place**.

**4. Confirm with a code**

Enter the current six-digit code from your authenticator app and select **Turn on 2FA**.

> [!NOTE]
>
> Finish setup within 5 minutes of starting it. If it takes longer, the setup expires. Close the dialog and start again.

If **Security** says **Two-Factor Authentication is not enabled for your organization**, ask an admin to turn on **Allow Two-Factor Authentication**.

## Signing in with 2FA

When 2FA is on, DeepMask asks for a code each time you sign in from a new browser:

1. Sign in as usual.
2. Enter the six-digit code from your authenticator app.
3. Optionally select **Remember this device for 30 days**, then select **Verify and sign in**.

On a remembered device, DeepMask doesn't ask for a code again for 30 days. Don't use this option on a shared or public computer.

Authenticator codes change every 30 seconds. If a code is rejected, wait for the next one and check that your phone's clock is set automatically.

## Recovery codes

Recovery codes let you sign in if you lose access to your authenticator app.

* You get 10 codes when you set up 2FA.
* Each code works once. After you use it, it can't be used again.
* To use one, select **Lost your authenticator? Use a recovery code** when DeepMask asks for your code.

> [!TIP]
>
> If you're running low on recovery codes, or you've used one because you lost your phone, turn 2FA off and set it up again to get a fresh set of 10.

## Turn off 2FA

1. Open **Settings** → **Security**.
2. Select **Disable 2FA**.
3. Confirm with a code from your authenticator app, or with a recovery code if you no longer have the app.

After this, DeepMask no longer asks for a code when you sign in. If your organization requires 2FA, you'll need to set it up again before you can keep using DeepMask.

## If you lose your phone

> [accordion] You have a recovery code
>
> 1. Sign in using a recovery code.
> 2. Open **Settings** → **Security** and turn off 2FA, confirming with another recovery code.
> 3. Set up 2FA again with your new phone and save the new recovery codes.

> [accordion] You have no recovery code
>
> Contact your organization's admin or [contact@deepmask.io](mailto:contact@deepmask.io). For your security, support verifies your identity before resetting 2FA on your account.

## 2FA and the Vault

Admins who manage the organization's [Vault](https://documentation.deepmask.io/vault/overview.md) need 2FA, and the Vault has stricter rules than sign-in:

* **Only authenticator codes count.** Recovery codes, emailed codes, and remembered devices never open the Vault.
* **Codes don't carry over.** Even if you just signed in with a code, you enter a fresh one to open the Vault.
* **The Vault closes on its own.** It stays open for at most one hour per session. See [Open the Vault](https://documentation.deepmask.io/vault/open-the-vault.md#when-the-vault-closes).
* **New authenticators need a new sign-in.** After setting up or replacing your authenticator, sign out and sign in again before opening the Vault.


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