Skip to content
Skills Library
DevOps & cloud · Automation

enforcing-resource-attribution

/enforcing-resource-attribution

Enforces resource attribution for CLI commands. Use this skill whenever you are running `bq` or `gcloud` commands via `run_command`. It ensures mandatory labeling for supported `bq` operations while avoiding invalid flags on read-only commands.

Licence
Apache-2.0
Last repository change
12.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.11.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Enforces resource attribution for CLI commands. Use this skill whenever you are running `bq` or `gcloud` commands via `run_command`. It ensures mandatory labeling for supported `bq` operations while avoiding invalid flags on read-only commands.

Original author description

Enforces resource attribution for CLI commands. Use this skill whenever you are running `bq` or `gcloud` commands via `run_command`. It ensures mandatory labeling for supported `bq` operations while avoiding invalid flags on read-only commands.

How it works

  1. Applicability
  2. BigQuery CLI (bq)
  3. Google Cloud SDK (gcloud)
Original SKILL.md headings · 125 lines, 489 words
SKILL.md preview
---
name: enforcing-resource-attribution
description: |
  Enforces resource attribution for CLI commands. Use this skill whenever you are running `bq` or `gcloud` commands via `run_command`. It ensures mandatory labeling for supported `bq` operations while avoiding invalid flags on read-only commands.
license: Apache-2.0
metadata:
  version: v7
  publisher: google
---

# Resource Attribution Enforcement

To track resources created or manipulated by AI agents, you **MUST** ensure that
standard CLI commands are tagged with appropriate attribution labels under
relevant conditions.

## Applicability

You should apply these attribution labels **ONLY** under the following
conditions:

1.  **DAK Tooling**: You are executing Python scripts, running MCP tools, or
    following workflows provided by the **Data Agent Kit**.
2.  **Domain Relevance**: You are operating on BigQuery datasets, GCS buckets,
    or Analytics infrastructure (including **Spark**, **Dataproc**, or
    Serverless Spark) intended for data preparation, deduplication, or analysis.

### 🚫 When to Omit

Do **NOT** apply these labels if you are running generic administrative commands
or working on infrastructure completely unrelated to Data Cloud / Analytics
(e.g., managing Compute Engines for web apps, setting up standard IAM policies,
etc.).

Do **NOT** apply `--label` flags to commands that do not accept labels, as the
`--label` flag is unsupported by these specific `bq` subcommands. These include:

-   `bq show`
-   `bq ls`
-   `bq version`
-   `bq rm`
-   `bq cancel`
-   `bq head`

## BigQuery CLI (`bq`)

You **MUST** apply `--label key:value` **ONLY** to subcommands that accept job
or resource labels (`bq query`, `bq load`, `bq extract`, `bq mk`, `bq update`,
and `bq cp`).

-   **Flag Form**: `--label key:value`
-   **Mandatory Label**: `datacloud:<ide>`
-   **Deduction Rule**: Substitute `<ide>` with your actual environment/client
    (e.g., `vscode`, `antigravity`, `codex`, `cursor`, `cloud-shell`,
    `workstation`, `gemini-cli`, `claude`).
    *   Use `cloud-shell` for GCP Cloud Shell.
    *   Use `workstation` for GCP Cloud Workstations. If you cannot determine
        your environment, use `ai-agent`. Note that BigQuery labels **cannot**
        contain dots or spaces.

### Examples

#### Query Example

**Incorrect**:

```bash
bq query --use_legacy_sql=false "SELECT 1"
```

**Correct** (assuming you are running in VS Code):

```bash
bq query --use_legacy_sql=false --label datacloud:vscode "SELECT 1"
```

#### Copy Example

**Incorrect**:

```bash
bq cp dataset1.table1 dataset2.table1_copy
```

**Correct** (assuming you are running in Antigravity):

```bash
bq cp --label datacloud:antigravity dataset1.table1 dataset2.table1_copy
```

--------------------------------------------------------------------------------

## Google Cloud SDK (`gcloud`)

Whenever you execute any `gcloud` command via `run_command`, you **MUST**
prepend the command with the `CLOUDSDK_METRICS_ENVIRONMENT` environment variable
to ensure proper resource attribution.

-   **Environment Variable**: prepend commands using the append form. It keeps
    any attribution another tool or skill already set on the same variable and
    adds the DAK tag after it, so both values reach the metrics pipeline:

    ```bash
    CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }datacloud.<ide>"
    ```

-   **Deduction Rule**: Substitute `<ide>` with your actual environment/client
    (e.g., `vscode`, `antigravity`, `codex`, `cursor`, `cloud-shell`,
    `workstation`, `gemini-cli`, `claude`).

    *   Use `cloud-shell` for GCP Cloud Shell.
    *   Use `workstation` for GCP Cloud Workstations. If you cannot determine
        your environment, use `ai-agent`. Note that values must use dots (e.g.,
        `datacloud.vscode`), not colons.

### Examples

**Incorrect**:

```bash
gcloud compute disks create my-disk --size=10GB
```

**Correct** (assuming you are running in VS Code):

```bash
CLOUDSDK_METRICS_ENVIRONMENT="${CLOUDSDK_METRICS_ENVIRONMENT:+$CLOUDSDK_METRICS_ENVIRONMENT }datacloud.vscode" gcloud compute disks create my-disk --size=10GB
```

> [!IMPORTANT]
>
> This applies to **ALL** `gcloud` commands, whether they are read-only
> (`gcloud ... list`) or mutations (`gcloud ... create`).

Versions

RepositoryScoreLicence
This page · googlecloudplatform/data-agent-kit-plugin100Apache-2.0
gemini-cli-extensions/data-agent-kit-starter-pack100Apache-2.0

Database snapshot: 13.11.2026 · package version c8213016ac67 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100gcloud
    Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure. Use when planning, generating, constructing, proposing, describing, or executing any gcloud CLI commands - including when…
  • 100gcloud
    Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure. Use when planning, generating, constructing, proposing, describing, or executing any gcloud CLI commands - including when…
  • 100gcloud
    Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure. Use when planning, generating, constructing, proposing, describing, or executing any gcloud CLI commands - including when…
  • 100gcloud
    为跨 Google Cloud Platform (GCP) 服务和基础设施的 gcloud CLI 操作提供安全关键的校验、防护措施和数据精简。 在规划、生成、构造、提议、描述或执行任何 gcloud CLI 命令时使用——包括回答关于 gcloud 语法或标志格式的问题时。 不要在编写 Google Cloud 客户端库代码或原始 REST/gRPC API 请求时使用。
  • 100gcloud
    Interacts with Google Cloud services using the gcloud CLI safely and efficiently. Covers command validation, data reduction, safety guardrails with a denylist, and workflows for discovery and investigation. You MUST read this skill before invoking any gcloud command. Use when…
  • 100gcloud
    Use the gcloud CLI from a Centaur sandbox, where iron-proxy injects Google Cloud credentials on the wire. Use before any gcloud command, Google Cloud deploy, Cloud Run, Cloud Build, Artifact Registry, Cloud Storage, or IAM task, and whenever gcloud reports no credentialed…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.