Agent Identity on Google Cloud: SPIFFE Principals and Access Boundaries

GCP Study Hub
November 18, 2026

Agent Identity gives every agent on Google Cloud its own cryptographic identity based on the SPIFFE standard. Each agent appears as a separate principal in Cloud Audit Logs, and IAM roles are granted directly to that agent's own SPIFFE-based principal. Unlike service accounts, these identities cannot be impersonated and have no keys that could leak, because their access tokens are bound to an X.509 certificate that renews automatically every 24 hours. On the Professional Agentic Architect exam, questions about Agent Identity test how it differs from service account patterns, how it is configured during deployment on Agent Runtime, and how to restrict the resources those agent identities are eligible to reach.

Why Agent Identity differs from service accounts

Traditional service account setups leave gaps around auditability, credential lifetime, and impersonation when applied to agents running on Google Cloud. When multiple agents share a single user-managed service account, Cloud Audit Logs record the same principal for every action, so individual agents cannot be told apart. Using the Compute Engine default service account makes this harder still, because that account is shared by many workloads. Even when each agent receives a dedicated user-managed service account to separate the audit trail, each account can still depend on a key and can still be impersonated by anyone who holds the Service Account Token Creator role.

Several common workarounds address only part of the problem without removing the underlying service account limits:

  • Key rotation: Rotating service account keys shortens their lifetime, but the keys still exist and can still be leaked.
  • Organization policies blocking new keys: Stopping new keys from being created does not remove an existing key, separate agents that share an account, or limit impersonation.
  • Impersonation through a deployer: Having a deployer impersonate a shared service account keeps one principal in Cloud Audit Logs, and the deployer becomes one more identity that can act as the agents.
  • Workload Identity Federation: Workload Identity Federation is designed for workloads that run outside Google Cloud, not for agents already running on Google Cloud.

Agent Identity addresses audit separation, credential lifetime, and impersonation directly. Every agent receives its own SPIFFE-based principal, so Cloud Audit Logs distinguish each agent automatically. Credentials stay short-lived through the 24-hour renewing X.509 certificate rather than long-lived keys, and other principals cannot impersonate an agent identity. Because agents with Agent Identity do not run as service accounts, policies aimed at service accounts miss them.

Enabling Agent Identity and gateway bindings on Agent Runtime

When deploying an ADK agent to Agent Runtime with agents-cli, Agent Identity is turned off by default when neither identity flag is provided, and passing --no-agent-identity turns it off explicitly. The identity setting matters beyond audit logs, because Agent Runtime requires Agent Identity before a gateway can be bound to an agent. A service account does not satisfy that requirement, so an agent that needs gateway controls has to be deployed with Agent Identity turned on.

The deployment flags each control a separate setting and distinguish traffic directions and networking layers:

  • --agent-identity: Assigns the agent its own SPIFFE-based Agent Identity on Agent Runtime.
  • --agent-gateway-egress: Routes the agent's outbound traffic through a gateway whose governedAccessPath is AGENT_TO_ANYWHERE.
  • Ingress gateway flag: Binds a gateway to inbound traffic rather than outbound traffic.
  • Network attachment: Connects the agent to a private VPC network through Private Service Connect. It is a networking setting and does not bind a gateway.

Scoping access with principal access boundary policies

Because agents running with Agent Identity do not use service accounts, restricting what resources they can reach requires targeting their SPIFFE principal set directly. All agent identities in a project can be addressed together as a single principal set with the following form:

//agents.global.org-ORG_ID.system.id.goog/attribute.container/projects/PROJECT_NUMBER

To limit a project's agent identities so they can only reach approved projects or resources, bind a principal access boundary policy that lists those eligible resources to that principal set. A principal access boundary policy defines which resources a set of principals is eligible to access. Even if an allow policy later grants an agent identity a role on another resource outside the boundary, the principal access boundary policy still applies, so the mistaken grant has no effect.

Other IAM and organization controls solve different problems and should not be confused with principal access boundary policies:

  • Organization-level deny policies on every permission: Denying every permission at the organization level blocks access broadly, including the projects and resources the agents need.
  • Scheduled reviews of unused roles: Reviewing unused roles on a recurring schedule finds a mistaken grant only after it has been in place.
  • Domain restricted sharing constraint: Controls which identities can be granted roles, not which resources an agent identity can reach.

Putting the distinctions together for the exam

For the Professional Agentic Architect exam, we would lean toward mapping each requirement directly to the control built for it. When an environment needs separate per-agent entries in Cloud Audit Logs, no long-lived keys, and no path for Service Account Token Creator impersonation, Agent Identity replaces user-managed and default service accounts. When ADK agents on Agent Runtime need gateway controls, Agent Identity has to be enabled at deployment, because every gateway binding depends on it, and the binding flag has to match the direction of the traffic being governed. When the goal is to make future mistaken role grants outside approved projects ineffective across all agent identities in a project, bind a principal access boundary policy to the project's agent identity principal set.

Our Professional Agentic Architect practice exams test Agent Identity alongside Agent Runtime gateway bindings and principal access boundary policies, with detailed explanations that drill these distinctions.

Get tips and updates from GCP Study Hub

arrow