Skillpedia
الأمان22k · #10198

agent-platform-access-audit

ما الذي تفعله

تستعلم هذه المهارة سجلات تدقيق Cloud في BigQuery لتبيّن الموارد التي لمسها الوكيل، والهويات التي تصرّف بها، وأسباب رفض الطلبات. وهي مناسبة لفرق الأمن والمنصات التي تراقب وكلاء الذكاء الاصطناعي في Google Cloud.

متى تستخدمها

  • ✓عندما تريد معرفة الموارد التي وصل إليها وكيل ذكاء اصطناعي في Google Cloud.
  • ✓عندما ترى خطأ PERMISSION_DENIED وتحتاج إلى معرفة هل هو مشكلة في الحد الأمني أم في IAM.
  • ✓عندما تريد أهم الهويات التي تصرف بها الوكيل خلال فترة زمنية.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/google/skills/blob/main/skills/cloud/agent-platform-access-audit/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“ماذا وصل إليه وكيل الذكاء الاصطناعي الخاص بي في Google Cloud الأسبوع الماضي، ولماذا رُفضت بعض الطلبات؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تتحقق المهارة من الأدوات والواجهات المطلوبة، وتشغّل استعلامات 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
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة