Docs/Lanes Link/Providers/Gmail

Gmail

Connect Gmail to your agents with Lanes Link. Read, search, send, draft, and organise mail.

Read, search, send, draft, and organise mail, including labels, read-state, spam, and trash, via the Gmail REST API.

Connect it

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

A browser opens and you approve. The OAuth client is operated by Lanes, so no client secret of theirs is stored on your machine. Pass --own-client to use an application you registered yourself instead, which the Google guide walks through.

What your agent can do

Capabilities are generated from an OpenAPI document vendored into Lanes Link, so the surface is reviewable in a diff and a change upstream cannot widen what your agents can reach without a commit here.

The scopes it asks for

Each provider asks for the narrowest set that makes its capabilities work, because a scope on a consent screen that no tool can spend is a grant asked for and never noticed.

ScopeWhat it allows
https://www.googleapis.com/auth/gmail.readonlyread mail and settings
https://www.googleapis.com/auth/gmail.composecreate and send drafts
https://www.googleapis.com/auth/gmail.modifyread, send, and modify any message; no permanent delete (broad)
https://www.googleapis.com/auth/gmail.settings.basiccreate and delete filters, and change your send-as identities; a filter is a standing rule that keeps acting after the session ends (broad)

A scope marked broad reaches further than the rest, so connect stops and asks for an explicit yes before requesting it.

Not asked for:

  • mail.google.com. The only scope that permanently deletes. Nothing here offers permanent deletion, so trash and untrash are the whole of it.

How to narrow or widen any of this is on Scopes and permissions.

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 userId, id, addLabelIds, removeLabelIds, ids, and pathId are kept. Everything that carries your words is withheld.

gmail.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.*' --connection gmail.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.