Connecting an LLM to Google Workspace services like Gmail and Drive goes through Google's own Workspace APIs, using OAuth 2.0 so the assistant acts on behalf of a specific signed-in user rather than through domain-wide delegation, which grants far broader access and should be reserved for narrow administrative use cases. With per-user OAuth in place, the assistant only ever sees the emails, files and calendar entries that user could already open, since Drive and Gmail's existing sharing and permission model continues to apply exactly as it does in the regular web interface. Several MCP servers, both official and community-maintained, already wrap the Gmail and Drive APIs as callable tools for searching, reading and, more cautiously, drafting or sending messages and files. For an assistant that needs to answer questions across a large volume of Drive content rather than just fetch a specific file, indexing that content into a retrieval pipeline works better than relying purely on live API search, since it supports broader semantic queries. Nanobase AI builds these Workspace integrations with per-user OAuth as the default to keep existing Google sharing permissions intact.

Scoping OAuth correctly matters more than which API you call

Gmail and Drive both expose granular OAuth scopes, and the integration's entire security posture rests on requesting the narrowest set that the use case actually needs. A read-only assistant that searches and summarizes email should request read-only scopes, not the broader scope that also allows sending or deleting, and a Drive integration that only needs to answer questions about file content should avoid requesting scopes that grant file creation or sharing changes. Requesting broad scopes because it is simpler up front creates a security liability that outlasts the convenience, since every scope granted becomes something a compromised or misused integration could exploit.

Read versus write needs its own gate

Reading email or a document to answer a question is fundamentally lower risk than sending an email or modifying a file on a user's behalf, and the two should not share the same approval path. A drafting assistant that composes a reply but requires the human user to review and hit send keeps a person in the loop for the action that actually has consequences, while search and summarization can run without that friction. Domain-wide delegation, which grants an application access across an entire organization's accounts rather than one user at a time, should be reserved for narrow administrative tools with its own dedicated review, not used as a shortcut for a general-purpose assistant. The send action, not the read action, is where this integration's real risk lives.

Live API calls versus a pre-built index

ApproachBest fitTrade-off
Live API search per querySmall Drive footprint, always-current resultsSlower for broad or fuzzy questions, limited by API search capability
Pre-built retrieval indexLarge Drive content, semantic or cross-document questionsRequires a sync pipeline and index refresh, can lag behind latest edits

An assistant that only needs to fetch a specific known file or a recent email thread works well against the live API directly. One that needs to answer questions spanning hundreds of documents benefits from indexing that content into a retrieval pipeline first, since Drive's own search API is not built for the kind of semantic query an LLM-backed assistant typically needs to answer well. Matching the retrieval approach to the actual question shape avoids building an index no one needed, or a live-search tool that can't answer what users actually ask.

Google's OAuth verification process affects your timeline

An OAuth application requesting sensitive or restricted Workspace scopes generally needs to go through Google's own app verification process before it can be used broadly, and this review can take real calendar time, particularly for scopes touching Gmail content. Planning for this verification step early, rather than discovering it after development is otherwise complete, avoids a launch delay that has nothing to do with engineering effort. Internal-only applications within a single Google Workspace organization typically face a lighter version of this process than a public-facing app.

Frequently asked questions

Is domain-wide delegation ever the right choice?

It can be, for narrow administrative tools where a single service genuinely needs to act across an organization, such as a compliance export tool. For a general-purpose assistant used by many employees, per-user OAuth is the safer default since it keeps each person's own Drive and Gmail sharing permissions in force.

Do we need to build our own connector, or can we use an existing MCP server?

Several official and community MCP servers already wrap the Gmail and Drive APIs as callable tools, which can be a reasonable starting point after the same source and permission review applied to any third-party server. A custom connector still makes sense when your scope requirements or internal security policies don't match what an existing server offers out of the box.

How do we prevent the assistant from sending an email without approval?

Structure the integration so drafting and sending are two separate steps, with the assistant only producing a draft and a human explicitly triggering the send action, either through the assistant's interface or by leaving the actual send to the user's own email client. Never grant a send-capable tool the ability to execute without that checkpoint.

How Nanobase AI helps

Nanobase AI, a Silicon Valley enterprise AI engineering company, builds Google Workspace integrations with per-user OAuth as the default, scoping requested permissions to exactly what each assistant needs and planning around Google's verification timeline from the start of a project. This work often pairs with broader SSO and OAuth data access patterns and with connecting the same assistant to Jira and Confluence for teams that need both. See how this looks in practice in a live demo.

Ready to discuss your project? Contact Nanobase AI or email hello@bumu.tech.