Authentication overview

Authentication lets you control who can call your Cloud Run workloads. By default, each request must include a Google-signed ID token or access token that identifies the caller. Cloud Run then uses Identity and Access Management (IAM) to check that the caller can invoke the resource before the request reaches your container. This document explains how authentication applies to each Cloud Run resource type and links to guides for common use cases.

Authentication by resource type

How you control access depends on whether the resource serves requests at an endpoint:

  • Each service serves requests at an HTTPS endpoint. To let a principal call a service, grant it the Cloud Run Invoker role (roles/run.invoker) on the service. Principals with broader roles, such as Cloud Run Admin or the basic Owner and Editor roles, can call it, too. If your organization policy allows it, you can disable the Cloud Run Invoker IAM check so that anyone can call the service without credentials.
  • Each instance (Preview) serves requests at its own HTTPS endpoint. To let a principal call an instance, grant it the Cloud Run Invoker role on the instance. As with services, you can disable the Cloud Run Invoker IAM check to allow public access.
  • Jobs don't serve requests, so there's no endpoint to authenticate. To let a principal execute a job, grant it the Cloud Run Invoker role on the job. For more information, see Execute jobs.
  • Worker pools don't have an endpoint or URL. If you connect a worker pool to a Virtual Private Cloud (VPC) network by using Direct VPC, each worker pool instance gets a private IP address that other resources in the network can reach. Use VPC firewall rules to control which sources can connect. The same applies to Cloud Run instances that receive traffic over Direct VPC.

For a summary of access controls for each resource type, including ingress settings and load balancer options, see Who can invoke or execute your resources.

Common use cases

The following table lists common authentication use cases and the resource types that support them:

Use case Services Instances (Preview) Jobs Worker pools
Control who can call or execute the resource Yes Yes Yes No
Allow public access Yes Yes, as shown in the instances quickstart No No
Authenticate developers Yes Yes, with the gcloud beta run instances proxy command No No
Authenticate service-to-service requests Yes Yes No No
Set custom audiences Yes No No No
Authenticate end users Yes Yes No No
Configure Identity-Aware Proxy Yes Yes No No
Restrict network ingress Yes Yes No Yes, with VPC firewall rules

To execute a job on a schedule or from a workflow, see Execute jobs on a schedule and Invoke jobs using Workflows.

To authenticate AI agents and the MCP servers that they call, see Authenticate your AI agents and Authenticate MCP servers (Preview).