Gemini Enterprise Agent Platform features like Agent Identity and Agent Registry provide built-in capabilities for building, deploying, and managing AI agents, Model Context Protocol (MCP) servers, and tools. By enabling these features for your Cloud Run resources, you can take advantage of system-managed identities and automatic registration to simplify discovery and security for your agentic workloads.
This guide covers how to:
- Establish required IAM roles
- Understand functional and identity types
- Configure features for services and jobs
- View assigned identities
- View registered agents and tools in Agent Registry
Cloud Run supports the following Agent Platform features:
- Agent Identity: assigns a unique, cryptographically verifiable identity to your workload, enabling secure connections to other agents, tools, and Google Cloud APIs.
- Agent Registry: automatically registers your agents and tools to make them discoverable by other developers and agents in your organization.
Before you begin
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Install the Google Cloud CLI.
-
Configure the gcloud CLI to use your federated identity.
For more information, see Sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init Enable the Cloud Run Admin API, Identity and Access Management API, Agent Registry API, and App Hub API APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.- Ensure that you have set up Agent Registry in your project or organization.
- Install and initialize the gcloud CLI.
-
Update components:
gcloud components update
- Review the Cloud Run pricing page for CPU, memory, and network egress. The entire size of the provisioned disk and the lifetime of the instance that is using it contribute to your cost.
Required roles
To get the permissions that you need to configure Agent Platform features, ask your administrator to grant you the following IAM roles on your project:
-
To deploy and manage Cloud Run resources:
Cloud Run Admin (
roles/run.admin) -
To manage App Hub resources, one of the following:
- App Hub Admin (
roles/apphub.admin) - Agent Registry API Admin (
roles/apiregistry.admin)
- App Hub Admin (
-
To deploy with a specific identity, one of the following:
- IAM Service Account User (
roles/iam.serviceAccountUser) - IAM Service Account Admin (
roles/iam.serviceAccountAdmin)
- IAM Service Account User (
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Use cases
Use Agent Platform features with Cloud Run in the following scenarios:
- Authenticate your agent to other agents, tools, and Google Cloud APIs using a unique, system-managed identity tied to its lifecycle.
- Enable automatic discovery of agents and MCP servers within your organization's Agent Registry.
- Use Identity-Aware Proxy as an authentication policy to secure MCP servers.
Understand functional and identity types
You configure Agent Platform features by setting functional and identity properties on your Cloud Run resources.
These two properties control how to register and identify a workload:
- Functional type: declares the primary purpose of the workload.
Once set, this property cannot be changed or unset. You assign your workload
one of the following functional types:
agent: designates the workload as an AI agent. Workloads of this type must use theagent-identitytype.mcp-server: designates the workload as a user-managed MCP server. This type can use any supported identity type.
- Identity type: specifies the kind of identity assigned to the workload.
Once set, this property cannot be changed or unset. You assign your workload
one of the following identity types:
agent-identity: assigns a system-managed agent identity designed for agents. When you deploy withagent-identity, Agent Platform enables identity certificates by default. To opt out, update your service with the--no-identity-certificateflag or set therun.googleapis.com/identity-certificate-enabled: "false"annotation. Follow the guide to authenticate to tools and resources for agents acting on their own authority or on behalf of end users. To understand the core concepts and security benefits of system-managed agent identities, learn more about Agent Identity.service-account: uses a standard Google Cloud service account.
Configuration behavior
The behavior of functional and identity properties depends on the combination you choose:
| Functional type | Identity type | Resulting behavior |
|---|---|---|
agent |
agent-identity |
Workload is registered as an agent in the Agent Registry and assigned a system-managed agent identity. |
agent |
Other or unspecified | Error. Workloads with functional-type=agent must use identity-type=agent-identity. |
mcp-server |
agent-identity, service-account, or unspecified |
Workload is registered as an MCP server (/mcpServers) in the Agent Registry. If unspecified, defaults to a service account identity. |
| Unspecified | service-account |
Workload runs as a standard Cloud Run service or job. |
Configure features on services and jobs
You configure Agent Platform features on your Cloud Run services and jobs using the Google Cloud CLI.
Services
To deploy an agent, specify
--functional-type=agentand--identity-type=agent-identity:gcloud beta run deploy
SERVICE_NAME\ --image=IMAGE_URL\ --functional-type=agent \ --identity-type=agent-identityReplace the following:
SERVICE_NAME: the name of your Cloud Run service.IMAGE_URL: a reference to the container image, for example,us-docker.pkg.dev/cloudrun/container/hello:latest. If you use Artifact Registry, the repository REPO_NAME must already be created. The URL follows the format ofLOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/PATH:TAG
To update an existing service to use Agent Identity:
gcloud beta run services update
SERVICE_NAME\ --functional-type=agent \ --identity-type=agent-identity \ --no-trafficReplace the following:
SERVICE_NAME: the name of your Cloud Run service.ORGANIZATION_ID: your Google Cloud organization ID.PROJECT_NUMBER: your Google Cloud project number.REGION: the region where your service is deployed.
To deploy a user-managed MCP server, specify
--functional-type=mcp-server. You can optionally specify an identity type using--identity-type:gcloud beta run deploy
SERVICE_NAME\ --image=IMAGE_URL\ --functional-type=mcp-server \ --identity-type=IDENTITY_TYPEReplace the following:
SERVICE_NAME: the name of your Cloud Run service.IMAGE_URL: a reference to the container image, for example,us-docker.pkg.dev/cloudrun/container/hello:latest. If you use Artifact Registry, the repository REPO_NAME must already be created. The URL follows the format ofLOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/PATH:TAGIDENTITY_TYPE: Optional. The type of identity assigned to the workload. Specifyagent-identityorservice-account. Defaults toservice-account.
Jobs
To create an agent job, specify
--functional-type=agentand--identity-type=agent-identity:gcloud beta run jobs create
JOB_NAME\ --image=IMAGE_URL\ --functional-type=agent \ --identity-type=agent-identityReplace the following:
JOB_NAME: the name of your Cloud Run job.IMAGE_URL: a reference to the container image.
View assigned identities
You can view the assigned agent identity from the Google Cloud console or gcloud CLI.
Services
Console
In the Google Cloud console, go to Cloud Run:
Select Services from the Cloud Run navigation menu, and click your service.
Click the Revisions tab and select a revision.
Click the Security tab.
The Identity field displays the assigned agent identity.
gcloud
To view the agent identity, describe the revision of your service:
gcloud beta run revisions describe REVISION_NAMEReplace REVISION_NAME with the name of your
service revision.
The assigned agent identity is displayed in the output.
Jobs
Console
In the Google Cloud console, go to Cloud Run:
Select Jobs from the Cloud Run navigation menu, and click your job.
Click the Executions tab and select an execution.
View the execution details.
The Identity field displays the assigned agent identity.
gcloud
To view the agent identity for a job execution, describe the execution:
gcloud beta run jobs executions describe EXECUTION_NAMEReplace EXECUTION_NAME with the name of your
job execution.
The assigned agent identity is displayed in the output.
View an agent or MCP in Agent Registry
When you deploy a Cloud Run resource with
--functional-type=agent or --functional-type=mcp-server, it's
automatically registered
in your organization's Agent Registry.
- Agents are registered
under the agent catalog (
/agents). - MCP servers are
registered under the MCP server catalog (
/mcpServers).
To view your registered agents and tools in the registry, and to learn how to securely store and discover your agents and tools, explore Agent Registry.
What's next
- Learn how to authenticate your agents to APIs and tools.
- Learn how to authenticate MCP servers for secure connections.
- Learn how to host MCP servers on Cloud Run.
- Use the Agent Development Kit to build and register custom agents in the registry.
- To build and deploy agents that conform to the A2A specification, see Deploy A2A agents to Cloud Run.
- See the troubleshooting guide if you encounter issues with agent registration or identity assignment.