Gemini Code Assist 工具权限
使用集合让一切井井有条 根据您的偏好保存内容并对其进行分类。
本通知介绍了 Gemini Code Assist 工具如何使用您的数据并代表您发出 API 调用。
当您使用 Gemini Code Assist 工具时,Gemini Code Assist 工具会收集您的提示,并向第三方服务发出包含从提示中获取的数据的 API 调用。本文档简要介绍了每种工具可以发出的 API 调用以及与第三方服务共享的数据。
与第三方服务共享的数据
Gemini Code Assist 工具可以将使用 @TOOL_NAME
语法发送给它们的所有数据与其第三方服务共享。Gemini Code Assist 工具不会在工具之间共享数据。除非您通过 @TOOL_NAME
语法明确请求,否则 Gemini Code Assist 工具不会将您的对话记录共享给第三方服务。
以下部分列出了当您通过 Gemini Code Assist 对话功能提示第三方工具时,每个第三方工具可以代表您发出的 REST API 调用。
GitHub
当您通过 Gemini Code Assist 对话功能发出提示时,GitHub 工具可以代表您使用以下 REST API 调用:
issues-and-pull-requests.create-issue
:此 REST API 调用会在 GitHub 代码库中创建一个问题,并提供 GitHub 代码库、所有者和问题标题。 issues-and-pull-requests.list-comments
:给定 GitHub 代码库、所有者和问题编号,此 REST API 调用可获取与拉取请求或问题相关的评论。 search.code
:在整个 GitHub 中搜索代码。 search.commits
:您可以在整个 GitHub 中进行全局提交搜索,也可以在特定代码库或组织内进行提交搜索。 search.issues-and-pull-requests
:此 REST API 调用可让您搜索特定问题和拉取请求,以便根据状态(例如“已打开”或“已关闭”)和关键字在您有权访问的所有代码库中检索与之相关的所有信息。
API 权限:
repo
:授予对公共和私有代码仓库的完全访问权限。此范围包括 repo:status
、repo_deployment
、public_repo
、repo:invite
、security_events
、administration
、read:org
、write:org
、read:public_key
、write:public_key
、read:gpg_key
、write:gpg_key
、gist
、workflow
和 codespace
。
GitLab
当您通过 Gemini Code Assist 对话功能发出提示时,GitLab 工具可以代表您使用以下 REST API 调用:
ListProjects
:检索当前用户的项目列表。 ListIssues
:检索指定项目的问题列表。 CreateIssue
:在指定项目中创建新问题。 ListMergeRequests
:检索指定项目的合并请求列表。 ListMergeRequestPipelines
:检索指定合并请求的流水线列表。
API 权限:
read_api
:授予对经过身份验证的用户的 API 的只读访问权限。 read_repository
:授予对代码库的只读访问权限。 read_user
:授予对经过身份验证的用户的个人资料信息的只读访问权限。 api
:授予对经过身份验证的用户的 API 的完整读写访问权限。
Google 文档
当您通过 Gemini Code Assist 对话功能发出提示时,Google 文档工具可以代表您使用以下 REST API 调用:
ListFiles
:根据给定的查询或过滤条件检索用户 Google 云端硬盘中的文件列表。 Export
:导出 Google 文档的内容,以便检查其内容。如果用户请求获取可能包含在给定文件中的任何信息,则应调用此 REST API。
API 权限:
drive.readonly
:允许对您的 Google 云端硬盘文件(包括您拥有的所有文件和您有权访问的文件)进行只读访问。
Sentry
当您通过 Gemini Code Assist 对话提示 Sentry 工具时,该工具可以代表您使用以下 REST API 调用:
organizations
:返回当前的 organization_id_or_slug
。 getIssue
:返回单个问题的详细信息。这会返回问题的基本统计信息(标题、上次看到、首次看到)、一些总体数字(评论数、用户报告数)以及汇总的事件数据。 transactions
:返回受问题影响的事务列表 issues
:返回为给定组织和项目分配的问题和错误列表。
API 权限:
event:read
:允许读取事件。 projects.read
:允许读取与项目相关的信息。 org.read
:允许读取与组织相关的信息。
Atlassian Rovo
当您通过 Gemini Code Assist 对话提示 Atlassian Rovo 工具时,该工具可以代表您使用以下 REST API 调用:
completions
:以 OpenAI 格式(对话消息列表)向 Atlassian Rovo 发送请求
API 权限:
rovo
:授予用户账号对 Atlassian Rovo 的访问权限。
MongoDB
当您通过 Gemini Code Assist 对话提示 MongoDB 工具时,该工具可以代表您使用以下 REST API 调用:
createConversation
:此聊天机器人可以回答有关数据库或 MongoDB 的任何问题、提供代码示例、解释主题等。此操作会初始化对话。 addMessage
:此聊天机器人可以回答有关数据库或 MongoDB 的任何问题、提供代码示例、解释主题等。此操作会向对话添加一条新消息。
API 权限:
- 未经用户身份验证。访问常规 MongoDB 文档聊天机器人。
New Relic
当您通过 Gemini Code Assist 对话提示 New Relic 工具时,该工具可以代表您使用以下 REST API 调用:
completions
:用于向 New Relic AI 发送用户提示并接收回答的端点
API 权限:
Redis
当您通过 Gemini Code Assist 对话提示 Redis 工具时,该工具可以代表您使用以下 REST API 调用:
chat
:用于向 Redis AI 发送用户提示并接收回答的端点
API 权限:
- 未经用户身份验证。访问常规 Redis 聊天机器人。
Neo4j
当您通过 Gemini Code Assist 对话提示 Neo4j 工具时,该工具可以代表您使用以下 REST API 调用:
invoke
:用于向 Neo4j AI Chatbot 发送用户提示并接收回答的端点
API 权限:
- 未经用户身份验证。访问常规 Neo4j 文档聊天机器人。
Snyk
当您通过 Gemini Code Assist 对话功能提示 Snyk 工具时,该工具可以代表您执行以下操作:
/scan
:从 Snyk 扩展程序提取漏洞日志 /scan new
:提取最新的漏洞日志
后续步骤
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-29。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-29。"],[],[],null,["| **Preview**\n|\n| This product or feature is in preview. Products and features that are\n| in preview are available \"as is\".\n\nThis notice describes how Gemini Code Assist tools use your data and\nmake API calls on your behalf.\n\nWhen you use Gemini Code Assist tools, Gemini Code Assist\ntools collect your prompts and make API calls that include data taken from your\nprompt to third-party services. This document outlines what API calls each tool\ncan make and what data is shared with the third party service.\n\nData shared with third-party services\n\nGemini Code Assist tools can share any data sent to them using the\n`@TOOL_NAME` syntax with their third-party service. Gemini Code Assist\ntools don't share data between tools. Gemini Code Assist tools don't\nshare your Gemini Code Assist chat history with third-party services\nexcept when you prompt them using the `@TOOL_NAME` syntax.\n\nREST API calls used by Gemini Code Assist tools\n\nThe following sections list the REST API calls each third-party tool can make\non your behalf when you prompt them from the Gemini Code Assist chat.\n\nGitHub\n\nThe GitHub tool can use the following REST API calls on your behalf when you\nprompt it from the Gemini Code Assist chat:\n\n- `issues-and-pull-requests.create-issue`: This REST API call creates an issue in a GitHub repository given a GitHub repository, owner, and an issue title.\n- `issues-and-pull-requests.list-comments`: This REST API call gets the comments associated with a pull request or an issue. given a GitHub repository, owner, and an issue number.\n- `search.code`: Searches for code across all of GitHub.\n- `search.commits`: You can search for commits globally across all of GitHub, or search for commits within a particular repository or organization.\"\n- `search.issues-and-pull-requests`: This REST API call lets you search for specific issues and pull requests to retrieve all information related to them across all repositories you have permission to access based on their state (e.g. open or closed) and keywords.\n\nAPI permissions:\n\n- `repo`: Grants full access to public and private repositories. This scope includes `repo:status`, `repo_deployment`, `public_repo`, `repo:invite`, `security_events`, `administration`, `read:org`, `write:org`, `read:public_key`, `write:public_key`, `read:gpg_key`, `write:gpg_key`, `gist`, `workflow`, and `codespace`.\n\nGitLab\n\nThe GitLab tool can use the following REST API calls on your behalf when you\nprompt it from the Gemini Code Assist chat:\n\n- `ListProjects`: Retrieves a list of projects for the current user.\n- `ListIssues`: Retrieves a list of issues for a specified project.\n- `CreateIssue`: Creates a new issue in a specified project.\n- `ListMergeRequests`: Retrieves a list of merge requests for a specified project.\n- `ListMergeRequestPipelines`: Retrieves a list of pipelines for a specified merge request.\n\nAPI permissions:\n\n- `read_api`: Grants read-only access to the authenticated user's API.\n- `read_repository`: Grants read-only access to the repository.\n- `read_user`: Grants read-only access to the authenticated user's profile information.\n- `api`: Grants complete read/write access to the authenticated user's API.\n\nGoogle Docs\n\nThe Google Docs tool can use the following REST API calls on your behalf when\nyou prompt it from the Gemini Code Assist chat:\n\n- `ListFiles`: Retrieve a list of files in the user's Google Drive based on a given query or filters.\n- `Export`: Export the contents of a Google Doc in order to inspect its contents. If the user is asking for any information that may be contained within a given file, this is the REST API that should be called.\n\nAPI permissions:\n\n- `drive.readonly`: Allows read-only access to your Google Drive files, including all files you own and files have access to.\n\nSentry\n\nThe Sentry tool can use the following REST API calls on your behalf when you\nprompt it from the Gemini Code Assist chat:\n\n- `organizations`: Return the current `organization_id_or_slug`.\n- `getIssue`: Return details on an individual issue. This returns the basic stats for the issue (title, last seen, first seen), some overall numbers (number of comments, user reports) as well as the summarized event data.\n- `transactions`: Return a list of transactions affected by an issue\n- `issues`: Return a list of issues and errors assigned for the given organization and project.\n\nAPI permissions:\n\n- `event:read`: Allows reading events.\n- `projects.read`: Allows reading project-related information.\n- `org.read`: Allows reading organization-related information.\n\nAtlassian Rovo\n\nThe Atlassian Rovo tool can use the following REST API calls on your behalf when\nyou prompt it from the Gemini Code Assist chat:\n\n- `completions`: Send a request to Atlassian Rovo in OpenAI format (a list of chat messages)\n\nAPI permissions:\n\n- `rovo`: Grants access to Atlassian Rovo in the user's account.\n\nMongoDB\n\nThe MongoDB tool tool can use the following REST API calls on your behalf when\nyou prompt it from the Gemini Code Assist chat:\n\n- `createConversation`: This chatbot can answer any question about databases or MongoDB, provide examples of code, explain topics, etc. This operation initializes the conversation.\n- `addMessage`: This chatbot can answer any question about databases or MongoDB, provide examples of code, explain topics, etc. This operation adds a new message to the conversation.\n\nAPI permissions:\n\n- Not user-authenticated. Accesses the general MongoDB docs chatbot.\n\nNew Relic\n\nThe New Relic tool can use the following REST API calls on your behalf when you\nprompt it from the Gemini Code Assist chat:\n\n- `completions`: Endpoint to send user prompts to New Relic AI and receive responses\n\nAPI permissions:\n\n- Access to New Relic's AI endpoint for the user's account.\n\nRedis\n\nThe Redis tool can use the following REST API calls on your behalf when you\nprompt it from the Gemini Code Assist chat:\n\n- `chat`: Endpoint to send user prompts to Redis AI and receive responses\n\nAPI permissions:\n\n- Not user-authenticated. Accesses the general Redis chatbot.\n\nNeo4j\n\nThe Neo4j tool can use the following REST API calls on your behalf when you prompt\nit from the Gemini Code Assist chat:\n\n- `invoke`: Endpoint to send user prompts to Neo4j AI Chatbot and receive responses\n\nAPI permissions:\n\n- Not user-authenticated. Accesses the general Neo4j docs chatbot.\n\nSnyk\n\nThe Snyk tool can perform the following operations on your behalf when you\nprompt it from the Gemini Code Assist chat:\n\n- `/scan`: Fetches vulnerability logs from Snyk Extension\n- `/scan new`: Fetches latest vulnerability logs\n\nWhat's next\n\n- Read [Gemini Code Assist: Terms of Service and Privacy Policies](/gemini-code-assist/resources/privacy-notices).\n- Learn more about [how Gemini Code Assist works](/gemini-code-assist/docs/works)."]]