
The Agent Identity auth manager holds auth providers that let agents call external services without handling credentials directly. It stores client secrets in a Google-managed vault, ADK retrieves the credential and attaches the authorization header to the tool call, and IAM controls which agents may use each auth provider through each agent's SPIFFE-based identity. For the Professional Agentic Architect exam, the central distinction within the auth manager is between 2-legged OAuth and 3-legged OAuth, which differ in whose authority the agent uses when calling a downstream service.
A 2-legged OAuth auth provider is designed for machine-to-machine calls made on the company's own authority to external services that support OAuth 2.0 client credentials. Google recommends 2-legged OAuth for machine-to-machine authentication with external services that support OAuth. The auth manager handles the client credentials and tokens automatically, and ADK attaches the authorization header at runtime, so no secret appears in the agent's source code, container images, or deployment configuration.
With 2-legged OAuth, the downstream service sees only the agent itself. The call authenticates with client credentials, carries no individual user identity, and does not prompt end users for consent. Because IAM governs access to auth providers through each agent's SPIFFE-based identity, administrators can restrict a given auth provider so that only authorized agents can use its credential.
A 3-legged OAuth auth provider handles user-delegated authority, where an agent acts on behalf of an individual user rather than on behalf of the company. Typical targets include a user's Jira issues, Gmail, Google Calendar, or Google Drive files. The auth manager manages each user's OAuth consent and stores both the client secret and each user's tokens. Each outbound request reaches the downstream service with that user's token, allowing the downstream service to apply that user's own permissions.
Using a single shared service account in the downstream service does not satisfy user-delegated access. A shared service account makes every action appear as the agent itself, so the downstream service cannot enforce per-user permissions.
When Agent Identity is used with Agent Gateway and Gemini Enterprise, end-user credentials are encrypted by the auth manager and decrypted at Agent Gateway. In this setup, the agent code never sees a raw user credential, and end-user access events remain attributable to the agent's SPIFFE ID.
When an agent accesses a user's Workspace data such as Gmail, Google Calendar, Google Drive, or Docs, access is granted through OAuth consent rather than Google Cloud IAM. Applying least privilege means requesting only the OAuth scopes required for the agent's task. If an agent only reads data and never edits or shares documents, sends mail, or changes calendar events, it should request read-only scopes rather than full scopes.
On the Professional Agentic Architect exam, OAuth consent scopes are often contrasted with broader or unrelated permission models:
Different ways of managing OAuth secrets and tokens carry distinct operational and security tradeoffs:
Our Professional Agentic Architect practice exams test Agent Identity auth manager OAuth flows alongside least-privilege OAuth scopes and Secret Manager tradeoffs, with detailed explanations that drill these distinctions.