# Two-Factor Authentication

Turn on an authenticator app for your Foundry account, sign in with codes, use and replace recovery codes, and what to do if you lose your phone.

Two-factor authentication adds a 6-digit code from an authenticator app to every sign-in, so a stolen password alone can't open your account. It protects your one account across Foundry, Alloy and Glint. The [Security](https://joinfoundry.xyz/workspace/security) page calls it **Multi-Factor Authentication** (MFA).

## What You Need

- An authenticator app that supports time-based codes (TOTP), such as Google Authenticator or Microsoft Authenticator.
- Your current password, or for accounts without a password, your connected Google or GitHub account.

The same controls also appear in the account pages of Alloy and Glint.

## Turn On Two-Factor Authentication

1. Open [Security](https://joinfoundry.xyz/workspace/security) and choose **Set Up Authenticator App**.
2. If Foundry asks you to **Confirm Your Sign-In**, do so. See [Confirming It's You](#confirming-its-you).
3. Scan the QR code with your authenticator app. If you can't scan it, type the **Manual Setup Key** into the app instead. Codes are time-based, six digits long and change every 30 seconds.
4. Enter the 6-digit code your app shows and choose **Enable MFA**.
5. Save your recovery codes, then choose **I Have Saved These Codes**.

The setup key expires after ten minutes. If it does, choose **Return to Security** and start again. Once two-factor authentication is on, the Security page shows **Enabled**, the date you turned it on and how many recovery codes you have left.

## Save Your Recovery Codes

Foundry gives you ten recovery codes when you turn on two-factor authentication and whenever you generate a new set. Each code works once, in place of an authenticator code.

- Choose **Copy Codes** or **Download Codes** to save them.
- Keep them somewhere safe and separate from your authenticator, and never share them.

> [!WARNING]
> Recovery codes are shown only once. Resetting your password or recovering your email does not remove an authenticator, so your recovery codes are how you get back in if you lose your authenticator app.

## Signing In With Two-Factor Authentication

After you sign in with your password, Google or GitHub, the **Verify Your Sign-In** screen opens.

1. Enter the 6-digit code from your authenticator app.
2. Choose **Verify Sign-In**.

A [passkey](https://joinfoundry.xyz/help/foundry/passkeys) sign-in skips this screen, because your device already verified you.

Select **Use a recovery code** if you don't have your authenticator with you. Sign-in requests expire after five minutes. If yours times out, select **Return to Sign In** and try again.

## Confirming It's You

Turning two-factor authentication on or off, replacing your authenticator, generating new recovery codes, and adding or removing a [passkey](https://joinfoundry.xyz/help/foundry/passkeys) all need a recent sign-in, within the last five minutes. If yours is older, Foundry shows **Confirm Your Sign-In**:

- If your account has a password, enter your **Current Password** and choose **Confirm Password**.
- If it doesn't, choose **Confirm with Google** or **Confirm with GitHub**. Foundry may then email you a 6-digit code to enter with **Confirm Code**.

Changes to an existing authenticator also need a code from that authenticator or a recovery code.

## Replace Your Authenticator

Use this when you move to a new phone or a different app.

1. On Security, choose **Replace Authenticator**.
2. Confirm your sign-in if asked, then enter a code from your current authenticator (or a recovery code) and choose **Set Up Replacement**.
3. Scan the new QR code, enter the new code and choose **Confirm New Authenticator**.

Your current authenticator keeps working until you confirm the new one.

## Generate New Recovery Codes

Choose **Regenerate Recovery Codes**, enter an authenticator or recovery code and choose **Generate New Codes**. The new set replaces the old one, and your previous codes stop working.

## Turn Off Two-Factor Authentication

Choose **Disable MFA**, enter an authenticator or recovery code and choose **Disable MFA** again. Your account will no longer ask for a code at sign-in.

## If You Lose Your Phone

1. Sign in and choose **Use a recovery code** on the Verify Your Sign-In screen.
2. Go to Security and choose **Replace Authenticator**, using another recovery code as your current factor.
3. Then generate a new set of recovery codes.

If you have lost both your authenticator and your recovery codes, contact [support@joinfoundry.xyz](mailto:support@joinfoundry.xyz) from your account email.

## What Happens When Settings Change

- Turning two-factor authentication on or off, replacing your authenticator or generating new recovery codes signs out all your other sessions.
- Foundry emails you each time with **Your Foundry Security Settings Changed**. If you didn't make the change, secure your account and contact support.
- Changing your account email also asks for an authenticator or recovery code while two-factor authentication is on. See [Your Account and Sign-In](https://joinfoundry.xyz/help/foundry/account-and-sign-in#change-your-email).

## Limits

| Item | Limit |
| --- | --- |
| Authenticator code | 6 digits, changes every 30 seconds |
| Setup key | Expires after 10 minutes |
| Sign-in request | Expires after 5 minutes |
| Code attempts | 10 per account every 5 minutes |
| Recovery codes | 10 per set, each usable once |

For how Foundry protects accounts more broadly, see [Security & Trust](https://joinfoundry.xyz/help/foundry/security-and-trust#account-protection-abuse-prevention).
