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

# Gmail mailboxes

> Let an AGO agent sort your Gmail inbox, prepare replies and forward emails to the right colleague

Connect a Gmail mailbox to an AGO agent. AGO reads each new email, puts it in a category, and applies the actions you chose for that category: add a label, mark it as read, archive it, prepare a reply, reply on its own, or forward it to a colleague.

You decide how far AGO goes, category by category. Most teams start with labels and drafts, then let AGO reply on its own for the categories where its drafts are sent without changes.

## What you need

* An AGO administrator account
* A Gmail or Google Workspace mailbox you can sign in to
* An agent whose knowledge covers the questions this mailbox receives, if you want AGO to prepare replies

<Note>
  Connecting Gmail requires Google sign-in to be enabled on your AGO environment. If the connect buttons are greyed out, contact AGO support. On Google Workspace, your Google administrator may need to allow the AGO application first.
</Note>

## Connect a mailbox

<Steps>
  <Step title="Choose the mailbox type">
    Open **Channels > Mailboxes**, then click:

    * **Connect my mailbox** for your own inbox. Only you can see it in AGO.
    * **Connect a shared mailbox** for an address such as `contact@` or `support@`. You can then add the colleagues who follow it.
  </Step>

  <Step title="Sign in with Google">
    A Google window opens. Sign in to the mailbox and keep the Gmail permission ticked. AGO asks for one permission once; the actions it takes are then limited by your settings in AGO.
  </Step>

  <Step title="Check how AGO sorts your emails">
    After the connection, the **Preview** tab opens. Click **Preview my latest emails**: AGO shows the category it would give each recent email and the actions it would take, without changing anything in your mailbox.

    If a category is wrong, pick the right one. AGO remembers it for that sender.
  </Step>

  <Step title="Choose what AGO does">
    Open **What AGO does**:

    1. Pick the agent that writes the replies.
    2. For each category, choose the actions. New mailboxes start with six categories (To respond, FYI, Invoices & payments, Meetings, Notifications, Newsletters & promotions); rename, delete or add your own. Describe each category in a sentence: AGO uses the description to sort emails.
    3. Click **Save** on each category you change.
  </Step>
</Steps>

From then on, AGO processes new emails as they arrive. Emails already in your inbox when you connect are left alone.

## Actions per category

| Action | What happens in Gmail |
| - | - |
| Add the label | The email gets the label `AGO/<category>` |
| Mark as read | The email is marked as read |
| Archive | The email leaves the inbox; it stays in All Mail |
| Prepare a draft | A reply appears as a draft in the conversation, labelled `AGO/Draft ready`. You review and send it from Gmail |
| Reply automatically | AGO sends the reply and labels the email `AGO/Replied` |
| Prepare a forward | A draft forward of the email, addressed to the address you entered |
| Forward automatically | AGO sends that forward and labels the email `AGO/Forwarded` |

Replies look like the ones you write in Gmail: they stay in the conversation, and the original email is quoted below the answer, introduced by the date and the sender, in the mailbox language.

Type the address to forward to: a colleague, even one who does not use AGO, or someone outside your organization such as your accountant. AGO warns you when an address is outside your organization, to catch typos. A forward looks like one you would write yourself: a short note from AGO at the top stating the category or rule, the sender and whether the sender was verified, then the original email in full with its sender, date, subject and recipients, and its attachments. When the original email is larger than 18 MB, AGO forwards its text without the attachments and the note asks the recipient to open the original in the mailbox.

## Rules

Categories sort every email into one place. Rules handle precise cases on top of that, in your own words: "a customer asks for a quote", "an invoice above 10,000 euros", "a message from our bank". Several rules can apply to the same email.

In **What AGO does > Rules**, click **Add a rule**, then:

1. Give it a name.
2. Under **When the email…**, describe something visible in the email, and say what does not count. For example: "A customer asks for a quote or a price proposal. A payment reminder does not count." Vague rules apply badly.
3. Under **Then**, choose what AGO does:

| Action | What happens in Gmail |
| - | - |
| Add the label | The email gets the label `AGO/<rule name>` |
| Keep in sight | The email stays unread in the inbox and gets the label `AGO/⚠️ Review`, even if a category or another rule would hide it |
| Mark as read | The email is marked as read |
| Archive | The email leaves the inbox; it stays in All Mail |
| Forward to a colleague | A forward to the address you entered, prepared as a draft or sent automatically |

4. Click **Try on my latest emails**: AGO shows which of your last 20 emails the rule applies to, without changing anything in your mailbox or keeping their content. Click the question mark next to an email to see why the rule applies or not. Adjust the wording until the list is right, then click **Save**.

Before a rule marks an email as read, archives it or forwards it, a second, more careful AI model reads the email again and must confirm the rule. If it does not, the email stays in your inbox and the activity shows **The second check did not confirm the rule**. Labels and **Keep in sight** apply as soon as the rule matches.

Each rule card shows how many times the rule applied in the last 30 days, and how many times the second check turned it down. Switch a rule off with its **Active** toggle without deleting it. A mailbox can have up to 100 rules.

## Move to automatic step by step

When most drafts of a category go out without edits, AGO says so on the category card, for example "11 of the last 12 drafts were sent without changes". Click **Switch to automatic**, then **Save**.

Even in automatic mode, AGO keeps a draft instead of sending when:

* The sender is not verified, or, unless the mailbox replies to every verified sender, is not part of your organization or your trusted senders
* The category is marked **Sensitive**
* Someone already replied in the conversation, or AGO already replied automatically in it
* The agent is not sure of its answer
* The reply contains a credential stored in your AGO settings, such as an API key
* The reply links to a website other than your organization's, the sender's or one cited in your knowledge base
* AGO reached the limit of automatic replies to that sender for the day
* The email arrived more than a week ago, for example while the mailbox was disconnected. AGO still sorts it and prepares the draft
* You had already read the email when AGO processed it, for example on your phone. AGO also leaves it in your inbox

## Senders

In **What AGO does > Senders**, choose who gets automatic replies:

* **Trusted senders only** (default): verified senders of your organization or of your trusted senders. Everyone else gets a draft.
* **Every verified sender**: anyone whose address passes the sender verification, new customers included. Unverified senders still get a draft, and every other safeguard still applies.

Then add email addresses or whole domains (`@example.com`):

* **Trusted senders** can receive automatic replies, once their address is verified. Your organization's domain is always trusted.
* **Ignored senders** are left alone: AGO does nothing with their emails.

## Security checks

AGO checks every email before an AI model reads it:

* **Sender verification**: AGO reads the SPF, DKIM and DMARC results Gmail records. An unverified sender never gets an automatic reply or forward.
* **Suspicious emails**: hidden text, instructions written for an AI, a domain imitating a known one (`acrne.com` for `acme.com`), or a sender name hiding another address. These emails get the label `AGO/⚠️ Review`, stay unread in your inbox, and receive no reply.
* **Payments and passwords**: requests to change bank details, urgent transfers, gift cards, passwords or codes are never handled automatically and are flagged for review.
* **Newsletters and automatic messages**: AGO never replies to mailing lists, no-reply addresses or out-of-office messages, and never answers its own replies.
* **Hourly limit**: past the number of automatic actions per hour set in **Settings** (20 by default), AGO pauses the mailbox and sends you a notification.

Replies to people outside your organization only use the public documents of the agent's knowledge base.

## Privacy

Only the person who connected a mailbox, and the members of a shared mailbox, can see it in AGO. Conversations from mailboxes never appear in Chat History, analytics or exports.

In **Settings > Privacy**, choose what AGO keeps:

* **Actions only** (default): AGO records what it did and why, never the content of your emails. In **Activity**, senders and subjects are read live from Gmail.
* **Private history**: AGO also keeps an encrypted copy of the sender, the subject, an excerpt and the drafts it wrote, for 7, 30 or 90 days.

In both modes, AGO also keeps a short encrypted explanation of why it chose each email's category and rules, deleted after the same period (30 days by default).

AGO super administrators can open a mailbox to help you with support. Every such access is listed in **Settings > Access by super administrators**.

## Follow and correct AGO

The **Activity** tab lists each processed email with its category and actions; an action taken by a rule shows the rule's name. Click the question mark next to the category to see why AGO chose it and the rules, and why the second check confirmed them or not. Hover an action to see why AGO held it back. Turn on **To review only** to see suspicious emails and actions that were downgraded, blocked or failed.

* Click the undo icon on an action to remove a label, mark an email as unread again, move it back to the inbox or delete a draft. Sent replies and forwards cannot be undone.
* Move an email to another `AGO/` label in Gmail: AGO remembers the new category for that sender.

## Pause or disconnect

* **Pause** stops all actions. Emails received during the pause are not processed when you resume.
* **Settings > Disconnect** revokes AGO's access and deletes any stored email details. The activity history is kept.
* **Settings > Delete** also deletes the activity history.

If Google revokes AGO's access, for example after a password change, the mailbox shows **Needs reconnection** and you get a notification. Click **Reconnect**: your categories and settings are kept.


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