본문으로 건너뛰기
Skillpedia
보안22k · #10198

agent-platform-access-audit

하는 일

BigQuery에서 Cloud Audit Logs를 조회해 에이전트가 건드린 리소스, 대신 행동한 신원, 요청이 거부된 이유를 보여 줍니다. Google Cloud에서 AI 에이전트를 감시하는 보안 및 플랫폼 팀을 위한 스킬입니다.

사용하는 경우

  • ✓AI 에이전트가 어떤 Google Cloud 리소스에 접근했는지 알아야 할 때.
  • ✓PERMISSION_DENIED 오류가 보여 경계 문제인지 IAM 문제인지 알아야 할 때.
  • ✓특정 시간 범위 동안 에이전트가 대신 행동한 상위 신원을 알고 싶을 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/cloud/agent-platform-access-audit/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-access-audit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지난주에 제 AI 에이전트가 Google Cloud에서 무엇에 접근했고, 거부된 요청은 왜 있었나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 필요한 도구와 API를 확인하고, 감사 로그에 대해 BigQuery 쿼리를 실행한 뒤, 결과를 접근, 영향 범위, 거부 이유로 묶습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Agent Access Audit

Use this skill to audit AI agent resource accesses, blast radius, and policy denials in Google Cloud using Cloud Audit Logs.

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.

Prerequisites

Only refer to this section if a command fails. Proceed directly with the workflow below, and only if a gcloud or bq command fails with an authentication, API, billing, or PERMISSION_DENIED error, tell the user what they need to do (do NOT configure or grant these yourself):

  • Google Cloud CLI: gcloud and bq installed (installation guide).

  • Authentication: Active credentials via gcloud auth login or gcloud auth application-default login.

  • Active Billing Account: The Google Cloud project must have an active billing account attached (required for running bq query jobs against _AllLogs).

  • Enabled APIs: logging.googleapis.com, bigquery.googleapis.com, and agentregistry.googleapis.com. If any required API is disabled, provide the exact enablement command:

    gcloud services enable logging.googleapis.com bigquery.googleapis.com agentregistry.googleapis.com --project={PROJECT_ID}
    
  • IAM roles on the project: roles/logging.privateLogViewer, roles/bigquery.dataViewer, roles/bigquery.jobUser, and roles/agentregistry.viewer.


Execution workflow

Follow these steps in order before answering any audit question:

Step 1: Resolve the project ID ({PROJECT_ID})

  1. If the user explicitly provides a Google Cloud project ID in the prompt, use that project ID.

  2. If the project ID is omitted from the prompt, run:

    gcloud config get-value project
    
  3. If gcloud config get-value project returns empty or (unset), stop and ask the user which Google Cloud project ID to query. Never leave {PROJECT_ID} as a literal placeholder in a SQL query.

Step 2: Resolve the exact SPIFFE principal ({PRINCIPAL_SUBJECT})

Cloud Audit Logs record the agent's SPIFFE runtime identity (principal://...), not its human-readable display name, since multiple agents in a project can share the same display name while having different SPIFFE identities.

  1. If the user provides a principal://... URI in the prompt: Use that exact string as {PRINCIPAL_SUBJECT}.

  2. If the user provides an agent display name (for example, financial-advisor) instead of a principal://... URI: Look up the agent's location via Cloud Asset Inventory and then search Agent Registry to retrieve its SPIFFE principal before querying _AllLogs:

    LOCATION=$(gcloud asset search-all-resources \
      --scope=projects/{PROJECT_ID} \
      --query='displayName:"{AGENT_NAME}"' \
      --format="value(location)" \
      --limit=1)
    
    echo "Resolved location: $LOCATION"
    
    gcloud agent-registry agents search \
      --location="${LOCATION:-global}" \
      --project={PROJECT_ID} \
      --search-string="displayName:{AGENT_NAME}" \
      --format=json
    

    Extract the SPIFFE URI from attributes["agentregistry.googleapis.com/system/RuntimeIdentity"]["principal"]:

    • Single match: Use its principal://... value as {PRINCIPAL_SUBJECT}.
    • IMPORTANT: Identity does NOT start with principal:// (for example, starts with sa:// or is missing): Stop immediately and do NOT run bq query or check _AllLogs. Inform the user that the agent's runtime identity is not a SPIFFE ID (for example, it uses a shared service account sa://...), and that Agent Access Audit requires an agent with a principal://... SPIFFE identity.
    • Multiple matches with different principal://... URIs: List the matching agents alongside their name, location, and principal://... URIs, and ask the user which specific agent to audit before running bq query.
    • No matches (or no agent specified): Stop and ask the user to provide the agent's principal://... identity URI.
  3. SQL Parameterization Rule: Never pass a display name (such as `principal_subject = 'financia

자주 묻는 질문

접근 설정을 바꾸나요?

아닙니다. 로그를 읽는 감사이며, 권한을 부여하거나 바꾸지 않습니다.

어떤 도구를 설치해야 하나요?

Google Cloud CLI와 bq가 필요하며, 활성 자격 증명과 프로젝트의 결제 계정이 있어야 합니다.

경계 오류와 권한 오류를 어떻게 구분하나요?

VPC Service Controls 경계 위반과 IAM 권한 거부를 나눠서 구분합니다.

상세 정보

작성자의 원본 설명

Audits AI agent data access, blast radius, and blocked policy operations in Google Cloud by querying Cloud Audit Logs via BigQuery. Use when investigating what resources or services an agent accessed, identifying top originating principals the agent is acting as, or triaging PERMISSION_DENIED errors to distinguish VPC Service Controls perimeter violations from IAM permission denials. Don't use for configuring Cloud Monitoring alert policies, modifying IAM policies or VPC Service Controls perimeters, querying non-audit application logs, or performing write operations.

repo: google/skills

인기도

GitHub 스타
22k
순위
#10198
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬