enforcing-resource-attribution

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

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Yashyasik/zexca-api --skill enforcing-resource-attribution-yashyasik
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enforcing-resource-attribution
Source: https://github.com/Yashyasik/zexca-api/tree/main/.gemini/skills/enforcing-resource-attribution
Command: npx skills add https://github.com/Yashyasik/zexca-api --skill enforcing-resource-attribution-yashyasik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cloud resources created or modified by AI agents often lack attribution, making it impossible to track which environment or client created them. This Skill ensures every relevant bq and gcloud command carries proper attribution labels so resource usage can be traced back to its origin. ## Core Features & Use Cases - BigQuery Labeling: Automatically adds --label datacloud:<ide> to label-supporting 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 Environment Tagging: Prepends CLOUDSDK_METRICS_ENVIRONMENT=datacloud.<ide> to every gcloud command, covering both read-only and mutation operations. - Environment Detection: Deduces the correct IDE/client identifier (e.g., vscode, cursor, gemini-cli, cloud-shell) with an ai-agent fallback. - Use Case: When an AI agent runs a BigQuery query to deduplicate a dataset in VS Code, the command becomes bq query --use_legacy_sql=false --label datacloud:vscode ..., 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 IDE.

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 flag in the form --label datacloud:<ide> to label-supporting subcommands like bq query, load, extract, mk, update, and cp. For example: bq query --use_legacy_sql=false --label datacloud:vscode "SELECT 1".

How do I tag gcloud commands for resource attribution?▼

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

Which bq subcommands do not support the --label flag?▼

The --label flag is unsupported by bq show, bq ls, bq version, bq rm, bq cancel, and bq head. Applying it to these read-only or unsupported subcommands causes errors, so labels must be omitted.

When should attribution labels be omitted from CLI commands?▼

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

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

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