enforcing-resource-attribution

Appends attribution labels to bq and gcloud CLI commands for resource tracking.

Updated Jan 8, 2026
One-click install
npx skills add https://github.com/arslan9024/White-Caves --skill enforcing-resource-attribution-arslan9024
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enforcing-resource-attribution
Source: https://github.com/arslan9024/White-Caves/tree/main/.agents/skills/enforcing_resource_attribution
Command: npx skills add https://github.com/arslan9024/White-Caves --skill enforcing-resource-attribution-arslan9024

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When AI agents run BigQuery (bq) or Google Cloud SDK (gcloud) commands, the resources they create or modify lack attribution metadata, making it impossible to track which environment or client created them. This Skill enforces consistent labeling so cloud resource usage can be traced back to its origin. ## Core Features & Use Cases - BigQuery Label Enforcement: Automatically appends --label datacloud=<ide> to bq commands such as query, load, extract, mk, and cp. - gcloud Environment Variable Injection: Prepends CLOUDSDK_METRICS_ENVIRONMENT=datacloud.<ide> to every gcloud command, whether read-only or mutating. - Environment Detection Rules: Maps the current client (e.g., vscode, cursor, cloud-shell, workstation, gemini-cli, claude) to the correct label value, falling back to ai-agent when unknown. - Use Case: An AI agent running a bq query inside VS Code automatically produces bq query --use_legacy_sql=false --label datacloud=vscode "SELECT 1", ensuring the query job is attributed in BigQuery audit logs. ## Quick Start Ask the agent to run a BigQuery query or any gcloud command and it will automatically attach the correct datacloud attribution label for your environment.

Frequently Asked Questions about enforcing-resource-attribution

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add attribution labels to bq commands?▼

Append the --label datacloud=<ide> flag to any bq command that accepts labels, such as bq query, bq load, bq extract, bq mk, or bq cp. Replace <ide> with your environment name like vscode or cursor, using ai-agent if unknown.

How do I tag gcloud commands for resource attribution?▼

Prepend the environment variable CLOUDSDK_METRICS_ENVIRONMENT=datacloud.<ide> before every gcloud command. This applies to all gcloud operations, including read-only list commands and resource-creating mutations.

When should attribution labels be omitted from CLI commands?▼

Omit labels for generic administrative commands unrelated to Data Cloud or analytics, such as managing Compute Engine instances for web apps or configuring standard IAM policies. Labels apply only to Data Agent Kit workflows on BigQuery, GCS, or analytics infrastructure.

What label value should I use in Google Cloud Shell or Workstations?▼

Use cloud-shell when running in GCP Cloud Shell and workstation when using GCP Cloud Workstations. If the environment cannot be determined, fall back to the value ai-agent.

Why do BigQuery labels reject dots or spaces in values?▼

BigQuery label values cannot contain dots or spaces, so bq labels use the form datacloud=vscode. In contrast, the gcloud environment variable uses dot notation such as datacloud.vscode, so the two formats must not be interchanged.