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

# Two-Factor Authentication

> Add an authenticator app code to your sign-in, keep recovery codes, and require a second factor for an organization.

Two-factor authentication adds a code step to your sign-in. After your password, or after you continue with Google or GitHub, you enter a six-digit code from an authenticator app, for example 1Password, Google Authenticator, or Authy.

A [passkey](https://docs.agent.golf/account/passkeys.md) is also a second factor. A passkey sign-in has no code step.

## Before you begin

* A sign-in in the last 10 minutes, to set up, replace, or remove an authenticator app, or to generate recovery codes. After an older sign-in, the page asks you to select **Sign In Again**.
* An account that does not sign in through SSO. With SSO, your identity provider controls sign-in security, and the **Security** page shows only a notice.

## Set up an authenticator app

1. Open the account menu and select **Security**.
2. In **Two-Factor Authentication**, select **Set Up**.
3. Scan the QR code with your authenticator app, or enter the secret manually.
4. Enter the code that the app shows.
5. Save your [recovery codes](#recovery-codes), then select **I Saved These Codes**.

Nothing changes until the code is correct. If you close the dialog first, your sign-in stays as it was.

## Sign in with a code

After your password, Google, or GitHub sign-in, enter the code from your authenticator app in **Authenticator Code**. Each code works one time.

* After 5 wrong codes in one sign-in, start the sign-in again.
* After 10 wrong codes in a row, your authenticator app is locked for 15 minutes. A new sign-in does not reset this count. A recovery code and a passkey still work during the lock.

If you also have a passkey, you can select **Use a passkey** instead of a code.

## Recovery codes

A recovery code lets you sign in when you do not have your authenticator app. You get 10 codes, and each code works one time. Agent Golf shows the codes only when you generate them, so keep them in a safe place, for example your password manager.

To use a code:

1. Sign in with your password, or continue with Google or GitHub.
2. On **Two-Factor Authentication**, select **Use a recovery code**, and enter the code.

The **Security** page then opens so that you can replace your authenticator app. If a GitHub sign-in asks you for a passkey, first select **Use Your Authenticator App**.

**Security > Recovery Codes** shows how many codes remain. To get a new set, select **Generate New Codes**. The earlier codes then stop working.

## Replace or remove your authenticator app

In **Security > Two-Factor Authentication**:

* Select **Replace** to move to a new app. The old app stops working.
* Select **Remove** to turn off the code step. Your recovery codes also stop working.

If you lose your authenticator app, sign in with a recovery code or a passkey, then select **Replace**. If you have neither, contact support. Support must confirm your identity before it can remove the authenticator app.

## If your organization requires two-factor authentication

The requirement applies when you sign in to that organization with a password and have no passkey and no authenticator app. A sign-in with Google, GitHub, or SSO does not need a second factor.

After an administrator turns on the requirement, you have 24 hours. During this time, a notice shows the deadline. Add a passkey or an authenticator app on the **Security** page.

After the deadline, if you still have no second factor:

* Your dashboard session and your CLI sign-ins in that organization stop at their next token refresh, at most 10 minutes later. See [Sign-in and token lifetimes](https://docs.agent.golf/account/identity.md#sign-in-and-token-lifetimes).
* You set up an authenticator app at your next sign-in, then generate recovery codes on the **Security** page.
* You cannot switch to a workspace in that organization until you add a second factor.

While the requirement applies, you cannot remove your last passkey or authenticator app. Add another one first.

## Require two-factor authentication for an organization

You need the **Manage Organization** permission.

1. Open **Settings > Organization > General**.
2. In **Two-Factor Authentication**, select **Require Two-Factor Authentication**, then **Require**.

Users then have 24 hours to add a second factor. This includes you. The requirement asks only that a second factor exists: a user with a passkey and no authenticator app can still sign in with a password alone.

To end the requirement or a running grace period, select **Turn Off**. The second factors that users set up stay in place.

An organization with an SSO connection cannot use this setting, because its identity provider controls sign-in security.


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