Generated banner for Workload Manager Basics
Generated logo for Workload Manager Basics

Workload Manager Basics

GoogleOfficialPublished by Google

  • Skill
  • Tool integration
  • Cloud and DevOps
  • Apache-2.0
  • Low risk

From the author

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.
— the description by Google

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

Workload Manager Basics provides the necessary guidance and code patterns to interact with Google Cloud Workload Manager. Since there is no dedicated CLI or MCP server for this service, this skill enables users to programmatically define, run, and inspect workload evaluations against Google Cloud best practices, including SAP and SQL Server configurations. It covers the full lifecycle from listing available rules to creating evaluation resources and exporting results.

What it does

  • Lists available best-practice rules for Google Cloud workloads
  • Creates and updates evaluation resources for specific project or organization scopes
  • Executes workload evaluations and retrieves validation results
  • Provides patterns for exporting evaluation findings to BigQuery
  • Offers Python client library examples for automating Workload Manager tasks
  • Details IAM role requirements and prerequisites for API access

When to use it

  • When you need to validate enterprise workloads against Google Cloud best practices
  • When you require custom organizational rule evaluations
  • When you need to automate Workload Manager operations via Python or REST API
  • When you need to review violations and findings from automated scans

Advantages

  • Enables programmatic management of workload evaluations
  • Supports both project-level and organization-level evaluation scopes
  • Provides clear guidance on using official client libraries
  • Includes patterns for integrating with BigQuery for data analysis

Usage examples

“List all available rules for SQL Server evaluations in my project.”
The agent provides a Python script using the WorkloadManagerClient to list rules filtered by the SQL_SERVER evaluation type.
“How do I create a daily evaluation for general best practices at the organization level?”
The agent provides a Python code snippet demonstrating how to define an evaluation resource with a cron-based schedule and organization-level scope.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/google/workload-manager-basics/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip workload-manager-basics.zip -d .agents/skills

Documentation by Google

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.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:workload-manager-basics)" and append agent-skills/1.0 (skill:workload-manager-basics) to User-Agent headers.

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-workloadmanager client 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-manager CLI command group. Use gcloud only 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

  1. Enable the Workload Manager API:

    gcloud services enable workloadmanager.googleapis.com --quiet
  2. Authenticate locally using Application Default Credentials (ADC) before using client libraries:

    gcloud auth application-default login
  3. Ensure the Workload Manager service agent has the required roles granted in your project (mandatory for API/client library usage, see IAM & Security).

  4. Grant the least-privileged role needed for the task. Start with roles/workloadmanager.viewer for read-only access to evaluation resources and use roles/workloadmanager.evaluationAdmin or roles/workloadmanager.admin only 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-workloadmanager
from 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, OTHER evaluation 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-manager command group; use gcloud only 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

Additional Context

Files

references/general-best-practices.md

Workload Manager General Best Practices

Use this reference when a user asks for Google Cloud general best-practice posture checks, cloud security posture management, FinOps posture, reliability posture, or custom organizational rules. In client library automation, use OTHER for this general/custom rule path and verify the available rules by listing them in the target location.

Decision Flow

flowchart TD
    Need["Need a posture baseline?"] --> BuiltIn{"Built-in Google Cloud rule?"}
    BuiltIn -->|Yes| ListOther["List rules with evaluation_type=OTHER"]
    BuiltIn -->|No| Custom["Write Rego custom rule"]
    Custom --> Bucket["Upload rules to a Cloud Storage bucket"]
    Bucket --> ListCustom["List rules with custom_rules_bucket"]
    ListOther --> Eval["Create OTHER evaluation"]
    ListCustom --> Eval
    Eval --> Run["Run or schedule execution"]
    Run --> Findings["Review violations"]
    Findings --> Export["Optional regional BigQuery export"]

Built-In General Best Practices

The Google Cloud best-practices reference is the source of truth for the public general catalog. It covers cross-product rules and assigns severities to non-compliant resources.

Use the catalog for baseline posture checks across:

  • API keys

  • AlloyDB

  • BigQuery

  • Cloud Billing

  • Cloud DNS

  • Cloud KMS

  • Cloud Pub/Sub

  • Cloud SQL

  • Cloud Storage

  • Compute Engine

  • Filestore

  • Google Kubernetes Engine

  • Identity and Access Management

  • Memorystore for Redis Cluster

  • OS Config and VM Manager

  • Resource Manager

  • Secret Manager

  • Spanner

  • Vertex AI

  • Vertex AI Workbench

Treat the online catalog as dynamic. Agents should list rules from the API in the target project and location before creating evaluations, then select rules by rule name, asset type, severity, and tags.

Severity Guidance

Use severity to prioritize remediation:

  • CRITICAL: address immediately when the finding can affect availability, data integrity, or supported configuration.

  • HIGH: plan remediation in the next maintenance window.

  • MEDIUM: queue remediation for near-term operational hardening.

  • LOW: use as posture signal, cleanup, or governance reporting.

Posture Themes

The general catalog and posture-management guidance are useful across three operational themes:

  • Security: public exposure, API key restrictions, default service account use, external IP exposure, CMEK, certificate state, and IAM hygiene.

  • Reliability: backups, point-in-time recovery, automatic storage growth, maintenance policies, unsupported settings, and resource health.

  • FinOps: labels and tags, lifecycle settings, storage expiration, oversized or under-governed resources, and historical trend tracking.

Start with a small baseline rule set that answers the immediate posture question. Expand by tag or asset category once the first execution output is well understood.

Custom Organizational Rules

Use custom rules when the built-in catalog does not encode an internal mandate. Workload Manager custom rules use Rego. In client library automation, list them through the OTHER rule path with custom_rules_bucket.

Common custom-rule use cases:

  • Require labels such as CostCenter, Owner, or Environment.

  • Disallow resources in unapproved regions.

  • Block Compute Engine default service account usage.

  • Require private-only VMs or disallow external IP addresses.

  • Enforce organization-specific tagging, network, or backup conventions.

Custom rule metadata should include:

  • DETAILS: short description of the policy.

  • SEVERITY: user-defined severity such as CRITICAL, HIGH, MEDIUM, or LOW.

  • ASSET_TYPE: supported Cloud Asset Inventory asset type.

  • TAGS: rule filter tags.

Custom Rule Evaluation Notes

  • Upload custom Rego files to a Cloud Storage bucket and pass that bucket as custom_rules_bucket.

  • Enable Service Usage API and Cloud Monitoring API in the project where the custom-rule evaluation is created and run.

  • List rules from the bucket before creating the evaluation.

  • Keep evaluations scoped to the smallest project, folder, organization, label set, or resource ID pattern that answers the question.

  • Split large custom catalogs across evaluations when needed; public docs list a maximum of 300 custom rules per evaluation.

  • BigQuery result exports for custom rules must use regional datasets, not multi-region datasets.

Operational Pattern

  1. Run a manual General Best Practices scan to establish baseline posture.

  2. Triage critical and high findings first, grouped by asset type and owner.

  3. Add a daily or weekly schedule only after rule scope and alert volume are validated.

  4. Export results to a regional BigQuery dataset when historical trend analysis or dashboarding is required.

  5. Add custom Rego rules for internal controls that do not exist in the built-in catalog.

Check expected evaluation volume and BigQuery storage/query costs before enabling frequent schedules or broad organization-wide exports.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs an MCP server, Needs a command-line tool, Needs Python

Security

What our scanner noticed· Low risk

  • Instructions that use the network

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Google
Publisher
Google (Official)
Source
google/skills · skills/cloud/workload-manager-basics · commit 2194d3b
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Google or Google.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download workload-manager-basics.zip