gaia agent reads your mailbox, Gmail or Outlook, through eight reading tools, and drafts and sends mail through the bundled send-email skill. With a local model, every inference over an email body runs on your machine via Lemonade and mail you read stays on your device; with a cloud model, the mail the agent reads goes to that provider. Mail you send leaves only after you approve it.
It lists your inbox, searches it, opens a message or a whole conversation, finds the threads waiting on your reply, and lists folders. Asked to send, reply, forward or draft, it loads the send-email skill, which saves drafts, replies, forwards and sends, and every send asks you first. It does not archive, label or delete messages yet. Triage itself — working out what actually needs you — is judgment the model does, driven by the bundled inbox-triage skill; the tools hand it facts, never verdicts. The plan for the remaining verbs is Email triage as a skill.
Action surface
The reading tools are always there. The drafting and sending tools ship in thesend-email skill and join the tool list, as send-email/<tool>, only once the agent loads it, so a turn that only reads mail doesn’t carry them.
list_waiting_on_you is narrow on purpose: newsletters, cold outreach, and automated senders never qualify, and neither does a sender you told to stop writing. A first message from someone you have never replied to won’t appear either — the full triage pass still catches those. It scans the 50 most recent inbox messages by default (up to 100 on Gmail, 200 on Outlook), and says when older mail was not checked.
Reading bodies is bounded per turn, not just per message: once a turn has read enough mail to fill its share of the context window, read_email and get_thread refuse with turn_budget_exhausted and say so, instead of quietly overflowing the conversation. get_thread also refuses up front when the thread has too many messages to fit in what is left of the turn, and names the thread’s size and the remaining budget — read the messages that matter one at a time instead.
Setup
Every step below runs thegaia command, so install GAIA first if
you haven’t.
1. Connect your mailbox
In the Agent UI, just ask. Ask about your mail or calendar before an account is connected (“what came in today?”) and the reply comes with a Connect Google and Connect Microsoft button. Press one, sign in in the browser tab that opens, and ask again; GAIA gets access to the account in the same step. The same buttons are under Settings › Connectors. The agent never asks you to run a command for this. The rest of this step is for a terminal, a headless host, or a first-time Google client. These steps connect Gmail. For Outlook or Microsoft 365, follow the Microsoft connector guide instead, then come back to step 2 — everything after the connection is the same.First time connecting a personal Google account? You need to create your own
OAuth client in the Google Cloud Console and — crucially — enable the Gmail API on
that project first, or the first mailbox call 403s even though the connection looks
healthy (#2116). The
Google connector walkthrough covers the full, verified sequence
(enable APIs → add yourself as a test user → create the client). A future release
(#2104) ships an AMD-managed client that
removes this bring-your-own step.
gmail.readonly to read and gmail.compose to draft and send, plus calendar.events for the calendar tools. It does not ask for gmail.modify, which could also relabel, archive and trash your mail, or https://mail.google.com/, the scope that can permanently delete it.
The first command prints an authorization URL. Open it in a browser on the machine running GAIA — the sign-in completes via a 127.0.0.1 callback on that box.
On a remote or headless host, open it there instead, or forward the callback port. The port is picked fresh on every run, so read it out of the printed URL’s redirect_uri=http%3A%2F%2F127.0.0.1%3A<PORT>%2Fcallback and set the forward up in a second session while the flow is still waiting — there is no way to pin it in advance, and no device-code flow for Google.
Skip the grant and the first mail tool call fails, naming what to fix — see Troubleshooting.
Power users can skip the
configure step by exporting GAIA_GOOGLE_CLIENT_ID and GAIA_GOOGLE_CLIENT_SECRET before launching GAIA — but gaia connectors configure google is the recommended path, since it stores the credentials securely and reuses them across connect/disconnect cycles.2. Set up GAIA’s local model runtime
gaia init installs GAIA’s own instance, downloads the model, and starts it. It is a six-step interactive flow that pauses at Continue? [Y/n] before the download, and refuses to run without a terminal unless you pass --yes. A Lemonade you already run yourself is separate: GAIA installs and serves its own on its own port.
3. Ask for your mail
If you use the Python CLI, install the daemon extra first. A plainpip install amd-gaia does not include the FastAPI/uvicorn/psutil runtime that
gaia email needs:
gaia email now stops before starting the
Lemonade check and prints the same actionable [api] remedy instead of the
opaque daemon process exited early error.
Alternatively, use the published npm entry point:
~/.gaia/bin/gaia-cli, which you may need to add to your PATH.
Then just ask:
- What came in today?
- What’s waiting on me?
- Find the email about the Acme invoice
- Catch me up on that thread
Mailbox selection
With more than one mailbox connected, the flagship picks one like this:- The only usable mailbox, if exactly one is.
- Gmail, when both are usable.
check_mailbox_access reports which mailbox was chosen, why, and what the alternatives were. When none is usable, the agent names each mailbox’s own state and its fix: the Connect button in the chat to connect or reconnect, or Settings › Connectors to give GAIA access.
There is no environment-variable override, by design. Provider selection is derived from connector and grant state, so what the agent can reach is always visible in gaia connectors. To make it use Outlook when both are connected, revoke the flagship’s Gmail grant:
Granting Gmail to the flagship
If your Google account is already connected for something else, the flagship reuses that connection rather than asking you to reconnect, but it does need its own entry in the grant ledger:calendar.events, list that scope too. The grant cannot ask for more than the connection carries, so on a connection that only holds gmail.readonly (one made before the flagship could write), pass just that scope: reading works, and drafting or sending asks you to reconnect Google and approve gmail.compose.
Privacy
- Local LLM only by default — email bodies are processed by your local Lemonade model. Nothing pins them there: if you configure the flagship against a cloud provider, mail content goes with it.
- Nothing is sent without your yes — an instruction planted in an email body could make the model try to send. The prompt shows the account it sends from, then the recipients, subject and body exactly as they will go out, so you can see where it is going; if the connected mailbox changes while it waits, nothing is sent, and declining or letting it time out sends nothing. There is no “always” option for mail.
- The prompt can’t be disguised — a subject or address with a line break or control character is refused before you’re asked, naming the field. So is a display name with invisible or direction-changing characters, or one that looks like an address. A reply goes to bare addresses, because a name on incoming mail is whatever the sender typed. An international domain is shown and sent in its ASCII form (
xn--bcher-kva.deforbücher.de). Text in the body keeps its characters, because Arabic and Hebrew mail needs them, and the prompt shows the ones that could hide or reorder text as[U+202E]. A Gmail draft with an HTML version shows that too. - A long email must be read to the end in the terminal — where it doesn’t fit, the terminal UI scrolls it with
↑/↓/PgUp/PgDn, andyonly works once the last line has been on screen.nandEscwork throughout. sent: "unknown"means check Sent — if the connection drops after the request went out, or the provider answers with a server error, GAIA can’t tell whether the mail left. The agent says so and doesn’t retry on its own. If you ask it to try again, the prompt warns the first try may have gone out.sent: falsemeans it definitely didn’t.- Full access doesn’t skip this — in the terminal UI and Agent UI the send still asks. Where nobody can answer, as with
gaia -p --dangerously-skip-permissionsorGAIA_AUTO_APPROVE_TOOLS, the send is refused and nothing goes out. Discarding or changing a saved draft are the mail actions full access runs unasked, since nothing leaves the mailbox. - Untrusted input — message bodies are wrapped in
<<<UNTRUSTED_EMAIL_BODY_*>>>delimiters and flagged when they show phishing signals (#4150). That is not a general injection defence: the flagship also holds web, file, and shell tools, so treat mail from untrusted senders as untrusted input.
Troubleshooting
”This Google connection lacks …”
Your connection can read but was made before GAIA asked for write access, or the write option was unticked on Google’s consent screen. Press Reconnect Google on the card in the chat (or under Settings › Connectors) and leave it ticked. Reading keeps working until you do. On Outlook the same message namesMail.ReadWrite or Mail.Send.
A send failed
The error says the mail was not sent, and GAIA does not retry it. If the connection dropped while sending, it can’t tell whether the provider received it, so check Sent before asking again. An Outlook reply that fails partway names the draft it left behind.”No readable mailbox is available”
The agent could not reach any mailbox. It names each provider’s own state, and the Agent UI shows a Connect card with the reply when signing in is the fix:- not connected → press Connect Google or Connect Microsoft on the card
- connected, but without permission to read mail → press Reconnect on the card and leave mail access ticked on the consent screen
- connected and readable, but GAIA has not been given access to it → turn GAIA’s access on for that account under Settings › Connectors (no sign-in needed)
- this PC has no sign-in client for the provider yet → the card says it needs a one-time setup; press Set up Google (or Microsoft) to open that provider in Settings › Connectors
gmail.readonly, or Mail.Read on Outlook) and nothing else; the first draft or send asks for gmail.compose (Mail.ReadWrite and Mail.Send), and the first calendar request for calendar access, each keeping what the account already allows. It never asks for gmail.modify or Google Drive. Connecting from Settings › Connectors, or with the terminal command in setup, asks for all of it at once.
In a terminal the same fixes are gaia connectors connect <provider> --grant-agent installed:gaia and gaia connectors grants grant <provider> installed:gaia --scopes <scope>.
”Gmail API returned 401”
The access token has expired or scopes were revoked. Press Reconnect Google on the card in the chat or under Settings › Connectors. In a terminal, re-rungaia connectors connect google --grant-agent installed:gaia.
Reading stopped partway through a big inbox
Expected, and it says so:read_email and get_thread return turn_budget_exhausted once a turn has filled its mail-reading budget. Narrow the request, or continue in a new turn.
”Nothing is waiting on you”, but someone is
list_waiting_on_you only counts a thread you already replied in, and only when the latest message asks you something directly. A first-contact request from someone new, or an ask phrased without a question to you, won’t appear there. Ask for a full triage of the inbox instead, which judges every message.