一键导入
adk-gemini-enterprise-datastore-connector
Skill for connecting ADK agents to Gemini Enterprise connected data sources with secure user-level access control.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Skill for connecting ADK agents to Gemini Enterprise connected data sources with secure user-level access control.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Deploys an A2UI ADK agent cleanly to Google Cloud Run in namespaced A2A-compatibility mode.
Expert guide and patterns for building Agent-Driven User Interfaces (A2UI) using the ADK.
Deploys ADK agents to Vertex AI Agent Engine using the Python SDK and registers them with Gemini Enterprise.
Comprehensive guide to building, orchestrating, and deploying agents with the Google Agent Development Kit (ADK).
Provisions a PostgreSQL Cloud SQL instance, database, database user, and registers connection details in Secret Manager using Terraform.
Provisions a scheduled Cloud Scheduler job with secure OIDC token authentication to invoke HTTP targets (such as Reasoning Engine endpoints) using Terraform.
| name | ADK Gemini Enterprise Datastore Connector |
| description | Skill for connecting ADK agents to Gemini Enterprise connected data sources with secure user-level access control. |
This skill provides guidelines and patterns for connecting ADK agents to Gemini Enterprise connected data sources. The primary focus is on secure user-level access control (ACLs) by propagating the user's OAuth token.
When searching an enterprise datastore (e.g., Google Drive, Jira), the agent must respect the calling user's permissions. This is achieved by passing the user's OAuth token directly to the Datastore API (Discovery Engine API).
In the Gemini Enterprise runtime, the user's access token is injected into the agent's session state.
Retrieve the token from the ToolContext using the key defined by the environment variable AUTH_NAME:
from google.adk.tools import ToolContext
def my_tool(query: str, tool_context: ToolContext):
auth_name = os.getenv("AUTH_NAME")
access_token = tool_context.state.get(auth_name)
# Use access_token in API calls
For local testing where the Gemini Enterprise runtime is not available, fall back to Application Default Credentials (ADC).
from google.auth import default
from google.auth import transport
if access_token:
# Use retrieved token
else:
# Fallback to ADC
creds, project_id = default()
auth_req = transport.requests.Request()
creds.refresh(auth_req)
access_token = creds.token
Use a generic client to handle API communication. Do not hardcode specific datastore IDs or project IDs; use environment variables.
See examples/tools_template.py for a reusable template.
Focus this skill on integrating the datastore tool. Use the ADK Developer skill for general agent building and orchestration.
See examples/agent_usage.py for a minimal usage example.
When designing an agent that uses this skill, the architect MUST include a section in the architecture document detailing the differences between local testing and testing on Gemini Enterprise. This is crucial because the authentication mechanisms differ significantly (ADC vs. Session-injected OAuth tokens), affecting how user permissions (ACLs) are enforced.
Include a table or summary similar to the following in the design:
| Feature | Local Testing | Gemini Enterprise |
|---|---|---|
| Auth Method | Application Default Credentials (ADC) | User OAuth Token (Session Injected) |
| Identity Used | Developer's identity | Calling End-User's identity |
| ACL Enforcement | Based on Developer's access | Based on End-User's access |
When retrieving configuration like PROJECT_ID and LOCATION in your tools, use fallbacks to support both local development and Agent Engine runtime:
project_id = os.getenv("PROJECT_ID") or os.getenv("GOOGLE_CLOUD_PROJECT")
location = os.getenv("LOCATION") or os.getenv("GOOGLE_CLOUD_LOCATION")
Note that GOOGLE_CLOUD_PROJECT is reserved in Agent Engine and cannot be set manually in the environment variables block of the deployment config.
When instructing the agent to use the datastore search tool, ensure it handles relative or temporal queries (like 'last', 'latest', 'recent') gracefully. Keyword search engines might not understand these terms directly. Instruct the agent to:
For production deployments, it is recommended to use the generalized Terraform approach documented in the Agent Engine Terraform Deployer skill. This ensures reproducible deployments and proper management of infrastructure state.
Use the Gemini Enterprise Agent Registrar skill to perform the registration and handle OAuth setup. When constructing the registration payload, ensure that:
authorizationConfig in the registration payload uses the numeric PROJECT_NUMBER instead of the PROJECT_ID.cloud-platform (e.g., for real-time federation to third-party systems like Jira or Workspace apps like Google Drive).