Scoping Google Workspace Domain-Wide Delegation for a Drive MCP Server at a Health System
Treat domain-wide delegation as a coarse, admin-level grant. Authorize the narrowest Drive scope that supports the task, prefer per-user OAuth consent where delegation is not needed, keep a separate service account for each workload, and enforce an allowlist of impersonation targets. Then add a runtime layer that applies policy to each Drive tool call and records the decision, because the delegation grant cannot constrain what an agent does with its access.
What domain-wide delegation grants, and where it stops
Domain-wide delegation lets a service account impersonate any user in the Workspace domain, within the OAuth scopes a Workspace administrator has authorized for that service account's client. A Drive MCP server that holds such a credential can act as a clinician, a billing analyst or an executive assistant, depending on which identity it names when it requests a token.
That is a powerful property in a health system. Shared drives and personal folders can contain PHI that nobody has labeled, and an AI agent calling the server's tools will reach whatever the impersonated identity can reach. The grant is configured in the admin console. It has no concept of an individual tool call, a specific file, or a task. It answers only two questions: which scopes, and which service account.
This guide therefore separates two layers. The Google-side boundary covers scopes, service account design, impersonation targets and key handling. The runtime boundary covers policy applied to each MCP tool call. Neither substitutes for the other.
Choose the narrowest scope, and decide whether delegation is warranted
Start from the task, not the tool catalog. Drive scopes fall into three practical tiers: read-only access to Drive content, file-level access limited to files the application created or the user opened with it, and full Drive access that includes modification and deletion. Most retrieval and summarization workloads need only the read-only tier. Full Drive scope should require a written justification tied to a specific write operation.
Then ask whether delegation is needed at all. Per-user OAuth consent ties the token to one person who approved it, so the agent can reach only what that person can reach, and the consent is attributable to a user action. Delegation is more defensible for back-office jobs that run without a user present, such as scheduled processing of a defined intake folder. For interactive assistants acting on behalf of a signed-in clinician or staff member, per-user consent usually keeps the access boundary closer to the person making the request.
A useful rule: if a human is in the loop and the work is theirs, use per-user consent. If the job is unattended and the data set is defined, use delegation with a narrow scope and a short list of subjects.
Restrict impersonation and separate service accounts by workload
The admin console grant is domain-wide by design, so the limit on whom the server may impersonate has to be enforced around the grant. Build that control deliberately and assign an owner to it.
- Define a subject allowlist: List the specific identities each workload may impersonate, ideally dedicated mailbox or system accounts rather than named staff. Reject any request for a subject not on the list.
- Use dedicated data-owner accounts: Place the files a workload needs under an account or shared location created for that purpose, so impersonating it exposes only that data set.
- One service account per workload: Do not share a service account between, for example, a clinical documentation assistant and a finance reconciliation job. Each gets its own client ID and its own scope authorization.
- Require change approval: Changes to scopes, subjects or service accounts go through a recorded approval by security, not only by the Workspace administrator.
- Review on a schedule: Compare authorized scopes in the admin console with the scopes each server actually requests, and remove the difference.
- Plan for revocation: Document how to remove a client's authorization and disable its service account quickly, and test that procedure.
Key handling and client-side credential exposure
A service account key is a bearer secret that can mint tokens for every allowed subject. Keep it in a managed secret store, never in a repository or container image, rotate it on a schedule, and prefer keyless credential mechanisms where your platform supports them. Restrict who can read it as tightly as you restrict the admin console grant.
Credential handling in MCP clients deserves separate attention. An NVD record for the MCP TypeScript SDK describes a flaw in OAuth client support, in versions starting at 1.12.0 and before 1.31.0 and 2.2.0. A connected MCP server could choose which authorization server received the client's credentials, and stored credentials were not bound to the authorization server they belonged to. A malicious or compromised server could cause a client to send a stored refresh token and client secret to a server of its choosing, without user interaction. The impact applies to applications using the SDK as an HTTP client with an authProvider that connects to a server the owner does not fully trust.
This concerns client-side handling, not service-account delegation, but the design lesson carries over. Inventory which MCP servers each OAuth-enabled client connects to, connect only to servers you trust, check SDK versions against the affected ranges, and avoid leaving long-lived secrets in clients that can reach untrusted servers.
Enforce policy on each Drive tool call
Once scopes and subjects are narrowed, the remaining gap is what the agent does inside the boundary. A read-only scope still permits reading every file the impersonated identity can see, including a folder of referral letters that the task never required. Delegation cannot distinguish between those requests. A runtime layer can.
Place policy enforcement in the execution path between the agent and the Drive MCP server, so that each tool call is evaluated before it runs. Four outcomes are useful. Allow calls that match the task, such as a read within an approved folder. Redact PHI identifiers from content before it reaches the model when the task does not need them. Block calls that fall outside policy, such as a search across the whole domain or a request for an impersonation subject not on the allowlist. Escalate for human approval when a call is legitimate but sensitive, such as opening a file in a restricted location.
Each decision should produce a record that supports HIPAA 164.312(b) audit controls: the tool and arguments, the file or folder reached, the impersonated identity, the policy that applied, the decision and its timestamp, and the approver where a human was involved. Reviewing that record should answer which files a call touched and why it was permitted. A reconstruction from Google-side activity records alone can show access, but not the policy decision that governed it.
Where Trussed fits
Trussed enforces policy in the execution path on MCP server tool calls, including Drive tool calls, with allow, redact, block, rate limit and escalate-for-approval outcomes. Enforcement is at runtime, not reviewed after the fact, and it generates audit-ready evidence mapped to HIPAA, among other frameworks. It can be deployed self-managed in the customer's cloud, with configurable retention and data residency. Trussed runs in production with healthcare organizations.
It does not replace the Google-side work described above. Scope selection, impersonation allowlists, per-workload service accounts and key handling remain your configuration. Trussed adds the per-call policy decision and the evidence that the boundary held.
Two control layers for a Drive MCP server
Google-side boundary
OAuth scopes, service account design, impersonation targets, key handling.
Runtime boundary
Policy decision on each tool call: allow, redact, block, escalate.
Evidence
Per-call record of file, identity and decision for HIPAA 164.312(b) review.
See how per-call enforcement and evidence work for Drive MCP servers
Walk through policy on Drive tool calls and the audit-ready evidence it produces for HIPAA review.
Explore Agent and Tool-Call EnforcementHow does your AI governance program compare?
See where your program has gaps in less than 2 minutes.