Skip to content
Back to skills

Source Bff757009ea834a92ef10cef

ASecurity

Mandatory Step 0 pre-flight execution order and authentication verification for Google Cloud Platform (GCP), Application Default Credentials (ADC), gcloud CLI, Spark, Dataproc, BigQuery, GCS, and notebook runtimes. Use whenever interacting with GCP resources, running Spark/PySpark pipelines, BigQuery queries, GCS paths (gs://), or creating/running notebooks.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 7, 2026
ai-agentspythongoshellbashgcp

Works with

  • terminal
  • cli

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add gutsofpratik/OpenClaude-Skills --skill source-bff757009ea834a92ef10cef --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Source Bff757009ea834a92ef10cef?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Source Bff757009ea834a92ef10cef
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gutsofpratik-source-bff757009ea834a92ef10cef/badge)](https://www.skillsdirectory.com/skills/gutsofpratik-source-bff757009ea834a92ef10cef)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: google-cloud-auth-verification
description: >-
  Mandatory Step 0 pre-flight execution order and authentication verification for Google Cloud Platform (GCP),
  Application Default Credentials (ADC), gcloud CLI, Spark, Dataproc, BigQuery, GCS, and notebook runtimes.
  Use whenever interacting with GCP resources, running Spark/PySpark pipelines, BigQuery queries, GCS paths (gs://), or creating/running notebooks.
license: Apache-2.0
metadata:
  version: v2
  publisher: google
---

# Google Cloud Authentication Guidelines

## Mandatory Pre-Flight Execution & Auth Hierarchy

> [!IMPORTANT] **Pre-Flight Execution Priority Order**: Before generating code,
> implementation plans, or executing tasks for any GCP or Notebook workload:
>
> 1.  **Verify Shell, Script & Notebook Credentials**: If shell-based commands,
>     local Python scripts, or notebook kernels (`gs://...`, BigQuery, Dataproc)
>     are required, verify credentials via bundled probe (`gcloud auth list &&
>     gcloud config list`) or Application Default Credentials (ADC).
> 2.  **Distinguish Authentication vs. IAM Permissions**:
>     -   If `gcloud auth list` returns `No credentialed accounts`, **HARD
>         STOP** immediately and instruct the user to run `gcloud auth login`
>         and `gcloud auth application-default login`.
>     -   If Python throws `google.auth.exceptions.DefaultCredentialsError`,
>         explicitly direct the user to run `gcloud auth application-default
>         login`.
>     -   If `gcloud auth list` shows an active credentialed account but a
>         BigQuery/GCP call returns `403 Forbidden: Access Denied`, **DO NOT**
>         tell the user to log in again with `gcloud auth login`. Diagnose
>         missing IAM roles (e.g., `roles/bigquery.dataEditor`) on the active
>         account.
> 3.  **HARD STOP if Unauthenticated**: If no active GCP credentials or valid
>     `gcloud` authentication are detected, **STOP IMMEDIATELY**. Prompt the
>     user to run `gcloud auth login` and `gcloud auth application-default
>     login`. Do NOT attempt local virtualenv creation, package installation, or
>     local binary/JDK setup loops as workarounds.

## Common Error Messages

1.  **gcloud/bq CLI**:
    -   `ERROR: (bq) You do not currently have an active account selected.`
    -   `No credentialed accounts.`
    -   `Configuration error: No account is currently active.`
2.  **Execution Failures (Python/Notebooks)**:
    -   `google.auth.exceptions.DefaultCredentialsError: Could not automatically
        determine credentials.`
    -   `Forbidden: 403 Access Denied` (when it's clearly an auth issue).

## Verification Step

Before asking the user to log in, independently verify authentication status
using a single bundled probe command:

```bash
gcloud auth list --format="json" && gcloud config list --format="json"
```

*   If the output contains `No credentialed accounts.` or missing active
    account, proceed to **Corrective Action**.
*   If an account *is* listed but the user still receives a `403 Access Denied`
    error, the issue is likely **IAM permissions** (e.g., missing BigQuery
    roles) on their active account, rather than missing authentication. In this
    case, investigate permissions rather than asking them to log in again.

## Corrective Action

When missing credentials are confirmed, **DO NOT** attempt to fix credentials
via code or local virtualenv workarounds. Credentials must be established by the
user.

**Stop and ask the user to run the following commands in their terminal:**

1.  **To authenticate the gcloud CLI**: `gcloud auth login`
2.  **To set up Application Default Credentials (ADC)** (required for BQ CLI AND
    most libraries/notebooks): `gcloud auth application-default login`

## Post-Login Verification

After the user confirms they have logged in, verify with: `gcloud auth list`
Then proceed with the original task.

Files in this skill

  • PROVENANCE.json256 B
  • SKILL.md3.8 KB
  • UPSTREAM-LICENSE.txt11.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.