Lab 36: Publishing support-ops-agent to Gemini Enterprise & Governing Your Fleet
Goalโ
Welcome to the finale of the Parts 6 & 7 support-ops-agent arc! In this hands-on and architectural capstone lab, you will:
- Discover Gemini Enterprise apps in your Google Cloud project using
agents-cli publish gemini --list. - Publish your Module 35 Agent Runtime
support-ops-agentvia Mode 1 โ Native ADK:streamQueryRegistration (leveragingdeployment_metadata.jsonauto-detection and learning how to tracestreaming_agent_run_with_eventsinreasoning_engine_stderr). - Publish your Module 32 / 33 Cloud Run or GKE
support-ops-agentvia Mode 2 โ A2A Registration (${SERVICE_URL}/a2a/app/.well-known/agent-card.json) with least-privilege Discovery Engine IAM access. - Audit auto-registered Agent Runtime agents and catalog Module 34's Cloud Run MCP server in Google Cloud Agent Registry (
gcloud agent-registry), followed by an enterprise RBAC & Data Connector governance blueprint.
Prerequisitesโ
- A Google Cloud Project with a Gemini Enterprise app created in the Cloud Console (Discovery Engine) and Discovery Engine Editor + Agent Registry Editor (
roles/agentregistry.editor) permissions. agents-cliinstalled (uv tool install google-agents-cli) and authenticated (gcloud auth login&gcloud auth application-default login).- Your
support-ops-agent/directory from Module 35 (containingdeployment_metadata.jsonwith"agent_directory": "app") and/or your Cloud RunSERVICE_URLfrom Module 32. - Note on Costs: Gemini Enterprise and deployed runtime resources incur cloud charges; clean up unused test engines after completing the lab.
Step 1: Discover Gemini Apps in Your Projectโ
Before registering support-ops-agent, set your project environment variables and query the Gemini Enterprise apps available in your project:
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
export DEPLOY_REGION="us-central1"
export PROJECT_NUMBER=$(gcloud projects describe "$GOOGLE_CLOUD_PROJECT" --format="value(projectNumber)")
# TODO: Run `agents-cli publish gemini` with the flag that lists all Gemini apps in the current project and exits.
Copy the full Gemini app resource name (projects/<PROJECT_NUMBER>/locations/global/collections/default_collection/engines/<ENGINE_ID>) into GEMINI_APP_ID:
export GEMINI_APP_ID="projects/${PROJECT_NUMBER}/locations/global/collections/default_collection/engines/YOUR_GEMINI_ENGINE_ID"
Step 2: Mode 1 โ Native ADK :streamQuery Registration (From Module 35's deployment_metadata.json)โ
Navigate into your support-ops-agent/ project directory from Module 35, where agents-cli deploy generated deployment_metadata.json (if you started directly at Module 36 against an already-deployed Reasoning Engine, scaffold support-ops-agent first or pass --registration-type adk --agent-runtime-id "projects/$GOOGLE_CLOUD_PROJECT/locations/$DEPLOY_REGION/reasoningEngines/YOUR_ENGINE_ID" explicitly):
cd support-ops-agent
cat deployment_metadata.json
Because deployment_metadata.json records remote_agent_runtime_id, deployment_target: "agent_runtime", and agent_directory: "app", agents-cli publish gemini automatically selects Mode 1 (--registration-type adk) and reads the reasoning engine ID for you!
Your Tasks:
- Zero-Flag Metadata Publish: Run
agents-cli publish geminipassing--gemini-app-id "$GEMINI_APP_ID",--display-name "Support Ops Agent", and--description "Triages tickets, checks SLAs, and escalates P1 incidents":# TODO: Register support-ops-agent with Gemini using deployment_metadata.json auto-detection - Interactive Wizard Exploration: Know how to launch the guided terminal prompt mode (
agents-cli publish gemini --interactive) when onboarding teammates interactively. - Production Observability Check (
streaming_agent_run_with_events): Write thegcloud logging readcommand that searchesreasoning_engine_stderronaiplatform.googleapis.com/ReasoningEngineforstreaming_agent_run_with_eventsโ the exactAdkAppmethod invoked when Gemini calls your agent via:streamQuery:# TODO: Write the `gcloud logging read` command filtering reasoning_engine_stderr for streaming_agent_run_with_events
Step 3: Mode 2 โ A2A Registration (From Module 32/33's Cloud Run or GKE Deployment)โ
Now suppose your SRE organization hosts a regional instance of support-ops-agent on Cloud Run (from Module 32) at SERVICE_URL="https://support-ops-agent-xyz-uc.a.run.app". Cloud Run has no ReasoningEngine resource and deploys with --no-allow-unauthenticated by default.
Your Tasks:
- Grant Discovery Engine Invoker Access: Grant
roles/run.servicesInvokeron thesupport-ops-agentCloud Run service toservice-${PROJECT_NUMBER}@gcp-sa-discoveryengine.iam.gserviceaccount.com:export SERVICE_URL="https://support-ops-agent-xyz-uc.a.run.app"
# TODO: Run `gcloud run services add-iam-policy-binding` granting roles/run.servicesInvoker
# to service-${PROJECT_NUMBER}@gcp-sa-discoveryengine.iam.gserviceaccount.com - Register via the Live A2A Agent Card: Because
support-ops-agentis a Python ADK project withagent_directory: "app"andApp(name="app"), its live Agent Card is served at${SERVICE_URL}/a2a/app/.well-known/agent-card.json. Runagents-cli publish geminiina2amode:# TODO: Run `agents-cli publish gemini` with:
# --registration-type a2a
# --agent-card-url "${SERVICE_URL}/a2a/app/.well-known/agent-card.json"
# --gemini-app-id "$GEMINI_APP_ID"
# --display-name "Support Ops Agent (Cloud Run)"
# --description "Triages tickets, checks SLAs, and escalates P1 incidents over A2A"
Step 4: Fleet Governance in Google Cloud Agent Registry (gcloud agent-registry)โ
Publishing to a Gemini app populates one workspace's Agent Gallery, whereas Google Cloud Agent Registry governs your entire cloud fleet of agents and MCP servers.
Your Tasks:
- Audit Auto-Registered Agent Runtime Agents: Run
gcloud agent-registry agents listin$DEPLOY_REGION(us-central1) to verify that Module 35'ssupport-ops-agentwas auto-registered upon deployment:# TODO: List auto-registered agents in Google Cloud Agent Registry for $GOOGLE_CLOUD_PROJECT and $DEPLOY_REGION - Catalog Module 34's External Cloud Run MCP Server: Create a compact
toolspec.jsonfile (representing the MCPtools/listschema, max 10 KB) for Module 34's Cloud Run MCP server (MCP_SERVER_URL), then register it in Agent Registry usinggcloud agent-registry services create:cat << 'EOF' > toolspec.json
{
"tools": [
{
"name": "lookup_incident_runbook",
"description": "Fetches approved SRE runbook steps for P1/P2 production alerts.",
"inputSchema": {
"type": "object",
"properties": {
"service": {"type": "string"}
},
"required": ["service"]
}
}
]
}
EOF
export MCP_SERVER_URL="https://support-mcp-server-xyz-uc.a.run.app"
# TODO: Run `gcloud agent-registry services create support-mcp-server` with:
# --project "$GOOGLE_CLOUD_PROJECT"
# --location "$DEPLOY_REGION"
# --mcp-server-spec-type=tool-spec
# --mcp-server-spec-content=toolspec.json
# --interfaces="url=${MCP_SERVER_URL}/mcp,protocolBinding=jsonrpc"
Step 5: Enterprise Governance, RBAC & Data Connectors Blueprintโ
To complete your enterprise rollout plan around support-ops-agent, define the organizational guardrails for three departments sharing your Gemini Enterprise app (Support & SRE, Sales, and HR):
- Data Connectors: Which Gemini Enterprise connectors (e.g., Jira/ServiceNow, Salesforce, SharePoint) ground
support-ops-agent, aLead Qualifier Agent, and anHR Policy Assistantin live corporate records? - Least-Privilege RBAC: Which Google Groups should have User vs. Editor/Manager access to
support-ops-agent, and why should Marketing or HR users never get raw access to the P1 incident escalation connector? - SLOs & Cost Governance: Define one operational alert (based on
streaming_agent_run_with_eventserrors or escalation latency) and one departmental budget guardrail.
Self-Reflection Questionsโ
- Why does
agents-cli publish geminidefault to--registration-type adk(:streamQuery) for ADK agents on Agent Runtime instead of A2A, even though the Agent Runtime container also serves an A2A card? - Why is the A2A Agent Card URL for
support-ops-agenton Cloud Run/a2a/app/.well-known/agent-card.jsonrather than/.well-known/agent-card.json? - How do Gemini Enterprise's Agent Gallery and Google Cloud Agent Registry (
gcloud agent-registry) complement each other in a large enterprise?
๐ Reference Solution Vaultโ
Official Solution Vault โ Module 36
Locked Challenge โ Active Pedagogical Socratic Gate