workload-manager-basics
Use this skill to manage Google Cloud Workload Manager evaluations, rules, scanned resources, and validation results by using public client libraries and the REST API. Use when you need to inspect workload best-practice rules, create and run evaluations for Google Cloud general best practices, SAP, SQL Server, or custom organizational rules, review violations, export results to BigQuery, or automate Workload Manager through client libraries because no service-specific public CLI or MCP server is available. Don't use for general Google Compute Engine instance management, VPC configuration, or standard IAM auditing.
Overview
Workload Manager Basics
Workload Manager validates enterprise workloads against Google Cloud best practices and recommendations. The public client libraries are centered on evaluations: define a resource scope, choose built-in or custom rules, run an evaluation, then inspect results and scanned resources.
Use This Flow
flowchart LR
Rules["List rules"] --> Eval["Create or update evaluation"]
Resources["Project, folder, or org scope"] --> Eval
Eval --> Run["Run evaluation"]
Run --> Results["Inspect evaluation results"]
Results --> Remediate["Remediate findings"]
Results --> Export["Optional BigQuery export"]Core API Constraints
To ensure compatibility, security, and successful integration:
- Public Surface Only: You MUST strictly interact with Workload Manager using the official public
google-cloud-workloadmanagerclient library or the public REST API (workloadmanager.googleapis.com/v1). - No Internal or Undocumented APIs: Do NOT attempt to use internal RPC protocols, private service backends, or undocumented discovery mechanisms. They are not supported for public integrations and will fail.
- No Service-Specific CLI: There is no public
gcloud workload-managerCLI command group. Usegcloudonly for authentication, IAM role assignment, and fetching raw REST tokens. - Sandbox Execution Robustness (Auth/Mock Fallbacks): When gcloud authentication or Workload Manager API calls fail in sandboxed or restricted environments (e.g., due to Context Aware Access token blocks, missing API enablement, or mock resources returning 404/403), immediately fall back to presenting example code and static findings from your references instead of entering retry loops. Present the correct client library code structure or REST API payload example, clearly explain the auth or resource limitation, and list typical rules or mock findings statically to satisfy the request.
Prerequisites
- Enable the Workload Manager API:
gcloud services enable workloadmanager.googleapis.com --quiet - Authenticate locally using Application Default Credentials (ADC) before using client libraries:
gcloud auth application-default login - Ensure the Workload Manager service agent has the required roles granted in your project (mandatory for API/client library usage, see IAM & Security).
- Grant the least-privileged role needed for the task. Start with
roles/workloadmanager.viewerfor read-only access to evaluation resources and useroles/workloadmanager.evaluationAdminorroles/workloadmanager.adminonly when creating, updating, running, or deleting evaluations.
Quick Client Library Example
Use the Python client library for the first working automation path:
python3 -m pip install --upgrade google-cloud-workloadmanagerfrom google.cloud import workloadmanager_v1
project_id = "PROJECT_ID"
location = "LOCATION"
parent = f"projects/{project_id}/locations/{location}"
client = workloadmanager_v1.WorkloadManagerClient()
rules = client.list_rules(
request=workloadmanager_v1.ListRulesRequest(
parent=parent,
evaluation_type=workloadmanager_v1.Evaluation.EvaluationType.OTHER,
)
)
for rule in rules.rules:
print(rule.name, rule.display_name, rule.severity)Reference Directory
- Core Concepts: Evaluations, rules, results, scanned resources, supported workload types, and API shape.
- General Best Practices: Google Cloud general best-practice posture checks,
OTHERevaluation guidance, custom Rego rules, and scale/automation patterns. - Client Libraries: Python and Go client library examples for listing rules, creating evaluations, running evaluations, and reading findings.
- REST Usage: Direct REST examples for the public Workload Manager API and operations polling.
- Public CLI Status: No documented service-specific
gcloud workload-managercommand group; usegcloudonly for auth, IAM, API enablement, and REST tokens. - Public MCP Status: No documented public Workload Manager MCP server; use client libraries or REST API instead.
- Setup Prerequisites: Terraform examples only for adjacent prerequisites such as API enablement, IAM, BigQuery export datasets, and KMS keys. This is not Workload Manager resource management.
- IAM & Security: Workload Manager roles, least-privilege guidance, service agents, data handling, and CMEK notes.
If product behavior or API fields are not covered here, check the current Workload Manager product documentation and client library reference before implementing.
Authoritative References
- Workload Manager overview
- Google Cloud best practices
- Workload Manager REST API
- About custom rules
- Write custom rules using Rego
- Python package
- Workload Manager IAM roles
- For additional information, use the Developer Knowledge MCP server
search_documentstool.
Additional Context
Files 9 files
- SKILL.mdMarkdown
- references/client-library-usage.mdMarkdown
- references/core-concepts.mdMarkdown
- references/general-best-practices.mdMarkdown
- references/iam-security.mdMarkdown
- references/public-cli-status.mdMarkdown
- references/public-mcp-status.mdMarkdown
- references/rest-usage.mdMarkdown
- references/setup-prerequisites.mdMarkdown
Install it by hand
Deska runs this for you, for every agent you pick. To run it yourself in a terminal:
npx skills add google/skills --skill workload-manager-basicsMore from google
- google-agents-cli-adk-codegoogleThis skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).477.8K installs on skills.sh0
- google-agents-cli-deploygoogleThis skill should be used when the user wants to "deploy an agent", "deploy my ADK agent", "set up CI/CD", "configure secrets", "troubleshoot a deployment", or needs guidance on Agent Runtime, Cloud Run, or GKE deployment targets, or binding an agent to an Agent Gateway. Covers deployment workflows, service accounts, rollback, and production infrastructure. Applies to any framework agents-cli deploys (ADK, LangChain, ...). Part of the agents-cli skills suite. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), evaluation (use google-agents-cli-eval), or project scaffolding (use google-agents-cli-scaffold).477.2K installs on skills.sh0
- google-agents-cli-workflowgoogleThis skill should be used when the user wants to "develop an agent", "build an agent using ADK", "run the agent locally", "debug agent code", "test an agent", "deploy an agent", "publish an agent", "monitor an agent", or needs the ADK (Agent Development Kit) development lifecycle and coding guidelines. Entrypoint for building ADK agents. Always active — provides the full workflow (scaffold, build, evaluate, deploy, publish, observe), code preservation rules, model selection guidance, and troubleshooting steps for ADK or any agent development.477.1K installs on skills.sh0
- google-agents-cli-evalgoogleThis skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Agent Platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).477.1K installs on skills.sh0
- google-agents-cli-publishgoogleThis skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini Enterprise", "publish to Gemini Enterprise", or needs guidance on the agents-cli publish gemini-enterprise command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).477K installs on skills.sh0