| [ Web Proxy ] |
| Viewing: https://adk.dev/integrations/../../../agents/../../tutorials/../../get-started/google-cloud/ | [Back] [Original] |
[logo]
This guide explains how to connect and authenticate your ADK agents with Google Cloud Platform (GCP) services, models running on Google Cloud Agent Platform, and Agent Platform services.
Before attempting to connect an agent with Google Cloud or Agent Platform services, make sure you have completed the following prerequisites:
aiplatform.googleapis.com) enabled.You have a few options for authentication when connecting your ADK agent to Google Cloud, as described in the table below.
| Method | Best Used For | Authentication Mechanism | Environment |
|---|---|---|---|
| User Credentials | Local development and testing | Application Default Credentials via gcloud |
Local workstation |
| Service Account | Production deployment and CI/CD | Google IAM Service Account Key / Workload Identity | Google Cloud (Agent Runtime, Cloud Run, GKE) or external servers |
| Express Mode | Rapid prototyping and testing | API Key | Local or cloud environments |
| Agent Identity | Production deployment and CI/CD | Google IAM Service Account Key / Workload Identity | Google Cloud (Agent Runtime, Cloud Run, GKE) |
Warning: Protect your credentials
User credentials, service account credentials, and API keys are highly sensitive. Never commit credential files or keys directly to your codebase. Whenever possible use secure secret managers such as Google Cloud Agent Identity, Google Cloud Secret Manager or other similar products.
Connect to Google Cloud with user credentials authentication method working with local development environments.
Set your environment variables to enable Agent Platform and specify your project details:
GOOGLE_GENAI_USE_ENTERPRISE was previously GOOGLE_GENAI_USE_VERTEXAI
These variable names are equivalent and do the same thing.
If you set GOOGLE_GENAI_USE_ENTERPRISE and your agent
does not connect to Agent Platform, you're on an older ADK version. Use
GOOGLE_GENAI_USE_VERTEXAI instead, or update to a newer version of ADK.
When deploying to secure hosted environments, use a service account for connection authentication:
Agent Platform User role..json) and configure the GOOGLE_APPLICATION_CREDENTIALS
environment variable:
Workload Identity option
Instead of the key file, you can also authenticate the service account using Workload Identity.
Express Mode offers a simplified, API-key-based setup for prototyping without full gcloud authentication.
Set the following environment variables:
Google Cloud Agent Platform hosts a wide array of AI models you can connect to your ADK agents, including Gemini models, third-party AI models, open weight models, and models custom-tuned for your organization. Once you have connected your ADK agent to Google Cloud and Agent Platform, you have access to AI models to fit your application requirements. Check out these resources to explore and find the model that's right for your project:
Many Google Cloud services provide ADK integrations with authentication helpers for accessing GCP APIs or resources with an ADK agent. For more information, see the following pages:
| Web Proxy Viewer | New URL | Original Page |