# Have an Agent draft your Gmail replies

> Add Mailey, sign it in to Gmail, and have it search and read your mail, label messages and draft replies. It sends only after a person confirms in chat.

Source: https://air.build/docs/connect/draft-gmail-replies-with-an-agent/

Mailey is a specialist Agent for Gmail. It signs in to one Gmail inbox with a Connection of its own, then reads and sorts mail and drafts replies when you ask. In the **New Agent** sheet it's listed as "like a Gmail Assistant", with the line "Reads your Gmail, drafts replies, and sends only with your yes."

Its bio, shown on its profile: "The Team's Gmail inbox: searches and reads mail, threads and attachments, labels messages, drafts replies, and sends mail only after a person confirms in chat."

> [!WARNING]
> Mailey reads the inbox of whoever signs it in, and it's a Team Agent: everyone in the Team can ask Mailey about that inbox, each in their own chat with it. Sign in only with an inbox you're happy for everyone in the Team to reach through Mailey.

## Add Mailey and sign it in

1. Tap **+** (on the Mac, click it) and choose **New Agent**. Under **Specialists**, tap **Add** on **Mailey**'s row. It joins your Team as **@gmail**.
2. Open your chat with Mailey. It has posted a card asking you to sign in. Tap **Connect Gmail**.
3. An AirBuild page opens first, titled "Connect Gmail to this Agent?". Check that the **Agent** and **Workspace** are yours, then tap **Continue to Gmail**.
4. Sign in with the Google account whose Gmail Mailey should use, and allow access.

When it's done, the card shows **Connected**, and the **Gmail** row under **Connections** on Mailey's profile shows the Gmail address. Where the sign-in opens on each device is in [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/#sign-in-from-a-card). If your Team already has an Agent with the ID gmail, see [Add an Agent to your Team](https://air.build/docs/team/add-an-agent/#when-the-id-is-taken).

## Ask Mailey for something

Your own chat with Mailey is the place for mail: only you can read it. Mailey also joins every Project chat, where everyone in the chat reads its answers. To keep it out of a Project, take it out of the Project's **Members**. See [Add an Agent to your Team](https://air.build/docs/team/add-an-agent/#put-an-agent-in-a-project-chat).

Things to ask, going by its bio:

- "What came in from the App Store team this week?"
- "Find the thread with our designer about the new icon and sum it up."
- "Label every message from TestFlight as Builds."
- "Draft a reply to the last message from support@example.com saying the fix ships Friday."

In a group or Project chat, mention **@gmail** so the message reaches it. See [Work with your Agents in chat](https://air.build/docs/projects/work-with-agents-in-chat/#mention-an-agent).

## Sending needs your yes

Mailey's bio says it "sends mail only after a person confirms in chat". So ask for a draft, read it, and tell Mailey in the chat when you want it sent.

That's how Mailey works, not a setting on the Connection: the Connection can do what you allowed when you signed in. The bio says "a person" and doesn't say it has to be the person whose inbox it is.

## Questions

Sign-in errors, **Needs Reauthorization** and sign-in links from someone else are covered in [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/).

**I don't see the sign-in card**

It goes to the chat between Mailey and whoever added it. Anyone in the Team can also open Mailey's profile and tap **Connect** on the **Gmail** row under **Connections**. See [Edit an Agent's profile](https://air.build/docs/agents/edit-an-agent/#open-an-agents-profile).

**It connected the wrong Google account**

On Mailey's profile, tap **⋯** on the **Gmail** row, choose **Reconnect**, and sign in with the right account.

**How do I stop Mailey reading my mail?**

On Mailey's profile, tap **⋯** on the **Gmail** row and choose **Disconnect**. Anyone in the Team can connect it again, and it then uses the account they sign in with. To take Mailey out of the Team, see [Add an Agent to your Team](https://air.build/docs/team/add-an-agent/#remove-an-agent-from-the-team).

**Can Mailey handle two inboxes?**

One Mailey signs in to one inbox. Add Mailey a second time, choose another ID (gmail is taken by then), and sign the second one in to the other inbox.
