aidentity / index

google/skills · Apache-2.0

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.

cloud stable

Contents

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-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
    

  1. Authenticate locally using Application Default Credentials (ADC) before

using client libraries:

    gcloud auth application-default login
    

  1. Ensure the Workload Manager service agent has the required roles granted in

your project (mandatory for API/client library usage, see

[IAM & Security](references/iam-security.md)).

  1. 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](references/core-concepts.md): Evaluations, rules, results,

scanned resources, supported workload types, and API shape.

  • [General Best Practices](references/general-best-practices.md): Google Cloud

general best-practice posture checks, OTHER evaluation guidance, custom

Rego rules, and scale/automation patterns.

  • [Client Libraries](references/client-library-usage.md): Python and Go client

library examples for listing rules, creating evaluations, running

evaluations, and reading findings.

  • [REST Usage](references/rest-usage.md): Direct REST examples for the public

Workload Manager API and operations polling.

  • [Public CLI Status](references/public-cli-status.md): No documented

service-specific gcloud workload-manager command group; use gcloud only

for auth, IAM, API enablement, and REST tokens.

  • [Public MCP Status](references/public-mcp-status.md): No documented public

Workload Manager MCP server; use client libraries or REST API instead.

  • [Setup Prerequisites](references/setup-prerequisites.md): 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](references/iam-security.md): 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

Provenance

Authored by Google LLC in google/skills. The content is mirrored here under its upstream license.

Related

agent-platform-alert-configuration Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for standard infrastructure monitoring unrelated to AI agents, or when the agent is not instrumented with OpenTelemetry (for Reliability, Cost, Safety, Security alerts). NOTE: Reliability, Cost, Safety, and Security alerts use generic OTel metrics and work across runtimes (such as Cloud Run, Vertex AI). Quality alerts rely on Vertex AI Online Monitors and are strictly bound to Vertex AI deployments. google/skills Apache-2.0 agent-platform-deploy Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available models, check if a specific model is deployable (`gcloud ai model-garden models list-deployment-config`), query deployment cost, troubleshoot deployment errors (like quota limits), or undeploy/clean up endpoints. Also use when copying and deploying a 1P Tuned Model. Don't use for pure listing/discovery questions of the form "is X deployed?", "list my endpoints", or "which regions have models running?" — for those use `agent-platform-endpoint-management`. Don't use for public Vertex AI deployments (use the `vertex-deploy` skill) or for running model evaluations (use the `agent-platform-eval-flywheel` skill). google/skills Apache-2.0 agent-platform-endpoint-management Manages Agent Platform serving endpoints. Use when you need to create, list, describe, update, or delete serving endpoints for model deployment on Agent Platform. Also use when troubleshooting endpoint permission, quota, or resource busy errors. Don't use for deploying models to endpoints or for running model evaluations. google/skills Apache-2.0 agent-platform-eval-flywheel Measures and improves the quality of AI models and agents on Google Cloud using the Eval Quality Flywheel methodology. Use when evaluating an agent or model, building an eval dataset, picking or writing evaluation metrics, analyzing failures, comparing results before and after a fix, or when guidance is needed on Agent Platform eval methodology — including dataset schema, LLM-as-judge scoring, and common failure causes. For fine-tuning, use agent-platform-tuning. For general production deployment, use agent-platform-deploy. google/skills Apache-2.0 agent-platform-inference Connects to and performs inference with Google Cloud Agent Platform GenAI models, including First-Party Gemini models and Third-Party OpenMaaS models (Llama, DeepSeek, Qwen, etc.). Use when asked to perform inference, ask a model a question, run a test prompt, execute chat completions, or generate code for calling Gemini or OpenMaaS models, authenticate with GenAI SDK, OpenAI SDK, or legacy Agent Platform SDK, configure base URLs and global/regional endpoints, or troubleshoot 429 Resource Exhausted (DSQ), 400 User Validation, or 404 Not Found errors. Don't use for deploying models to endpoints or for running model evaluations. google/skills Apache-2.0