1. Zen IT Technologies
  2. Technical notes
  3. Whose account is the agent using?

Whose account is the agent using?

Jonny Flaks, Founder & Principal Architect

Technical note in AI Platform Governance

The pilot brief says the agent can read a team's documents and prepare email drafts. The engineer who built it clicks "Allow" with their own Google account. Before the pilot becomes a service, ask two questions. Which files can this credential read? What prevents it from sending the draft?

Choose an identity you can retire

With a user's OAuth grant, effective access depends on the user's permissions and the scopes granted to the application. A broad Drive read scope can expose years of shared material. A per-file scope can be much narrower. The identity printed in the audit trail, the resources it can reach and the scopes on its token each answer a different question.

For a recurring workload, use a dedicated identity where the product and its terms support it. A Google Cloud service account can suit a workload that can use direct resource access. A dedicated, licensed Workspace user may be appropriate when the workflow needs a mailbox and the integration supports that model. Give either a named human owner and grant only the resources the job needs. Reserve domain-wide delegation for a documented need to act for users. Scopes limit the permitted operations and data types, while the power to impersonate users remains a separate concern.

What borrowed access costs

The engineer's grant works, which is why it survives the pilot. The costs arrive later.

The agent can reach everything that person can reach. People accumulate access over years, and the agent inherits all of it on the first day, including folders shared with them long ago that they have not opened since.

The audit trail says the person did it. In an investigation, separating what the engineer did from what the agent did turns into guesswork.

The person leaves. Either the agent breaks on their last day, or offboarding gets softened to keep it running. "The accounts that own everything and belong to no one" describes where that second path leads.

The agent also reads content other people wrote, and some of it may contain instructions aimed at the agent. Whatever that content persuades it to do, it does with the full access of the person it is borrowing from. "Where data actually leaves through an AI platform" covers that route.

Setting up the dedicated identity

Give it a name that describes its function and an owner by name. If it is a Workspace user, put it in its own organizational unit, so services can be switched on or off for the agent alone and external sharing can be stricter for it than for people.

Grant access the way you would for a contractor. Share the specific folders, shared drives and calendars the job needs with the agent's account, and keep it out of broad groups that carry access nobody has reviewed. Protect its credentials as a service secret. Nobody should be signing in to it interactively.

Then watch it. An agent behaves more regularly than a person, which makes anomalies easier to see: a new external share, a large download, a folder outside its usual set. Domain-wide delegation stays the exception. Google's own guidance is to avoid it where direct service account access or user consent will do, and where multi-party approval is enabled, authorizing it needs a second super administrator.

Where its credentials live

A dedicated identity is only as contained as its credentials. Find out where the agent platform stores the token or key, who can read that store, and how it is rotated. A refresh token sitting in a shared configuration file is a password with a long life. Revoking it should be a step someone can take in minutes, and the check at the end of this note is how you find out whether it is.

Where "drafts only" is enforced

Gmail's gmail.compose scope permits creating drafts and sending mail. A connector can still offer a draft-only tool. For that promise to hold, the connector must protect the credential, enforce the action restriction and be the only route the agent has to Gmail. A written instruction asking the agent to stop after drafting leaves the decision with the agent.

Draft-only design through a controlled connector
ActionGmail compose scopeConnector exposesAgent can act
Create draft PermitsYesYes
Send message PermitsNoNo
The send capability remains in the underlying credential. The connector must enforce the narrower policy on every path available to the agent.

The check worth running

In a controlled pilot, give the agent one test folder, leave another outside its access and use a test mailbox. Confirm it can read the first folder, cannot read the second and can create a draft. Verify that its available tools prevent sending to a test recipient. Finally, revoke its access and repeat. You now know whose permission the job depends on and how to stop it.

Product note. Product features change frequently, so always check current features and documentation before acting on this note. It is a starting point rather than a configuration reference.

Explore this expertise: AI Platform Governance

All technical notes