Module 31: Production Deployment Strategies & Workload Identity
Theoryβ
Figure: Enterprise Cloud Runtime selection and Workload Identity framework evaluating compliance, session persistence, scaling, and zero-trust identity boundaries.
Welcome to Part 7: Cloud Runtimes & Enterprise (Modules 31β36)β
In Part 6: Enterprise AgentOps with Google Agents CLI (Modules 30.1β30.4), you took our canonical support-ops-agent (gemini-3.8-flash) from a spec-driven --prototype scaffold (Module 30.1) through the multi-turn Quality Flywheel & GEPA (Module 30.2), CLI Extensions & GitOps CI/CD (Module 30.3), and Privacy-Preserving Cloud Telemetry & Token FinOps (Module 30.4).
Now in Part 7, your agent is tested, gated, and cost-tunedβready to leave localhost and run on Google Cloud production infrastructure. Rather than locking you into a single compute silo, google-agents-cli builds and deploys the exact same Dockerfile and app/fast_api_app.py harness across three first-class Google Cloud runtimes: Cloud Run (Module 32), GKE Autopilot (Module 33), and Agent Runtime (Module 35), culminating in Gemini Enterprise & Agent Registry governance (Module 36).
The Cloud Runtime Decision Matrixβ
Figure: Architecture comparison matrix across Agent Runtime (Managed Compliance & Sessions), Google Cloud Run (Serverless Container Control), and Google Kubernetes Engine Autopilot (Cluster & Hardware Control).
When promoting an agent with agents-cli scaffold enhance . --deployment-target <target>, use six architectural axes to choose the right compute target:
| Criteria | Agent Runtime (agent_runtime) | Cloud Run (cloud_run) | GKE Autopilot (gke) |
|---|---|---|---|
| Operational Model | Fully managed agent runtime in Gemini platform (managed via agents-cli deploy, no cluster or ingress plumbing) | Managed serverless containers with instant revision traffic splitting & scale-to-zero | Full Kubernetes cluster orchestration (Pods, HPA, Deployments, Workload Identity) |
Session Backends (--session-type) | Managed automatically (VertexAiSessionService wired when GOOGLE_CLOUD_AGENT_ENGINE_ID is injected; omit custom session_type) | in_memory (dev), cloud_sql (managed Postgres w/ IAM auth), or agent_platform_sessions | in_memory (dev), cloud_sql (managed Postgres w/ IAM auth), or agent_platform_sessions |
| Networking & Ingress | VPC Service Controls (VPC-SC), Private Service Connect interfaces (--network-attachment), Agent Gateway (--agent-gateway-ingress / --agent-gateway-egress) | Public HTTPS, Direct VPC Egress, Identity-Aware Proxy (--iap), --ingress internal / GCLB | Kubernetes NetworkPolicy, Gateway API, private clusters, multi-service mesh |
| Cost & Scaling Model | vCPU-hours + memory-hours (zero idle compute charge when --min-instances 0) | Per-instance-second + optional --min-instances warm capacity; --timeout 3600 for streaming/Live | Autopilot Pod resource requests (or Standard node pools / GPU nodes) |
| Compliance & Security | FedRAMP, HIPAA, PCI, CMEK (--key), Agent Identity (--agent-identity) | HIPAA, PCI, IAM / IAP authentication, Secret Manager (--secrets) | Customizable for HIPAA/PCI/sovereign controls (higher platform-team responsibility) |
| OAuth / Live / Eventarc | Required for managed OAuth 2.0 user consent in Gemini Enterprise; Live needs --min-instances 1; Eventarc via /api passthrough | Simplest for Eventarc & Pub/Sub (/apps/{app}/trigger/*); Live voice needs --timeout 3600 --min-instances 1; no managed OAuth user consent | Custom GPU hardware acceleration, custom sidecars, high-density microservices, K8s Jobs |
Quick Architectural Heuristicsβ
- π Rapid Serverless APIs, Webhooks, A2A Microservices, or Eventarc Triggers β
cloud_run(Module 32): Fastest container iteration, revision-based instant traffic rollback, Identity-Aware Proxy (--iap), and pay-per-request scaling. - βΈοΈ Kubernetes Standardization, Fine-Grained
NetworkPolicy, or GPUs βgke(Module 33): Full Kubernetes control over pod topology, custom hardware, and cluster-internal service meshes. - π‘οΈ FedRAMP Compliance, Managed Sessions, Agent Gateway, or OAuth User Consent β
agent_runtime(Module 35): Zero-ops managed infrastructure with automaticVertexAiSessionService, CMEK encryption, per-agent Workload Identity, and native Gemini Enterprise OAuth delegation.
Zero-Trust Workload Identity Architectureβ
A production agent never authenticates with personal developer credentials or static JSON service-account keys. agents-cli enforces a strict three-plane identity boundary across CI/CD and runtime execution:
1. Agent Identity vs. Service Account on Agent Runtimeβ
When scaffolding or enhancing an agent_runtime project, agents-cli provides --agent-runtime-identity-default [agent_identity|service_account] (defaulting to agent_identity on new projects) and --agent-identity / --no-agent-identity on agents-cli deploy:
| Identity Mode | How It Works | When to Use |
|---|---|---|
agent_identity (Default for new Agent Runtime projects) | Provisions a dedicated, cryptographically verifiable Agent Identity principal bound exclusively to that Agent Runtime resource. | Recommended default for zero-trust enterprise governance, per-agent audit trails, and mandatory before binding an inbound or outbound Agent Gateway (--agent-gateway-ingress / --agent-gateway-egress). |
service_account (app_sa) | Runs the container under a customer-managed IAM Service Account (--service-account <email> or Terraform's app_sa). | Required on Cloud Run and GKE (via GKE Workload Identity Federation), or on Agent Runtime when existing org policies require pre-approved IAM service accounts. |
2. Separation of cicd_runner_sa and Runtime Identityβ
In scaffolded Terraform (deployment/terraform/), agents-cli separates deployment privileges from runtime privileges:
cicd_runner_sa: Granted permissions to push images to Artifact Registry and update Cloud Run / GKE / Agent Runtime revisionsβnever used to execute end-user prompts.app_sa/Agent Identity: Granted strictly minimal runtime roles (roles/aiplatform.user,roles/cloudtrace.agent,roles/cloudsql.clientwhen--session-type cloud_sqlis enabled, androles/secretmanager.secretAccessoronly for declared--secrets).
Multi-Target Promotion & Safe Pre-Flight Inspection (deploy --dry-run)β
Because app/agent.py stays decoupled from infrastructure, switching or auditing deployment targets takes two non-destructive commands:
# 1. Enhance in place for Agent Runtime with Agent Gateway root CA trust in Dockerfile
agents-cli scaffold enhance . \
--deployment-target agent_runtime \
--agent-runtime-identity-default agent_identity \
--agent-gateway \
--skip-checks -y
# 2. Preview exact rollout actions without mutating cloud infrastructure
agents-cli deploy \
--deployment-target cloud_run \
--project my-enterprise-proj \
--region us-central1 \
--iap \
--min-instances 1 \
--timeout 3600 \
--dry-run
--agent-gatewayat Scaffold/Enhance Time: InjectsAGENT_GATEWAY_ROOT_CERTIFICATEShandling into yourDockerfileso outbound HTTPS calls inside the container trust the corporate/platform Agent Gateway's TLS inspection certificate when deployed with--agent-gateway-egress.agents-cli deploy --dry-run(-n): Prints the exact underlying rollout command (gcloud run deploy ...,terraform + docker + kubectl, or Agent Runtime specification) without creating or billing any cloud resourcesβideal for pre-flight security audits and CI validation.
A regulated public-sector team needs to deploy 'support-ops-agent' with FedRAMP compliance, managed OAuth 2.0 user consent in Gemini Enterprise, automatic session persistence, and governed outbound traffic through an Agent Gateway. Which target and configuration combination is required?
Key Takeawaysβ
- One Container, Three Cloud Runtimes:
support-ops-agentruns unchanged across Cloud Run (fast serverless HTTP/A2A & Eventarc), GKE Autopilot (KubernetesNetworkPolicy, custom pods, GPUs), and Agent Runtime (FedRAMP, automaticVertexAiSessionService, CMEK, and managed OAuth user consent). - Zero-Trust Workload Identity: Separate
cicd_runner_safrom runtime principals; preferagent_identity(--agent-runtime-identity-default agent_identity/--agent-identity) on Agent Runtime and least-privilegeapp_saon Cloud Run and GKE. - Agent Gateway TLS Readiness: Always run
agents-cli scaffold enhance . --agent-gatewaybefore binding--agent-gateway-egressso yourDockerfiletrustsAGENT_GATEWAY_ROOT_CERTIFICATES. - Non-Destructive Rollout Audits: Use
agents-cli deploy --dry-run(-n) to inspect generated target flags (--iap,--timeout 3600,--min-instances,--service-account) before executing live cloud deployments in Modules 32β35.