enforcing-resource-attribution

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

Updated Aug 26, 2026
One-click install
npx skills add https://github.com/Lathika-laa/Recipe_Box --skill enforcing-resource-attribution-lathika-laa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enforcing-resource-attribution
Source: https://github.com/Lathika-laa/Recipe_Box/tree/main/.github/.gemini/skills/enforcing-resource-attribution
Command: npx skills add https://github.com/Lathika-laa/Recipe_Box --skill enforcing-resource-attribution-lathika-laa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents running BigQuery and Google Cloud CLI commands often create or modify cloud resources without any attribution, making it impossible to track which environment or client initiated the operations. This Skill enforces consistent labeling so resource usage can be traced back to its source. ## Core Features & Use Cases - BigQuery Label Enforcement: Automatically adds the mandatory --label datacloud:<ide> flag to supported bq subcommands (query, load, extract, mk, update, cp) while omitting it from read-only commands like bq show or bq ls that reject the flag. - gcloud Metrics Attribution: Prepends CLOUDSDK_METRICS_ENVIRONMENT=datacloud.<ide> to every gcloud command, covering both read-only and mutation operations. - Environment Deduction: Maps the current client (VS Code, Cloud Shell, Cloud Workstations, Gemini CLI, etc.) to the correct label value, falling back to ai-agent when unknown. - Use Case: When an AI agent runs a BigQuery query from VS Code as part of a Data Agent Kit workflow, the command becomes bq query --use_legacy_sql=false --label datacloud:vscode "SELECT 1", ensuring the job is attributed correctly. ## Quick Start Ask the agent to run a BigQuery query or any gcloud command and it will automatically attach the correct attribution label or environment variable for your current client.

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 labels to bq query commands?▼

Add the --label datacloud:<ide> flag to bq query, replacing <ide> with your environment such as vscode or cloud-shell. For example: bq query --use_legacy_sql=false --label datacloud:vscode "SELECT 1".

How do I attribute gcloud commands to my environment?▼

Prepend CLOUDSDK_METRICS_ENVIRONMENT=datacloud.<ide> to every gcloud command, using dots instead of colons. This applies to all gcloud commands, whether read-only list operations or resource-creating mutations.

Which bq subcommands support the --label flag?▼

Only bq query, load, extract, mk, update, and cp accept the --label flag. Do not add it to bq show, ls, version, rm, cancel, or head, since those subcommands reject the flag and will fail.

When should I omit resource attribution labels?▼

Omit labels when running generic administrative commands unrelated to Data Cloud or Analytics, such as managing Compute Engine for web apps or standard IAM policies. Labels apply only to Data Agent Kit workflows and analytics infrastructure operations.

What label value should I use if my environment is unknown?▼

Use ai-agent as the fallback value when the environment cannot be determined. BigQuery labels cannot contain dots or spaces, while gcloud metric values use dots, such as datacloud.ai-agent.