---
title: Get a Gmail App Password
nav: Gmail password
summary: Create a separate Gmail password for Agent J, paste it on your phone, and revoke it whenever you want.
order: 37
---
# Get a Gmail App Password

Agent J uses IMAP/SMTP to work with your mailbox. Give it a separate **App Password** rather than your main Google password. You can revoke this password separately. It still gives access to your mailbox: keep it private.

## Turn on 2-Step Verification

Open [Google security settings](https://myaccount.google.com/security) and follow [Google’s 2-Step Verification instructions](https://support.google.com/accounts/answer/185839). Finish enabling it before continuing.

![Google security settings; account details have been covered](step-4.png)

## Choose the right account

Check that the Google account matches the Gmail address you gave Agent J. You can switch accounts from the profile menu. All identities and avatars in these examples are covered with solid blocks.

![Account menu with identities and avatars removed](step-5.png)

## Create a password named Agent J

Open [Google App passwords](https://myaccount.google.com/apppasswords). Google may ask you to sign in again. Name the new password **Agent J** and choose **Create**.

![Name the new app password Agent J](step-2.png)

## Copy, keeping the spaces

Copy the entire generated value. **Keep the spaces; paste as copied.** The value below is only an example, not a working password. The original value was completely covered before this image was saved.

![Generated password replaced with abcd efgh ijkl mnop](step-3.png)

## Paste into Agent J

On your phone, open **Settings → Email**, enter your Gmail address, then tap **Set email authorization code**. The popup says **Gmail App Password**. Paste the value and save. After saving, Agent J checks IMAP and SMTP without sending mail and shows the result. The saved value never appears again; use **Set · Change** to replace it.

You can also tell Agent J your address and server details in chat. It configures those first, then opens the same key card with `agentj mail password`. **Never send a password in chat.** It travels encrypted to your Agent J computer and is stored there in an encrypted private file.

![The phone key card; private details removed and password replaced with an example](step-1.png)

## If it does not work

- No App passwords option? Check 2-Step Verification. Workspace policy, Advanced Protection or an account using only security keys may prevent it; ask your administrator or use another supported mailbox.
- Login failed? Check the account, copy a fresh app password, and check the computer’s network and IMAP/SMTP settings. A changed main Google password invalidates existing app passwords.
- A failed connection check still means the password was saved. Replace it through **Set · Change**; no test message was sent.
- Gmail setup details and policy exceptions: [Google’s official App Password help](https://support.google.com/accounts/answer/185833).

## Revoke it

Return to [Google App passwords](https://myaccount.google.com/apppasswords), find the entry you created for Agent J and delete it. Agent J can no longer use that password. Turn off the email channel in Agent J if you no longer need it; create a new app password if you want to reconnect later.
