Workload Manager Basics
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
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
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/workload-manager-basics/downloadUnzip 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-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 --quietAuthenticate locally using Application Default Credentials (ADC) before using client libraries:
gcloud auth application-default loginEnsure 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
For additional information, use the Developer Knowledge MCP server
search_documentstool.
Additional Context
Files
- ATTRIBUTION.mdAdded by AutoGineer864 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md7.2 KiB
- references/attribution.md1.9 KiB
- references/client-library-usage.md11.9 KiB
- references/core-concepts.md3.9 KiB
- references/general-best-practices.md5.0 KiB
- references/iam-security.md5.1 KiB
- references/public-cli-status.md2.0 KiB
- references/public-mcp-status.md935 B
- references/rest-usage.md7.0 KiB
- references/setup-prerequisites.md3.0 KiB
references/rest-usage.md
Workload Manager REST Usage
Use REST when the client libraries do not cover a needed resource, when debugging raw requests, or when building language-agnostic automation.
Setup
export PROJECT_ID="PROJECT_ID"
export LOCATION="LOCATION"
export TOKEN="$(gcloud auth print-access-token)"
export BASE_URL="https://workloadmanager.googleapis.com/v1"List Rules
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/rules"Filter by evaluation type when selecting rules for a specific workload:
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/rules?evaluationType=SQL_SERVER"List built-in Google Cloud general best-practice rules with OTHER:
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/rules?evaluationType=OTHER"List uploaded custom Rego rules by passing the custom rules bucket:
export CUSTOM_RULES_BUCKET="CUSTOM_RULES_BUCKET"
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/rules?evaluationType=OTHER&customRulesBucket=${CUSTOM_RULES_BUCKET}"Create an Evaluation (Organization-Level Scope - Recommended)
This example creates a SQL Server evaluation targeting an organization scope with a default daily schedule.
export EVALUATION_ID="sql-server-prod"
export REQUEST_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
export ORG_ID="ORG_ID"
curl -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations?evaluationId=${EVALUATION_ID}&requestId=${REQUEST_ID}" \
-d @- <<'JSON'
{
"description": "SQL Server production validation",
"evaluationType": "SQL_SERVER",
"resourceFilter": {
"scopes": ["organizations/ORG_ID"]
},
"schedule": "0 0 * * *",
"ruleNames": [
"projects/PROJECT_ID/locations/LOCATION/rules/RULE_ID"
],
"labels": {
"owner": "platform",
"workload": "sql-server"
}
}
JSONReplace PROJECT_ID, LOCATION, ORG_ID, and RULE_ID before running.
Create an Evaluation (Project-Level Scope - Fallback)
If organization-level access is not available, use project-level scope:
export EVALUATION_ID="sql-server-prod-project"
export REQUEST_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
curl -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations?evaluationId=${EVALUATION_ID}&requestId=${REQUEST_ID}" \
-d @- <<'JSON'
{
"description": "SQL Server project validation",
"evaluationType": "SQL_SERVER",
"resourceFilter": {
"scopes": ["projects/PROJECT_ID"]
},
"schedule": "0 0 * * *",
"ruleNames": [
"projects/PROJECT_ID/locations/LOCATION/rules/RULE_ID"
],
"labels": {
"owner": "platform",
"workload": "sql-server"
}
}
JSONCreate a General Best-Practices Evaluation (Organization-Level Scope - Recommended)
This example creates a general posture check evaluation targeting organization scope with a default daily schedule.
export EVALUATION_ID="general-posture-prod"
export REQUEST_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
export ORG_ID="ORG_ID"
curl -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations?evaluationId=${EVALUATION_ID}&requestId=${REQUEST_ID}" \
-d @- <<'JSON'
{
"description": "General Google Cloud posture baseline",
"evaluationType": "OTHER",
"resourceFilter": {
"scopes": ["organizations/ORG_ID"]
},
"schedule": "0 0 * * *",
"ruleNames": [
"projects/PROJECT_ID/locations/LOCATION/rules/RULE_ID"
],
"labels": {
"owner": "platform",
"baseline": "general"
}
}
JSONReplace PROJECT_ID, LOCATION, ORG_ID, and RULE_ID before running.
Create a General Best-Practices Evaluation (Project-Level Scope - Fallback)
export EVALUATION_ID="general-posture-project"
export REQUEST_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
curl -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations?evaluationId=${EVALUATION_ID}&requestId=${REQUEST_ID}" \
-d @- <<'JSON'
{
"description": "General Google Cloud posture project baseline",
"evaluationType": "OTHER",
"resourceFilter": {
"scopes": ["projects/PROJECT_ID"]
},
"schedule": "0 0 * * *",
"ruleNames": [
"projects/PROJECT_ID/locations/LOCATION/rules/RULE_ID"
],
"labels": {
"owner": "platform",
"baseline": "general"
}
}
JSONPoll an Operation
export OPERATION_NAME="projects/${PROJECT_ID}/locations/${LOCATION}/operations/OPERATION_ID"
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/${OPERATION_NAME}"The operation response contains done: true when complete. If an error is
present, fix that error before retrying with a new request ID.
Run an Evaluation
export EVALUATION_ID="sql-server-prod"
export EXECUTION_ID="manual-run-001"
export REQUEST_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
curl -sS -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations/${EVALUATION_ID}/executions:run" \
-d @- <<JSON
{
"executionId": "${EXECUTION_ID}",
"execution": {
"labels": {
"trigger": "manual"
}
},
"requestId": "${REQUEST_ID}"
}
JSONList Executions
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations/${EVALUATION_ID}/executions"List Execution Results
export EXECUTION_ID="EXECUTION_ID"
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations/${EVALUATION_ID}/executions/${EXECUTION_ID}/results"List Scanned Resources
curl -sS \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations/${EVALUATION_ID}/executions/${EXECUTION_ID}/scannedResources"Delete an Evaluation
Use force=true only when associated child resources should also be deleted.
export REQUEST_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
curl -sS -X DELETE \
-H "Authorization: Bearer ${TOKEN}" \
"${BASE_URL}/projects/${PROJECT_ID}/locations/${LOCATION}/evaluations/${EVALUATION_ID}?requestId=${REQUEST_ID}&force=true"REST-Only Resources
If client libraries do not expose a Workload Manager resource yet, consult the REST reference for endpoints such as deployments, actuations, discovered profiles, insights, and operations. Keep automation defensive because generated client libraries and REST resources can land at different times.
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
- 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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download workload-manager-basics.zip