# A self-hosted agent on Cloud Run or GKE runs as a service account, and the default one might hold the Editor role

Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.

Cloud Run runs the service as a service account (the Compute Engine default service account if you do not choose one). Google documents that, depending on organization policy, the Compute Engine default service account might automatically be granted the Editor role on the project, and that the constraint iam.automaticIamGrantsForDefaultServiceAccounts is enforced by default for organizations created after May 3, 2024.

Cloud Run runs the service as a service account, the Compute Engine default service account if you do not choose one. Google documents that, depending on organization policy, that default account might automatically be granted the Editor role on the project. The iam.automaticIamGrantsForDefaultServiceAccounts constraint is enforced by default for organizations created after May 3, 2024. On GKE, Workload Identity Federation assigns distinct IAM identities to each application.

In GKE, all Pods in a cluster can communicate with each other until network policy is enforced. Cloud Run reaches your VPC through Direct VPC egress or a connector. IAM deny policies and Principal Access Boundary policies set limits whatever the allow policies say. Admin Activity audit logs cannot be disabled; Data Access audit logs must be explicitly enabled.

- **Status:** Self-hosted pattern, not a managed agent service.
- **The identity it runs as:** Cloud Run runs the service as a service account (the Compute Engine default service account if you do not choose one). On GKE, Workload Identity Federation for GKE assigns distinct IAM identities to each application in the cluster. ([source](https://cloud.google.com/run/docs/securing/service-identity))
- **What it gets by default:** Google documents that, depending on organization policy, the Compute Engine default service account might automatically be granted the Editor role on the project, and that the constraint iam.automaticIamGrantsForDefaultServiceAccounts is enforced by default for organizations created after May 3, 2024. ([source](https://cloud.google.com/run/docs/securing/service-identity))
- **Tools and actions:** The agent code calls Google Cloud APIs as its service account or Kubernetes workload principal; Google documents using IAM policies to grant Kubernetes workloads access to specific Google Cloud APIs. ([source](https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity))
- **The agent's permissions or the user's:** The workload uses its own service account or workload identity. Propagation of an end user's permissions to the workload: none found on 2026-11-10 in the Cloud Run and GKE pages read. ([source](https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity))
- **Network reachability:** Cloud Run can send egress traffic to a VPC network with Direct VPC egress (recommended) or a VPC connector, giving access to resources with internal IP addresses. In GKE, by default all Pods in a cluster can communicate with each other until network policy is enforced. ([source](https://cloud.google.com/run/docs/configuring/connecting-vpc))
- **What is logged:** Google documents Admin Activity audit logs that cannot be disabled, and Data Access audit logs that must be explicitly enabled to receive them. ([source](https://cloud.google.com/kubernetes-engine/docs/how-to/audit-logging))

## Boundaries that apply

- **IAM roles on the service account.** The roles granted to the service account decide what the agent can reach. ([source](https://cloud.google.com/iam/docs/best-practices-service-accounts))
- **Organization policy iam.automaticIamGrantsForDefaultServiceAccounts.** Google recommends enforcing this constraint to stop the automatic Editor grant on default service accounts. ([source](https://cloud.google.com/run/docs/securing/service-identity))
- **IAM deny policies.** Deny policies set guardrails on access to Google Cloud resources regardless of allow policies. ([source](https://cloud.google.com/iam/docs/deny-overview))
- **Principal Access Boundary policies.** PAB policies define the resources a principal is eligible to access. ([source](https://cloud.google.com/iam/docs/principal-access-boundary-policies))

## Checks to run for Google Cloud

- [Give each agent its own role or service account, not a shared one](/checklist/own-identity-per-agent/): Create dedicated service accounts for each application, or use a per-agent agent identity on Agent Runtime.
- [Use short-lived role credentials and no long-lived access keys for the agent](/checklist/short-lived-credentials/): Use workload identity or an attached service account instead of service account keys, which Google describes as powerful credentials that can present a security risk.
- [Limit who can pass, attach or impersonate the agent's role](/checklist/restrict-who-can-attach-role/): Grant the Service Account User role only to principals that need to attach the service account to a resource.
- [Scope the role's trust to the specific agent, service account or workload](/checklist/scope-trust-to-the-agent/): In IAM policies, grant access to the principal that corresponds to one Kubernetes workload, not to the whole cluster or project.
- [Do not run the agent as a default or pre-granted account](/checklist/no-default-accounts/): Do not rely on the Compute Engine default service account, which can receive the Editor role; enforce the iam.automaticIamGrantsForDefaultServiceAccounts constraint.
- [Write the agent's permission policy from what its tools actually call](/checklist/least-privilege-policy/): Grant the agent identity only the roles its code needs; Google describes agent identity as enabling a least-privilege approach.
- [Set an organization-level ceiling the agent's role cannot exceed](/checklist/set-permission-ceiling/): Use Principal Access Boundary policies to define the resources the agent's principal may access.
- [Explicitly deny the agent IAM changes and destructive actions](/checklist/deny-iam-changes-and-destructive-actions/): Use an IAM deny policy that targets agent identities; Google's example denies all agents in an organization from creating roles and deleting buckets.

**Where Act is behind.** Act draws the boundary at the access layer (cloud IAM and network controls, and the gateways or MCP servers in front of agents); it does not inspect prompts or model outputs, which needs a different tool. Your team applies the boundaries it proposes, and its customer evidence for AI boundaries is less mature than for its core access control.

## Related pages

- [Self-hosted agent on Azure Container Apps or AKS: identity, permissions and boundaries](/agent-platforms/self-hosted-azure/)
- [Amazon Bedrock Agents (now Amazon Bedrock Agents Classic): identity, permissions and boundaries](/agent-platforms/bedrock-agents/)
- [Amazon Bedrock AgentCore (Runtime, Gateway, Identity): identity, permissions and boundaries](/agent-platforms/bedrock-agentcore/)

## Sources

- cloud.google.com/run/docs/securing/service-identity: https://cloud.google.com/run/docs/securing/service-identity (read 10 Nov 2026)
- cloud.google.com/kubernetes-engine/docs/concepts/workload-identity: https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity (read 10 Nov 2026)
- cloud.google.com/run/docs/configuring/connecting-vpc: https://cloud.google.com/run/docs/configuring/connecting-vpc (read 10 Nov 2026)
- cloud.google.com/kubernetes-engine/docs/how-to/network-policy: https://cloud.google.com/kubernetes-engine/docs/how-to/network-policy (read 10 Nov 2026)
- cloud.google.com/kubernetes-engine/docs/how-to/audit-logging: https://cloud.google.com/kubernetes-engine/docs/how-to/audit-logging (read 10 Nov 2026)
- cloud.google.com/iam/docs/best-practices-service-accounts: https://cloud.google.com/iam/docs/best-practices-service-accounts (read 10 Nov 2026)
- cloud.google.com/iam/docs/deny-overview: https://cloud.google.com/iam/docs/deny-overview (read 10 Nov 2026)
- cloud.google.com/iam/docs/principal-access-boundary-policies: https://cloud.google.com/iam/docs/principal-access-boundary-policies (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://aiagentaccesscontrol.com/agent-platforms/self-hosted-gcp/
