assured-workloads-basics
Provisions, inspects, updates, and deletes Google Cloud Assured Workloads V1 compliant folders, CMEK settings, Sovereign Controls by Partners, and service usage restrictions. Use when creating, listing, describing, updating, or deleting an Assured Workloads workload for any compliance regime or data boundary (FedRAMP, DoD IL2/IL4/IL5, ITAR, CJIS, Healthcare, Sovereign Controls by Partners, or Regional Data Boundaries). Don't use for brownfield assessments or custom frameworks (use assuredworkloads-environment-assessor or assuredworkloads-frameworks-*), or non-compliant folders.
- License 许可
- Apache-2.0
- 所属仓库
- google/skills
- 最近更新
- 2026-11-14
- Stars
- ★ 2.4w
- Forks
- 2.0k
01 前言 Front Matter
- name
- assured-workloads-basics
- metadata
- { "version": "1.0.1", "category": "Security" }
- description
- Provisions, inspects, updates, and deletes Google Cloud Assured Workloads V1 compliant folders, CMEK settings, Sovereign Controls by Partners, and service usage restrictions. Use when creating, listing, describing, updating, or deleting an Assured Workloads workload for any compliance regime or data boundary (FedRAMP, DoD IL2/IL4/IL5, ITAR, CJIS, Healthcare, Sovereign Controls by Partners, or Regional Data Boundaries). Don't use for brownfield assessments or custom frameworks (use assuredworkloads-environment-assessor or assuredworkloads-frameworks-*), or non-compliant folders.
02 资源文件 6
- 参考文档references/attribution.md1.8 KB
- 参考文档references/regimes.md13.7 KB
- 脚本scripts/diagnose_error.py16.4 KB
- 脚本scripts/manage_workload_updates.py26.1 KB
- 脚本scripts/restrict_allowed_resources.py13.8 KB
- 脚本scripts/validate_params.py56.2 KB
03 SKILL.md 正文
Google Cloud Assured Workloads Basics (V1 GA)
Validate prerequisites, create Assured Workloads V1 compliant folders, allowlist compliant services, and list, inspect, update, or delete existing workloads using gcloud and the Google Cloud Python Client Libraries (google-cloud-assured-workloads and google-api-python-client).
Usage Attribution
For all gcloud CLI, REST API, and MCP attribution requirements when executing commands with this skill, follow the instructions in Usage Attribution.
Mandatory Guardrails
- No Fabrication: Never invent Organization IDs, Billing Account IDs, Folder IDs, Project IDs, Workload IDs, or Compliance Regime enums. Validate parameters with
scripts/validate_params.pybefore running commands. - Regional / Multi-Regional Locations & CLI Surface: Assured Workloads V1 does not support
--location=global; always use a regional or multi-regional location compatible with the compliance regime (see references/regimes.md). Never usegcloud compliance-managercommands for Assured Workloads V1 workloads. - Human Confirmation Before Mutation: Read-only operations (
list,describe, andscripts/manage_workload_updates.py --action=list) can run immediately after validation, but you must obtain explicit user confirmation before executing any mutating or destructive command (create,restrict_allowed_resources.py,update,manage_workload_updates.py --action=apply,delete,folders delete, orprojects delete). - Telemetry Attribution & Regional Endpoints:
- Prefix every
gcloudcommand you execute directly withCLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:assured-workloads-basics)"(see Usage Attribution). - Configure Python GAPIC and Discovery clients with regional
ClientOptions(api_endpoint="{location}-assuredworkloads.googleapis.com").
- Prefix every
Step 0: Prerequisites & Environment Setup
Verify these 5 prerequisites before running Assured Workloads operations:
- CLI & Python Libraries: Install the Google Cloud SDK (
gcloud— see the Google Cloud SDK Installation Guide) and Python client libraries:pip install "google-cloud-assured-workloads>=1.0,<2" "google-api-python-client>=2.0,<3" "google-auth>=2.0,<3" - Dual Authentication (CLI + ADC): Authenticate both
gcloudand Application Default Credentials (gcloud auth login && gcloud auth application-default login, orgcloud auth activate-service-account --key-file=/path/to/key.json+export GOOGLE_APPLICATION_CREDENTIALS="/path/to/key.json"). - Quota & Admin Project:
gcloud config set project {admin_project_id}andgcloud auth application-default set-quota-project {admin_project_id}. - API Enablement: Enable the Assured Workloads API (
assuredworkloads.googleapis.com):gcloud services enable assuredworkloads.googleapis.com --project={admin_project_id} - Organization-Level IAM Roles (
organizations/{org_id}):- Caller:
roles/assuredworkloads.admin(orroles/assuredworkloads.reader/roles/assuredworkloads.editorfor read-onlylist/describe),roles/resourcemanager.organizationViewer, androles/billing.useron--billing-account=billingAccounts/{billing_id}when creating workloads (plusbilling.resourceAssociations.createon--partner-services-billing-accountfor partner workloads). - Assured Workloads Service Agent (
service-{org_number}@gcp-sa-assuredworkloads.iam.gserviceaccount.com):roles/assuredworkloads.serviceAgent.
- Caller:
Workflow 1: Create an Assured Workloads workload (Two-Phase Provisioning)
Phase 1: Validate Parameters & Create Workload (gcloud assured workloads create)
- Select Regime & Location: Check references/regimes.md for all 45 V1
--compliance-regimeenums and valid--locationvalues.- Free-Tier Regional Data Boundaries (
REGIONAL_DATA_BOUNDARY): Free-tier regional data boundaries (e.g., US Data Boundary with standard commercial support and without sovereign personnel support uplift, EU Data Boundary, Australia/India/UK/Canada/Israel Data Boundary) map to--compliance-regime=REGIONAL_DATA_BOUNDARY(legacy alias:REGIONAL_CONTROLS) paired with--location={location}(except Japan, which usesJAPAN_DATA_BOUNDARY). Do not set--compliance-regimeto paid sovereign support regimes (US_REGIONS_AND_US_SUPPORT,US_DATA_BOUNDARY_AND_SUPPORT,FEDRAMP_MODERATE) when the user requests the free-tier boundary, and never invent non-existent enums likeUS_DATA_BOUNDARY.
- Free-Tier Regional Data Boundaries (
- Billing Account Discovery (If Omitted): Never guess a billing account ID. If omitted, run
gcloud billing accounts list --filter="open=true" --format="table(name,displayName)"or ask the user forbillingAccounts/{billing_id}. - Validate & Create: Validate with
python3 scripts/validate_params.py --operation=create ..., surface any warnings, obtain explicit user confirmation, and executegcloud assured workloads create:gcloud assured workloads create \ --organization={org_id} --location={location} \ --display-name="{display_name}" --compliance-regime={compliance_regime} \ --billing-account=billingAccounts/{billing_id} \ [--provisioned-resources-parent=folders/{parent_folder_id}] [--enable-sovereign-controls] \ [--next-rotation-time={next_rotation_time} --rotation-period={rotation_seconds}s] \ [--resource-settings=consumer-project-id={consumer_project_id},consumer-project-name={consumer_project_name},encryption-keys-project-id={kms_project_id},encryption-keys-project-name={kms_project_name},keyring-id={keyring_id}] \ [--partner={partner_enum}] [--partner-permissions=data-logs-viewer=true|false] \ [--partner-services-billing-account=billingAccounts/{partner_billing_id}] \ [--labels=key1=val1,key2=val2] [--external-identifier={external_id}] --format=json- CMEK & Resource Settings Rules:
--next-rotation-time(RFC 3339 timestamp) and--rotation-period(seconds, e.g.172800s) must be specified together.encryption-keys-project-id,encryption-keys-project-name, andkeyring-idin--resource-settingsrequire both rotation flags. - Sovereign Controls by Partners (
--compliance-regime=ASSURED_WORKLOADS_FOR_PARTNERS):- Requests for partner-managed sovereign controls (S3NS, T-Systems, SIA Minsait, PSN, CNTXT, Telefónica) map to
--compliance-regime=ASSURED_WORKLOADS_FOR_PARTNERS. - Requires
--partnerand a supported partner region (see references/regimes.md for valid--partnervalues, supported regions, and partner billing account requirements). - Configure partner permissions on the CLI with
--partner-permissions=data-logs-viewer=true(ordata-logs-viewer=false).
- Requests for partner-managed sovereign controls (S3NS, T-Systems, SIA Minsait, PSN, CNTXT, Telefónica) map to
- CMEK & Resource Settings Rules:
Phase 2 (Optional): Allowlist Compliant Services / Enable BigQuery (google-cloud-assured-workloads)
- When Required: For
FEDRAMP_MODERATEandDATA_BOUNDARY_FOR_FEDRAMP_MODERATE, BigQuery is automatically enabled at creation (skip Phase 2). For all other regimes (such asFEDRAMP_HIGH), BigQuery is initially blocked by the folder'sconstraints/gcp.restrictServiceUsageorganization policy while a background configuration process completes (typically 5–10 minutes after creation). - Never Bypass Org Policies Manually: Do not manually override or delete
constraints/gcp.restrictServiceUsageon the folder to bypass Assured Workloads compliance controls. - Programmatic Allowlisting (
AssuredWorkloadsServiceClient.restrict_allowed_resources): Once background setup completes and compliant services (like BigQuery) appear incompliantButDisallowedServices, runpython3 scripts/restrict_allowed_resources.py --organization={org_id} --location={location} --workload-id={workload_id} --restriction-type=ALLOW_COMPLIANT_RESOURCES(after user confirmation), or call the officialgoogle-cloud-assured-workloadsPython client library directly:
(Supportedfrom google.api_core.client_options import ClientOptions from google.cloud import assuredworkloads_v1 client = assuredworkloads_v1.AssuredWorkloadsServiceClient( client_options=ClientOptions( api_endpoint=f"{location}-assuredworkloads.googleapis.com" ), transport="rest", ) request = assuredworkloads_v1.RestrictAllowedResourcesRequest( name=f"organizations/{org_id}/locations/{location}/workloads/{workload_id}", restriction_type=assuredworkloads_v1.RestrictAllowedResourcesRequest.RestrictionType.ALLOW_COMPLIANT_RESOURCES, ) client.restrict_allowed_resources(request=request)RestrictionTypevalues:ALLOW_COMPLIANT_RESOURCES,APPEND_COMPLIANT_RESOURCES, orALLOW_ALL_GCP_RESOURCES).
Workflow 2: List & Describe Assured Workloads workloads (gcloud)
Read-only list and describe operations do not require user confirmation after validating with scripts/validate_params.py.
- List Workloads (
ListWorkloads):gcloud assured workloads list --organization={org_id} --location={location} \ [--filter="{filter_expression}"] [--limit={limit}] [--page-size={page_size}] --format=json - Describe a Specific Workload (
GetWorkload):
(Or pass the full resource namegcloud assured workloads describe {workload_id} --organization={org_id} --location={location} --format=jsonorganizations/{org_id}/locations/{location}/workloads/{workload_id}).- Key
describeOutput Fields:name,displayName,complianceRegime,partner,resources(provisionedCONSUMER_FOLDERfolder ID,CONSUMER_PROJECT,ENCRYPTION_KEYS_PROJECT, andKEYRING),etag(optimistic concurrency token required forupdate/delete),compliantButDisallowedServices,kajEnrollmentState,saaEnrollmentResponse,violationNotificationsEnabled, andlabels.
- Key
Workflow 3: Delete an Assured Workloads workload (DeleteWorkload)
An Assured Workloads workload cannot be deleted while its provisioned Cloud Resource Manager folder (folders/{folder_id}) or child projects still exist (FAILED_PRECONDITION: Workload is not empty / ERROR_CODE_WORKLOAD_NOT_EMPTY). Never run gcloud assured workloads delete before deleting the provisioned folder and its child projects.
- Inspect & Validate: Run
gcloud assured workloads describeto identify the provisioned folder (folders/{folder_id}) and child projects ({project_id}), and validate withpython3 scripts/validate_params.py --operation=delete --workload-id={workload_id} --organization={org_id} --location={location}. - Confirm & Execute Ordered Deletion Sequence: Obtain explicit user confirmation, then run in strict bottom-up order:
# Step 1: Delete child projects inside the workload folder first gcloud projects delete {project_id} --quiet # Step 2: Delete the provisioned Assured Workloads folder gcloud resource-manager folders delete {folder_id} # Step 3: Delete the Assured Workloads workload after folder deletion propagates gcloud assured workloads delete {workload_id} --organization={org_id} --location={location} --quiet- Propagation Delay &
--etagNote: Folder deletion state (DELETE_REQUESTED) can take a brief propagation delay (15–60s) before Assured Workloads recognizes the folder as deleted. IfERROR_CODE_WORKLOAD_NOT_EMPTYtransiently persists after deleting the folder, wait 15–20 seconds and retrygcloud assured workloads deletewithout a stale--etag(as deleting underlying resources changes the workload's concurrency token).
- Propagation Delay &
Workflow 4: Update an Assured Workloads workload (UpdateWorkload & Compliance Updates)
4A. Update Workload Metadata & Notifications (gcloud assured workloads update)
- Updatable Fields (at least one required):
--display-name="{new_display_name}": 4–30 characters ([a-zA-Z0-9 -], no trailing spaces).--labels=key1=val1,key2=val2: Replaces the workload's label map (include existing labels to preserve them).--violation-notifications-enabled=true|false: Enables or disables email notifications for organization policy compliance violations to Essential Contacts (Legal category).--etag={etag}: Current concurrency token fromdescribe/list.
- Immutable Fields (Cannot Be Modified After Creation):
complianceRegime,location,billingAccount, andpartnerare immutable.gcloud assured workloads updatecannot change a workload'scomplianceRegimeorlocationin-place; changing regimes requires creating a new Assured Workloads workload. - Validate, Confirm, & Execute: Validate with
python3 scripts/validate_params.py --operation=update ..., obtain explicit user confirmation, and run:gcloud assured workloads update {workload_id} --organization={org_id} --location={location} \ [--display-name="{new_display_name}"] [--labels=key1=val1,key2=val2] \ [--violation-notifications-enabled=true|false] [--etag={etag}] --format=json
4B. List & Apply Compliance Posture Updates (updates.list & updates.apply)
gcloud assured workloads does not have a built-in CLI subcommand to list or apply compliance posture updates from the updates sub-resource (gcloud assured workloads update only updates workload metadata). Use scripts/manage_workload_updates.py (--action=list or --action=apply after user confirmation) or googleapiclient.discovery.build against the regional Assured Workloads v1 API (https://{location}-assuredworkloads.googleapis.com):
AVAILABLEvs.WITHDRAWNUpdate States:AVAILABLE(One Update Per Constraint): EachAVAILABLEupdate record corresponds to an individual organization policy constraint update (details.orgPolicyUpdate.suggestedPolicy.constraint). If multiple updates areAVAILABLE, each corresponds to a different constraint and must be applied individually (or sequentially via--update-id=ALL)—applying the newest update does not apply olderAVAILABLEupdates for other constraints.WITHDRAWN(Superseded): When a newer policy update supersedes an older unapplied update for the same constraint, Assured Workloads marks the older updateWITHDRAWN. Filter for stateAVAILABLEand never applyWITHDRAWNupdates.
- Python Discovery API Pattern (
updates.list,updates.apply, & LRO Polling):import time from google.api_core.client_options import ClientOptions from googleapiclient import discovery service = discovery.build( "assuredworkloads", "v1", client_options=ClientOptions( api_endpoint=f"https://{location}-assuredworkloads.googleapis.com" ), ) parent = f"organizations/{org_id}/locations/{location}/workloads/{workload_id}" # 1. List updates and filter for AVAILABLE state resp = ( service.organizations() .locations() .workloads() .updates() .list(parent=parent) .execute() ) available = [u for u in resp.get("updates", []) if u.get("state") == "AVAILABLE"] # 2. Apply each AVAILABLE update and poll the returned Long-Running Operation (LRO) for update in available: op = ( service.organizations() .locations() .workloads() .updates() .apply(name=update["name"], body={}) .execute() ) while not op.get("done", False): time.sleep(3) op = ( service.organizations() .locations() .operations() .get(name=op["name"]) .execute() )
Common Error Handling & Troubleshooting (scripts/diagnose_error.py)
Never blindly retry deterministic 400 INVALID_ARGUMENT, 403 PERMISSION_DENIED, 404 NOT_FOUND, or FAILED_PRECONDITION errors. Run python3 scripts/diagnose_error.py --error-message="{error_output_text}" to match any error against the full Assured Workloads ErrorInfo.reason catalog.
Troubleshooting Folder creation was unsuccessful. Please try again. (LRO Inspection)
When gcloud assured workloads create fails with the generic message Folder creation was unsuccessful. Please try again., do not blindly retry. Inspect the failed Long-Running Operation (LRO) in the same organization and location to retrieve the specific ErrorInfo.reason:
gcloud assured operations list --organization={org_id} --location={location} --format=json
gcloud assured operations describe {operation_id} --organization={org_id} --location={location} --format=json
(Or run python3 scripts/diagnose_error.py --fetch-latest-lro --organization={org_id} --location={location}).
Common Folder Creation Preconditions to Check in the LRO Error:
- Duplicate sibling folder display name (
ERROR_CODE_FOLDER_NAME_UNIQUENESS): A sibling folder with the same--display-namealready exists under the target parent (organizations/{org_id}orfolders/{parent_folder_id}). Choose a unique--display-nameor a different--provisioned-resources-parent. - Nesting inside an existing Assured Workloads folder (
ERROR_CODE_INVALID_PROVISIONED_RESOURCES_PARENT): Assured Workloads folders cannot be nested inside another Assured Workloads folder. Specify a standard non-workload parent folder or omit--provisioned-resources-parent. - Folder quota or nesting depth limit (
ERROR_CODE_FOLDER_CREATION_PRECONDITION_FAILED): The target parent reached the Cloud Resource Manager 300 direct child-folder quota or the 10-level folder nesting depth limit.
Reference Documentation
- references/regimes.md: Complete table of all 45 Assured Workloads V1 compliance regimes, modern
DATA_BOUNDARY_FOR_*enums, legacy aliases, partner enums, and supported regional/multi-regional locations. - Official Google Cloud Documentation: Assured Workloads Overview, Supported Locations & Data Boundaries, Assured Workloads Pricing, Apply Workload Updates, Sovereign Controls by Partners Overview, Sovereign Controls by Partners Locations.
04 同仓库更多 Skills
sign-in-with-google-web
Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS / `https://accounts.google.com/gsi/client`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in React/Next.js/Angular/HTML, verifying ID tokens on backend runtimes (Python/Node.js/Go/Java), enforcing Google Workspace domain restrictions (`hd`), securing client-side ID tokens via WebCrypto nonces or encrypted IndexedDB, embedding in cross-origin iframes via the Intermediate Iframe API (`https://accounts.google.com/gsi/intermediate`), configuring Content Security Policy (CSP), COOP, and Permissions Policy (`identity-credentials-get`) headers, or handling sign-out and revocation. Don't use for legacy Google Sign-In (`gapi.auth2`), Google Cloud IAM service accounts, or Android/iOS native Credential Manager.
dpop-adoption
Implement and debug OAuth 2.0 DPoP (RFC 9449) refresh token sender-constraining for WebCrypto, Node.js ES6, and browser runtimes integrating with Google's OAuth platform. Use when configuring non-extractable asymmetric key pairs (P-256), generating DPoP Proof JWTs for authorization code exchange and token refresh, or handling 400 use_dpop_nonce challenge retry loops at oauth2.googleapis.com/token. Don't use for unconstrained OAuth 2.0 flows (where refresh tokens are not bound to a client key pair), or for Google Cloud IAM / service account authentication.
retrieving-developer-knowledge
Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms. Integrates with the Developer Knowledge MCP server (search_documents, get_documents, answer_query) or the Developer Knowledge REST API fallback. Use when searching for gcloud CLI commands, API syntax, IAM permissions, official documentation, architectural comparisons, or product choice overviews. Don't use for local filesystem lookups or non-Google documentation.
migrate-to-rust
Clones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure/fix cycle, and Profile-Guided Optimization (PGO) stage, and producing a first-person AI storytelling report and interactive HTML infographic. Use when migrating a GitHub repository or local codebase to Rust, porting legacy C++, Fortran, Python, or Java workloads to memory-safe Rust, designing Struct-of-Arrays (SoA) or SIMD Rust architectures, or optimizing Rust ports with LLVM PGO. Don't use for unrelated non-Rust refactoring or single-line syntax questions.
finding-google-skills
Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or setting up part of their stack, such as where to run a service, a database, storage, messaging, authentication, analytics, ads, or AI model serving, and a Google product is a reasonable candidate - whether or not a vendor is named - or when a request names a Google product or API. Brings in the matching Google skill so the answer can weigh Google options, their trade-offs, and when they are not the right fit. Skip when the stack is already settled on another provider and no Google product is named, or the task involves no platform choice.
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.