Agent Registry can register agents hosted on supported
Google Cloud runtimes without requiring you to manually call the
Agent Registry API. Depending on the runtime, this registration process happens
automatically or requires an opt-in configuration step during deployment.

This document explains how to enable discovery for agents on supported
runtimes. If you host an agent externally or on an unsupported runtime,
see [Use manual registration](https://docs.cloud.google.com/agent-registry/manual-registration).

The metadata and [A2A skills](https://docs.cloud.google.com/agent-registry/concepts#a2a-skill) extracted from
an agent during its registration depend on the agent's protocol. For more
information, see [Register agents](https://docs.cloud.google.com/agent-registry/register-agents).

## Before you begin

Before you register agents, [set up Agent Registry](https://docs.cloud.google.com/agent-registry/setup).
You need [your project ID](https://support.google.com/googleapi/answer/7014113)
to verify registration.

To use the Google Cloud CLI commands in this document, make sure you have
[set up your gcloud CLI environment](https://docs.cloud.google.com/agent-registry/setup#set-up-cli).

## Register agents from Agent Runtime

If you develop and deploy agents with
[Agent Runtime on Gemini Enterprise Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/runtime),
registration in Agent Registry is automatic.

The [Agent2Agent (A2A) protocol](https://a2a-protocol.org/latest/) is an open
standard that lets agents declare their capabilities and identity. The following
example shows how to deploy an
[agent implementing the A2A protocol](https://docs.cloud.google.com/agent-registry/register-agents#automatic-registration)
to Agent Runtime. For more information, see
[Deploy an agent](https://docs.cloud.google.com/gemini-enterprise-agent-platform/scale/runtime/deploy-an-agent).

    # Create and deploy the agent
    # This action automatically registers the agent in Agent Registry
    remote_agent = client.agent_engines.create(
        agent=my_a2a_agent, # Your defined A2A object
        config={
            "display_name": "my-support-agent",
            "description": "An agent that handles support tickets.",
            "requirements": ["google-cloud-aiplatform[agent_engines,langchain]"],
        },
    )

As you update or delete your agent in
Agent Runtime, Agent Registry automatically
synchronizes those changes.

## Register built-in Google agents

Built-in Google agents, such as
[Google Workspace](https://developers.google.com/workspace/guides/get-started)
and [Gemini Enterprise](https://docs.cloud.google.com/gemini/enterprise/docs) agents, are
automatically registered in Agent Registry. You don't need to perform any
configuration or deployment steps. These agents are ingested and
available for [discovery](https://docs.cloud.google.com/agent-registry/concepts#discovery) within your
registry.

## Register agents from GKE

You can register agents deployed on
[Google Kubernetes Engine (GKE)](https://docs.cloud.google.com/kubernetes-engine/docs/tutorials/agentic-adk-vertex)
by adding the `registry.gke.io/functional-type: "AGENT"` label to your
deployments. This label identifies the deployment as an AI agent, letting
Agent Registry perform an introspection scan.

> [!NOTE]
> **Note:** GKE also supports the `apphub.cloud.google.com/functional-type: "AGENT"` annotation for backward compatibility. However, we recommend using the `registry.gke.io/functional-type: "AGENT"` label for your GKE deployments.

To enable automated discovery of the agent's skills, you must also provide the
`a2a-protocol.org/agent-card` annotation. The ingestion controller uses this
annotation to query the A2A Agent Card.

The following example shows a GKE agent deployment manifest
using these configurations. For more information, see
[Deploy and orchestrate AI agents](https://docs.cloud.google.com/kubernetes-engine/docs/tutorials/agentic-adk-vertex).

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: my-agent
      labels:
        # GKE takes this label and registers the agent to Agent Registry
        registry.gke.io/functional-type: "AGENT"
      annotations:
        # A2A protocol metadata annotation for automated Agent Card discovery
        a2a-protocol.org/agent-card: |
          card:
            endpoint: /.well-known/agent-card.json
            protocol: HTTP
            port: 8080
    spec:
      selector:
        matchLabels:
          app: my-agent
      template:
        metadata:
          labels:
            app: my-agent
        spec:
          containers:
          - name: server
            image: gcr.io/my-project/my-agent:1.0.0
            ports:
            - containerPort: 8080
            env:
            - name: PORT
              value: "8080"
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: my-agent-service
      labels:
        app: my-agent
    spec:
      type: ClusterIP
      ports:
      - port: 8080
        targetPort: 8080
        protocol: TCP
        name: http
      selector:
        app: my-agent

When the deployment is applied, the GKE cluster automatically attempts to
fetch metadata from the agent and syncs it directly into the Agent Registry
data model.

## Verify registration

You can verify that Agent Registry successfully registered your agents by
listing them:

### Console

1. In the Google Cloud console, go to **Agent Registry**:


   [Go to Agent Registry](https://console.cloud.google.com/agent-platform/agent-registry)

   <br />

2. From the project picker, select the Google Cloud project where you
   [set up Agent Registry](https://docs.cloud.google.com/agent-registry/setup).

3. Select the **Agents** tab.

   The page displays a list of all registered agents and their details, such
   as name, [identifier](https://docs.cloud.google.com/agent-registry/concepts#agent-identifier),
   description, runtime, and location.
4. Filter the list by the agent's location or its runtime resource:

   - To filter by location, click the **Location** menu, select the locations you want to filter, and click **Apply**.
   - To filter by runtime, click the **Runtime** menu, select the runtimes you want to filter, and click **Apply**.

   The page displays a filtered list of the registered agents for your
   selected conditions.

### gcloud

You can filter the list by the agent's metadata. Make sure you have
[set up your Google Cloud CLI environment](https://docs.cloud.google.com/agent-registry/setup#set-up-cli)
for Agent Registry, and then run:

    gcloud agent-registry agents list \
      --project=PROJECT_ID \
      --location=REGION \
      --filter="FILTER_EXPRESSION"

Replace the following:

- `PROJECT_ID`: The project ID.
- `REGION`: The registry region.
- `FILTER_EXPRESSION`: The filter expression for the agents that you want to filter. For example, to filter by display name, you can use `displayName='DISPLAY_NAME'`. To filter by the globally unique [identifier](https://docs.cloud.google.com/agent-registry/concepts#agent-identifier) (URN), you can use `agentId='urn:agent:AGENT_URN'`.

Built-in Google agents use a URN format that depends on where the agent is
deployed. For example, you can discover built-in Google Workspace agents by
filtering your list for the `googleapis.com` publisher using
`--filter="agentId:'urn:agent:googleapis.com:*'"`.

### Terraform

Reference your registered agent in other Terraform configurations by using the
`google_agent_registry_agent` data source:

    data "google_agent_registry_agent" "my_agent" {
      location = "REGION"
      filter = "displayName=\"DISPLAY_NAME\""
    }

    output "agent_urn" {
      value = data.google_agent_registry_agent.my_agent.urn
    }

Replace the following:

- `REGION`: The registry region.
- `DISPLAY_NAME`: The human-readable display name of the agent.