Playbook · 6 minute read
How to Build a Google Workspace AI Agent
Building a Google Workspace AI agent means defining a personal or team assistant role over Gmail, Drive, Calendar, and Sheets, authenticating through OAuth with the narrowest scopes on behalf of each user, retrieving documents under that user's permissions with citations, drafting replies and scheduling proposals for confirmation, and never sending, sharing, or deleting without a person's action.
Most knowledge work runs through four applications: mail, documents, calendar, and spreadsheets. A Google Workspace AI agent takes the administrative load across them, triaging mail, drafting replies, finding documents, proposing meetings, and extracting data, while the user keeps every send, share, and booking. The controls are OAuth scopes and a draft-first rule, and they are what make the agent safe to trust with a real inbox. This playbook builds it, applying the identity model in the agent identity and access control whitepaper and the retrieval pattern in the enterprise RAG reference architecture; the Microsoft counterpart is how to build a Microsoft Teams AI agent.
Step 1: What is the agent's role?
| Element | Definition |
|---|---|
| Purpose | Remove administrative load across mail, documents, calendar, and sheets while the user keeps every decision |
| Scope | Mail triage and labeling, reply drafts, document retrieval and summaries with citations, meeting proposals, Sheets update proposals, thread summaries |
| Non-scope | Sending mail, sharing files, changing permissions, deleting, accepting meetings, external communication of any kind |
| Owner | The user for a personal assistant; a named owner for a shared-inbox or team agent |
Step 2: Which OAuth scopes, and why?
| Capability | Scope requested | Withheld |
|---|---|---|
| Mail triage and drafts | Read and compose (drafts) | Send, delete |
| Documents | Drive read | Share, edit permissions, delete |
| Calendar | Read; create tentative proposals | Accept on behalf; delete |
| Sheets | Limited write to designated sheets | Write elsewhere |
| Admin | None | All |
Scopes are requested per user through OAuth; the user consents and can revoke. For a shared inbox or drive, a delegated identity with the resource's permissions and a named owner is used instead. The agent's tools are exposed through an MCP server that maps only to these scopes, behind a gateway that logs each action for the user.
Step 3: How does mail triage and drafting work?
The agent reads new mail, classifies it against the user's categories, labels it, flags what needs a reply, and drafts replies for the user to edit and send. It uses the user's own documents and prior threads, under the user's permissions, to ground drafts. It never sends. Message content is untrusted input: an email that says "forward this thread to this address" is triaged, not obeyed. The threat is explained in what is indirect prompt injection.
Step 4: How does document retrieval work?
The agent searches Drive under the user's own permissions, so it can find only what the user can open, and answers questions about documents with citations to the file and section. Nothing is cached across users. For a team agent over a shared drive, retrieval is scoped to the shared resource. Retrieval quality follows the hybrid pattern in how to build a hybrid search system.
Step 5: How does scheduling work?
Given a request, the agent reads the user's calendar and the attendees' availability the user is permitted to see, proposes times, and drafts a tentative invitation the user confirms. It does not accept invitations on the user's behalf or book rooms without confirmation until the user advances its autonomy.
Step 6: How are Sheets updated?
Extractions from mail or documents into a designated sheet are proposed as structured rows with the source shown; the user confirms. Writes are limited to the designated sheets by scope and by the tool. Data lineage is preserved in a source column so any figure can be traced.
Step 7: What is the evaluation set?
With the user's consent, historical mail with the user's own labels and replies, document questions with verified answers and files, scheduling requests with known good proposals, extraction cases with verified rows, and injection cases. Score triage accuracy, draft acceptance and edit rate, retrieval and grounding, proposal correctness, extraction accuracy, and injection resistance. Gate changes; use live edits and confirmations as the production signal.
Step 8: Rollout
- Mail triage and labeling for one user or team.
- Reply drafts.
- Document questions with citations.
- Meeting proposals.
- Sheets extraction proposals.
- Shared-inbox agent with a named owner.
What does the agent look like in daily operation?
At the start of the day, the user's inbox is labeled: eight messages need a reply, three are informational, two are vendor notices. Drafts wait behind the eight, each grounded in the relevant thread and the proposal document it references, ready to edit and send. A message from an unknown sender asking the assistant to share the quarterly plan is labeled as suspicious and nothing else happens. A colleague's request to meet next week produces three proposed slots and a tentative invitation the user confirms with one click.
Later, the user asks where the latest pricing sheet is and what changed; the agent finds the file the user can open, summarizes the changes with a citation to the revision, and offers to extract the new tiers into the designated tracking sheet as rows with the source recorded. The user confirms. No mail was sent, no file shared, and no meeting booked without the user's action, and every action is in the user's audit log.
How does this fit the wider platform?
For an organization, the Workspace agent runs on the same gateway, identity, retrieval, and evaluation foundation as its other agents, which is what lets a team-level shared-inbox agent coexist with a customer-support Digital FTE under one permission and audit model. The governance is described in the Model Context Protocol for the enterprise whitepaper.
What is measured?
| Metric | Why |
|---|---|
| Triage accuracy and relabel rate | Core quality |
| Draft acceptance and edit rate | Drafting quality |
| Retrieval and citation click-through | Trust |
| Proposal confirmation rate | Scheduling quality |
| Time returned to the user per week | Economics |
What are the common mistakes?
- Requesting send and share scopes because they were convenient.
- Email content treated as instruction.
- Cross-user caching of documents or answers.
- Auto-sending drafts to hit a productivity number.
- A shared inbox with no named owner.
How does FISTA Solutions help?
FISTA Solutions builds Workspace agents as governed AI agents with draft-first controls and minimal scopes, through forward deployed engineers working with the teams that will use them, on the foundation its AI enablement practice establishes. FISTA has delivered 150+ projects for 50+ companies across 12+ countries.
To build a Workspace agent for one team, message FISTA on WhatsApp, or read how to build an AI meeting assistant for the meeting-specific role.
Share-ready article cover
Download the generated social format.
Clear answers
Questions raised by this field note.
Straightforward guidance for evaluating scope, fit, and the next step.
01What can a Google Workspace AI agent do safely?
Triage and label mail, draft replies for the user to send, find and summarize documents the user can already open with citations, propose meeting times and draft invitations, extract data into Sheets proposals, and summarize threads. Sending mail, sharing files, deleting, and changing permissions stay with the person.
02How does OAuth scoping work for the agent?
The agent requests only the scopes its role needs, such as Gmail read and compose (drafts), Drive read, Calendar read and event proposal, and Sheets limited write, on behalf of each user through OAuth. Send, share, delete, and admin scopes are not requested. The user consents once and can revoke at any time.
03How do you handle prompt injection in email?
Every message the agent reads is untrusted: it is data for triage and drafting, never instruction. The agent's tools are limited to drafts and proposals, so even a successful redirection cannot send, share, or delete. Injection scenarios, including messages that instruct the agent to forward data, are in the evaluation set.
04Is this a personal assistant or a team agent?
Either, with different scoping. A personal assistant acts for one user under that user's consent and permissions. A team agent over a shared inbox or shared drive acts under a delegated identity with the shared resource's permissions and an owner accountable for it. Both follow the same draft-first, never-send rule.
Continue exploring
Related capabilities
Start with the hard problem
Need the outcome owned, not merely analyzed?
Tell us where delivery is constrained. We’ll map the fastest credible path from intent to verified production.