Docs/Lanes Link/Providers/Gmail (IMAP)

Gmail (IMAP)

Connect Gmail (IMAP) to your agents with Lanes Link. The same mailbox over IMAP and SMTP, with an app password that does not expire.

Read, search, and send mail in a personal Gmail mailbox over IMAP and SMTP, with an app password that does not expire.

Connect it

console
$ lanes link connect gmail_imap --profile personal --workspace local

This takes an app password rather than a browser sign-in.

Because it needs no browser, an agent with a shell can do the whole setup:

console
$ printf %s "$TOKEN" | lanes link secrets set gmail_imap/main --profile personal
$ lanes link connect gmail_imap --id main --non-interactive --json --profile personal

Credentials go in on stdin, never as a flag: an argument lands in your shell history, in ps output, and in any transcript.

What your agent can do

IMAP and SMTP give a fixed set of capabilities, the same on every mailbox:

  • gmail_imap.list_mailboxes
  • gmail_imap.search_messages
  • gmail_imap.get_message
  • gmail_imap.get_attachment
  • gmail_imap.mark_messages
  • gmail_imap.move_messages
  • gmail_imap.send_message

What is recorded

Every call is recorded, allowed or refused. The rule is to keep the shape and withhold the words: an audit log that reproduced the content would be a second copy of the thing it was meant to make accountable.

Identifiers such as mailbox, limit, unseen, flagged, uid, and message_id are kept. Everything that carries your words is withheld.

gmail_imap.send_message records nothing but the receipt.

What an entry holds and how to read one is on the audit log.

Narrowing what it may do

Connecting grants the read bundle. Tightening it happens on your machine and takes effect at once:

console
$ lanes link policy deny 'gmail_imap.*' --connection gmail_imap.main --profile personal --workspace local

A deny always beats an allow, whatever the order in the file. See Scopes and permissions for widening, and for what can and cannot be set per connection.


Next: every provider, or Connections for what a connection is and the methods behind one.